-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRenderer.hpp
More file actions
50 lines (39 loc) · 1.2 KB
/
Renderer.hpp
File metadata and controls
50 lines (39 loc) · 1.2 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
#ifndef RENDERER_H
#define RENDERER_H
#include <GL/glew.h>
#include <SFML/Window.hpp>
#include "glm.hpp"
class ShaderProgram;
class Texture;
class GameObject;
class Renderer
{
private:
sf::Window * window;
// the shader wrapper
ShaderProgram * program;
// shader input locations
GLuint projectionLoc, viewLoc, modelLoc, lightLoc, timeLoc; // uniform locations
GLuint verticesLoc, normalsLoc, uvsLoc; // attribute locations
GLuint colorMapLoc;
// buffered variables
float time;
glm::mat4 projection, view, model;
glm::vec3 light;
GLuint colorMap;
public:
Renderer( sf::Window * aWindow );
virtual ~Renderer();
void use( ShaderProgram * program );
void setProjection( glm::mat4 aProjection );
void setView( glm::mat4 aView );
void setModel( glm::mat4 aModel );
void setTime( float aTime );
void setLight( glm::vec3 aLight );
void setColorMap ( Texture * aColorMap );
void draw( GameObject * aWorld ); // starting point for drawing
void draw( unsigned int size, GLuint indicesId, GLuint verticesId, GLuint normalsId, GLuint uvsId ); // drawing mesh, all other uniforms etc should be allready available
private:
void findLocations();
};
#endif // RENDERER_H