CGI/exercise1/include/Viewer.h

57 lines
1.6 KiB
C
Raw Normal View History

2018-09-06 12:35:43 +00:00
// This source code is property of the Computer Graphics and Visualization
// chair of the TU Dresden. Do not distribute!
// Copyright (C) CGV TU Dresden - All Rights Reserved
#pragma once
#include <gui/AbstractViewer.h>
class Viewer : public nse::gui::AbstractViewer
{
public:
Viewer();
void drawContents();
private:
void SetupGUI();
Eigen::Matrix4f modelViewMatrix, projectionMatrix;
//GUI Elements for the various options
nanogui::CheckBox* chkHasFaceCulling; //Shall back face culling be activated?
nanogui::CheckBox* chkHasDepthTesting; //Shall depth testing be activated?
nanogui::Slider* sldJuliaCX; //Seed for the Julia fractal
nanogui::Slider* sldJuliaCY;
nanogui::Slider* sldJuliaZoom; //Zoom factor for the Julia fractal
2018-10-21 14:18:27 +00:00
nanogui::Slider* point1X;
nanogui::Slider* point1Y;
nanogui::Slider* point2X;
nanogui::Slider* point2Y;
nanogui::Slider* point3X;
nanogui::Slider* point3Y;
2018-09-06 12:35:43 +00:00
// The following variables hold OpenGL object IDs
GLuint vertex_shader_id, // ID of the vertex shader
fragment_shader_id, // ID of the fragment shader
program_id, // ID of the shader program
vertex_array_id, // ID of the vertex array
position_buffer_id, // ID of the position buffer
color_buffer_id, // ID of the color buffer
uv_map_buffer_id; // ID of the uv_map
2018-10-17 11:00:47 +00:00
GLint view_uniform_id;
GLint proj_uniform_id;
2018-10-17 14:39:10 +00:00
GLint julia_m_id;
GLint julia_c_id;
2018-10-17 11:00:47 +00:00
2018-10-21 14:18:27 +00:00
GLint julia_pos_id;
2018-09-06 12:35:43 +00:00
// Read, Compile and link the shader codes to a shader program
void CreateShaders();
// Create and define the vertex array and add a number of vertex buffers
void CreateVertexBuffers();
};