From 74c6854fd8dcbaee736ac0421805ff1e03c4a1e2 Mon Sep 17 00:00:00 2001 From: iamn1ck Date: Sun, 19 Feb 2017 07:00:34 -0600 Subject: -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 --- inc/geoshader.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 inc/geoshader.hpp (limited to 'inc/geoshader.hpp') 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 +#include +#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 -- cgit v1.2.3