-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathobject.h
More file actions
82 lines (59 loc) · 2.14 KB
/
Copy pathobject.h
File metadata and controls
82 lines (59 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef DRAWER_H
#define DRAWER_H
#include "core.h"
#include "arcball.h"
////////////////////////////////////////////////////////////////////////////////
class Object: public EventListener{
public:
Object();
~Object();
void RegisterShader(const char* vertexProgName, GLenum shaderType);
int LoadShaderFile(const char* fileName, GLuint shader);
void RebindShader(GLuint hVertexShader, GLuint hfragShader);
void CreateShaderProgram();
void EnableShader();
void rcSetUinforms();
void ComputeNormal(GLfloat v[3][3], GLfloat normal[]);
void Cube();
virtual void SimulateStep() {};
virtual void Show();
virtual bool LoadFile(char* fileName);
virtual void ComputeVertexNormal() {}
virtual void Reset();
virtual void MouseButton(GLFWwindow *window, int button,int action,int mods);
virtual void MouseMotion(GLFWwindow *window, double nx, double ny);
virtual void MouseScroll(GLFWwindow *window, double nx, double ny);
virtual void Keyboard(GLFWwindow * window, int key, int scancode, int action, int mods) {}
virtual void Resize(GLFWwindow *window, int x, int y);
void RegisterParentWindow(GLFWwindow* windowHandle);
//for rendering
GLuint initTFF1DTex(const char* filename);
GLuint initFace2DTex(GLuint bfTexWidth, GLuint bfTexHeight);
GLuint initVol3DTex(const char* filename, GLuint w, GLuint h, GLuint d);
void checkFramebufferStatus();
void initFrameBuffer(GLuint texObj, GLuint texWidth, GLuint texHeight);
void render(GLenum cullFace);
protected:
std::fstream _file;
GLfloat _rotX;
GLfloat _rotY;
GLfloat _depth;
//for event handling
bool _isLeftKeyPressed, _isCtrlPressed, _isRightKeyPressed, _isMiddleKeyPressed;
Arcball _arcball;
GLFWwindow* _windowHandle;
int _winX, _winY;
GLuint _shaderProg; //shader
GLuint _hShaders[10]; //support upto 10 shaders;
int _shaderNum; //current number of shaders
//for rendering
float _stepSize;
GLuint _vao;
GLuint _frameBuffer;
// transfer function
GLuint _tffTexObj;
GLuint _bfTexObj;
GLuint _volTexObj;
};
////////////////////////////////////////////////////////////////////////////////
#endif