summaryrefslogtreecommitdiff
path: root/inc/opengl/geoshader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'inc/opengl/geoshader.hpp')
-rw-r--r--inc/opengl/geoshader.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/inc/opengl/geoshader.hpp b/inc/opengl/geoshader.hpp
new file mode 100644
index 0000000..2619a92
--- /dev/null
+++ b/inc/opengl/geoshader.hpp
@@ -0,0 +1,30 @@
+#ifndef geoshader_h
+#define geoshader_h
+
+#include <string>
+#include <GL/glew.h>
+
+#include "constants.hpp"
+#include "graphicsdata.hpp"
+#include "transform.hpp"
+
+class GeoShader
+{
+ public:
+ GeoShader(const std::string& fileName);
+
+ void Bind();
+ void Update(const Transform& transform, const Camera& camera);
+ virtual ~GeoShader();
+ GLuint m_program;
+
+ private:
+ 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, GLenum shaderType);
+
+ GLuint m_shaders[NUM_SHADERS];
+ GLuint m_uniforms[NUM_UNIFORMS];
+};
+
+#endif