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 SetFogDensity(float);
74 void SetM(const glm::mat4 &m);
75 void SetProjection(const glm::mat4 &p);
76 void SetView(const glm::mat4 &v);
77 void SetVP(const glm::mat4 &v, const glm::mat4 &p);
78 void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p);
80 const glm::mat4 &Projection() const { return projection; }
81 const glm::mat4 &View() const { return view; }
82 const glm::mat4 &GetVP() const { return vp; }
87 glm::vec3 light_direction;
88 glm::vec3 light_color;
99 GLuint light_direction_handle;
100 GLuint light_color_handle;
101 GLuint fog_density_handle;
105 class BlockLighting {
112 void SetFogDensity(float);
114 void SetM(const glm::mat4 &m);
115 void SetProjection(const glm::mat4 &p);
116 void SetView(const glm::mat4 &v);
117 void SetVP(const glm::mat4 &v, const glm::mat4 &p);
118 void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p);
120 const glm::mat4 &Projection() const { return projection; }
121 const glm::mat4 &View() const { return view; }
122 const glm::mat4 &GetVP() const { return vp; }
129 glm::mat4 projection;
136 GLuint light_direction_handle;
137 GLuint light_color_handle;
138 GLuint fog_density_handle;