diff options
Diffstat (limited to 'shader.h')
-rw-r--r-- | shader.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/shader.h b/shader.h new file mode 100644 index 0000000..bd3ac38 --- /dev/null +++ b/shader.h @@ -0,0 +1,36 @@ +#ifndef SHADER_INCLUDED_H
+#define SHADER_INCLUDED_H
+
+#include "transform.h"
+#include <GL/glew.h>
+#include <string>
+
+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
|