-
Notifications
You must be signed in to change notification settings - Fork 0
/
Renderer.h
executable file
·66 lines (46 loc) · 1.12 KB
/
Renderer.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
#ifndef RENDERER_H
#define RENDERER_H
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
#include "Shader.h"
#include <iostream>
namespace Engine
{
typedef struct {
GLfloat x, y, z;
} Vertex;
typedef struct {
GLubyte r, g, b, a;
} Color;
typedef struct {
GLfloat u, v;
} UV;
class Renderer
{
public:
Renderer();
~Renderer();
void load();
void translate( float x, float y, float z );
void rotateX( float a );
void rotateY( float a );
void rotateZ( float a );
void scale( float x, float y, float z );
void loadIdentity();
void drawSprite();
void drawQuad( float r, float g, float b, float a );
private:
glm::mat4 transMatrix;
glm::mat4 rotMatrix;
glm::mat4 scaleMatrix;
glm::mat4 camTransMatrix;
glm::mat4 camRotMatrix;
glm::mat4 camScaleMatrix;
glm::mat4 projectionMatrix;
GLuint vao, quad, color, uv;
Shader standard;
};
}
#endif // RENDERER_H