]> git.localhorst.tv Git - blank.git/blobdiff - src/shader.hpp
extract shader program from application
[blank.git] / src / shader.hpp
index c112c533e42109bca7e75ce2839c06f6e82eefa8..c97e073111b9cf45a4dacf7f63dd620012d98d5c 100644 (file)
@@ -2,7 +2,9 @@
 #define BLANK_SHADER_HPP_
 
 #include <iosfwd>
+#include <list>
 #include <GL/glew.h>
+#include <glm/glm.hpp>
 
 
 namespace blank {
@@ -41,6 +43,7 @@ public:
        Program(const Program &) = delete;
        Program &operator =(const Program &) = delete;
 
+       const Shader &LoadShader(GLenum type, const GLchar *src);
        void Attach(Shader &);
        void Link();
        bool Linked() const;
@@ -52,6 +55,34 @@ public:
 
 private:
        GLuint handle;
+       std::list<Shader> shaders;
+
+};
+
+
+class DirectionalLighting {
+
+public:
+       DirectionalLighting();
+
+       void Activate();
+
+       void SetM(const glm::mat4 &m);
+       void SetVP(const glm::mat4 &v, const glm::mat4 &p);
+       void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p);
+
+private:
+       Program program;
+
+       glm::vec3 light_direction;
+       glm::vec3 light_color;
+
+       glm::mat4 vp;
+
+       GLuint m_handle;
+       GLuint mvp_handle;
+       GLuint light_direction_handle;
+       GLuint light_color_handle;
 
 };