-
Notifications
You must be signed in to change notification settings - Fork 1
/
graphics.h
77 lines (59 loc) · 1.53 KB
/
graphics.h
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
#ifndef GRAPHICS_H
#define GRAPHICS_H
#include <iostream>
#include <stack>
using namespace std;
#include "graphics_headers.h"
#include "camera.h"
#include "shader.h"
#include "scene_graph.h"
#define numVBOs 2;
#define numIBs 2;
class Graphics
{
public:
~Graphics();
bool Initialize(int width, int height);
void Render();
SceneNode* AddObject(const std::string& identifier, Object* obj);
Camera* getCamera() { return m_camera; }
Shader* getShader() { return m_shader; }
GLint getModelMatrix() { return m_modelMatrix; }
GLint getPositionAttribute();
GLint getNormalAttribute();
GLint getTangentAttribute();
GLint getBitangentAttribute();
GLint getTextCoordAttribute();
GLint getHasNormalAttribute();
GLint getHasTextureAttribute();
GLint getIsEmissiveAttribute();
static Graphics* getInstance() {
if (instance == nullptr) {
instance = new Graphics();
}
return instance;
}
private:
Graphics();
static Graphics* instance;
std::string ErrorString(GLenum error);
bool collectShPrLocs();
Camera *m_camera;
Shader *m_shader;
GLint m_projectionMatrix;
GLint m_viewMatrix;
GLint m_modelMatrix;
GLint m_sunPos;
GLint m_sunPosition;
GLint m_positionAttrib;
GLint m_normalAttrib;
GLint m_tangentAttrib;
GLint m_bitangentAttrib;
GLint m_colorAttrib;
GLint m_tcAttrib;
GLint m_isEmissive;
GLint m_hasTexture;
GLint m_hasNormal;
SceneGraph* graph;
};
#endif /* GRAPHICS_H */