-
Notifications
You must be signed in to change notification settings - Fork 0
/
shader.h
34 lines (29 loc) · 964 Bytes
/
shader.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
#ifndef SHADER
#define SHADER
#include <GL/glew.h>
#include <string>
#include <map>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
class Shader{
public:
Shader(std::string vertexPath, std::string fragmentPath);
~Shader();
void bind();
void unbind();
void addUniform(std::string name);
void setUniform(std::string name, int value);
void setUniform(std::string name, float value);
void setUniform(std::string name, glm::vec2 value);
void setUniform(std::string name, float value1, float value2);
void setUniform(std::string name, glm::vec3 value);
void setUniform(std::string name, float value1, float value2, float value3);
void setUniform(std::string name, glm::vec4 value);
void setUniform(std::string name, float value1, float value2, float value3, float value4);
void setUniform(std::string name, glm::mat4 value);
private:
GLint shaderProg;
std::map<std::string, GLuint> uniforms;
};
#endif