-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShader.h
More file actions
41 lines (34 loc) · 908 Bytes
/
Copy pathShader.h
File metadata and controls
41 lines (34 loc) · 908 Bytes
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
#pragma once
#include "glee.h"
#include <map>
class MaterialProps;
class Shader
{
public:
Shader(GLenum type, const char* filename);
void load(const char* filename);
GLuint getId();
~Shader(void);
private:
GLuint m_id;
};
class ShaderProgram
{
public:
ShaderProgram(const char* vertShaderFilename, const char* fragShaderFilename);
GLuint getId();
void link();
void bind();
GLuint getUniform(const char* uniform);
void bindAttrib(GLuint index, const char* attribute);
void sendMatrices();
void sendUniform(const char* uniform, GLint value);
void sendUniform(const char* uniform, GLfloat value);
void sendUniform(const char* uniform, GLfloat x, GLfloat y, GLfloat z, GLfloat a);
void sendMaterialProps(MaterialProps props);
private:
GLuint m_id;
Shader *m_vertexShader;
Shader *m_fragmentShader;
std::map<const GLchar*, GLuint> m_uniforms;
};