-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathshader.h
33 lines (26 loc) · 811 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
#ifndef SHADER_INCLUDED_H
#define SHADER_INCLUDED_H
#include <string>
#include <GL/glew.h>
#include "transform.h"
class Shader
{
public:
Shader(const std::string& fileName);
void Bind();
void Update(const Transform& transform, const Camera& camera);
virtual ~Shader();
protected:
private:
static const unsigned int NUM_SHADERS = 2;
static const unsigned int NUM_UNIFORMS = 3;
void operator=(const Shader& shader) {}
Shader(const Shader& shader) {}
std::string LoadShader(const std::string& fileName);
void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, const std::string& errorMessage);
GLuint CreateShader(const std::string& text, unsigned int type);
GLuint m_program;
GLuint m_shaders[NUM_SHADERS];
GLuint m_uniforms[NUM_UNIFORMS];
};
#endif