summaryrefslogtreecommitdiffstats
path: root/dev/a5-artrender/artrender_app.h
diff options
context:
space:
mode:
authorKT <tran0563@umn.edu>2021-09-06 19:07:33 -0500
committerKT <tran0563@umn.edu>2021-09-06 19:07:33 -0500
commitcccd3186305915d92b1751dc616979d64116a4aa (patch)
tree5dd4834daef547cd45fc0b643f44a10b581de0ad /dev/a5-artrender/artrender_app.h
parentAdded missing images for the A6 worksheet (diff)
downloadcsci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.gz
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.bz2
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.lz
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.xz
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.zst
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.zip
Upload a1
Diffstat (limited to 'dev/a5-artrender/artrender_app.h')
-rw-r--r--dev/a5-artrender/artrender_app.h102
1 files changed, 0 insertions, 102 deletions
diff --git a/dev/a5-artrender/artrender_app.h b/dev/a5-artrender/artrender_app.h
deleted file mode 100644
index 3005c4b..0000000
--- a/dev/a5-artrender/artrender_app.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/** CSci-4611 Assignment 5: Art Render
- */
-
-#ifndef ART_RENDER_APP_H_
-#define ART_RENDER_APP_H_
-
-#include <mingfx.h>
-using namespace mingfx;
-
-#include "edge_mesh.h"
-
-#include <string>
-#include <vector>
-
-
-/** Main application class for the ArtRender project.*/
-class ArtRenderApp : public GraphicsApp {
-public:
-
- ArtRenderApp();
- virtual ~ArtRenderApp();
-
- /// Rereads the shader programs file their txt files and recompiles them
- void OnReloadBtnPressed();
-
- /// Switches to gouraud shading
- void OnGouraudBtnPressed();
-
- /// Switches to phong shading
- void OnPhongBtnPressed();
-
- /// Switches to an artsy, toon rendering style
- void OnArtsyBtnPressed();
-
- /// Callbacks used for UniCam camera controls
- void OnLeftMouseDown(const Point2& pos);
- void OnLeftMouseDrag(const Point2& pos, const Vector2& delta);
- void OnLeftMouseUp(const Point2& pos);
- void UpdateSimulation(double dt);
-
- /// The GUI is setup here
- void InitNanoGUI();
-
- /// Models and shaders are loaded here, note these cannot be loaded within
- /// the constructor because the OpenGL context is not yet created at the
- /// time the constructor is called.
- void InitOpenGL();
-
- /// Rendering using shaders goes here.
- void DrawUsingOpenGL();
-
-private:
-
- void LoadShadersAndTextures();
-
- // 0 = gouraud, 1 = phong, 2 = artsy
- int shader_style_;
-
- // 0 for the first model loaded, ...
- int current_model_;
-
- // filenames, also used as the caption for the buttons
- std::vector<std::string> model_files_;
- // triangle mesh stored for each model file
- std::vector<Mesh> meshes_;
- // the "edge mesh" computed from the triangle mesh for each file
- std::vector<EdgeMesh> edge_meshes_;
-
- // position for the light source used in the shaders
- Point3 light_pos_;
-
- // per-vertex gouraud shading
- ShaderProgram gouraud_shaderprog_;
-
- // standard per-pixel phong shading
- ShaderProgram phong_shaderprog_;
-
- // toon shading
- ShaderProgram artsy_shaderprog_;
- // textures to use for calculating lighting cutoffs inside the toon shader
- Texture2D diffuse_ramp_;
- Texture2D specular_ramp_;
-
- // special program to use for drawing silhouette edges with the edge mesh
- ShaderProgram outline_shaderprog_;
-
-
-
- // Unicam stores/sets the view matrix based on mouse interaction since it
- // is in charge of moving around the camera.
- UniCam uni_cam_;
- Matrix4 proj_matrix_;
-
- // QuickShapes is just used to draw a little yellow sphere at the position
- // of the light.
- QuickShapes quick_shapes_;
-
- // A list of paths to search for data files (images and shaders)
- std::vector<std::string> search_path_;
-};
-
-#endif \ No newline at end of file