1 #ifndef BLANK_SHADER_HPP_
2 #define BLANK_SHADER_HPP_
15 explicit Shader(GLenum type);
19 Shader &operator =(Shader &&);
21 Shader(const Shader &) = delete;
22 Shader &operator =(const Shader &) = delete;
24 void Source(const GLchar *src);
26 bool Compiled() const;
27 void Log(std::ostream &) const;
29 void AttachToProgram(GLuint id) const;
43 Program(const Program &) = delete;
44 Program &operator =(const Program &) = delete;
46 const Shader &LoadShader(GLenum type, const GLchar *src);
47 void Attach(Shader &);
50 void Log(std::ostream &) const;
52 GLint UniformLocation(const GLchar *name) const;
54 void Use() const { glUseProgram(handle); }
58 std::list<Shader> shaders;
63 class DirectionalLighting {
66 DirectionalLighting();
70 void SetLightDirection(const glm::vec3 &);
72 void SetM(const glm::mat4 &m);
73 void SetProjection(const glm::mat4 &p);
74 void SetView(const glm::mat4 &v);
75 void SetVP(const glm::mat4 &v, const glm::mat4 &p);
76 void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p);
78 const glm::mat4 &Projection() const { return projection; }
79 const glm::mat4 &View() const { return view; }
80 const glm::mat4 &GetVP() const { return vp; }
85 glm::vec3 light_direction;
86 glm::vec3 light_color;
94 GLuint light_direction_handle;
95 GLuint light_color_handle;