summaryrefslogtreecommitdiff
path: root/inc/geoshader.hpp
diff options
context:
space:
mode:
authoriamn1ck <iamn1ck@yahoo.com>2017-02-19 07:00:34 -0600
committerTom Barrett <tombarrett@siu.edu>2017-03-07 13:22:46 -0600
commit74c6854fd8dcbaee736ac0421805ff1e03c4a1e2 (patch)
tree4a3ae40bea9b07a2111128e98d9272bdbac2af87 /inc/geoshader.hpp
parent03885192b9ff7d3c5e2dcfd98aefd21e9b62f603 (diff)
-quadtree and opengl rendering are now in the master branch !
-using sdl_rect for location and size ended up being not so great due to it not having floats, so we reverted back to using location -much, much refractoring is now needed
Diffstat (limited to 'inc/geoshader.hpp')
-rw-r--r--inc/geoshader.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/inc/geoshader.hpp b/inc/geoshader.hpp
new file mode 100644
index 0000000..f8be43b
--- /dev/null
+++ b/inc/geoshader.hpp
@@ -0,0 +1,31 @@
+#ifndef geoshader_h
+#define geoshader_h
+
+#include <string>
+#include <GL/glew.h>
+#include "graphicsobjects.hpp"
+
+//#define GLSL(src) "#version 150 core\n" #src
+
+class GeoShader
+{
+ public:
+ GeoShader(const std::string& fileName);
+
+ void Bind();
+ void Update(const Transform& transform, const Camera& camera);
+ virtual ~GeoShader();
+ GLuint m_program;
+
+ private:
+ static const unsigned int NUM_SHADERS = 3;
+ static const unsigned int NUM_UNIFORMS = 3;
+ 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