]> git.localhorst.tv Git - blank.git/blob - src/graphics/DirectionalLighting.hpp
reorganize basic rendering functionality
[blank.git] / src / graphics / DirectionalLighting.hpp
1 #ifndef BLANK_GRAPHICS_DIRECTIONALLIGHTING_HPP_
2 #define BLANK_GRAPHICS_DIRECTIONALLIGHTING_HPP_
3
4 #include "Program.hpp"
5
6 #include <GL/glew.h>
7 #include <glm/glm.hpp>
8
9
10 namespace blank {
11
12 class DirectionalLighting {
13
14 public:
15         DirectionalLighting();
16
17         void Activate() noexcept;
18
19         void SetLightDirection(const glm::vec3 &) noexcept;
20
21         void SetFogDensity(float) noexcept;
22
23         void SetM(const glm::mat4 &m) noexcept;
24         void SetProjection(const glm::mat4 &p) noexcept;
25         void SetView(const glm::mat4 &v) noexcept;
26         void SetVP(const glm::mat4 &v, const glm::mat4 &p) noexcept;
27         void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p) noexcept;
28
29         const glm::mat4 &Projection() const noexcept { return projection; }
30         const glm::mat4 &View() const noexcept { return view; }
31         const glm::mat4 &GetVP() const noexcept { return vp; }
32
33 private:
34         Program program;
35
36         glm::vec3 light_direction;
37         glm::vec3 light_color;
38
39         float fog_density;
40
41         glm::mat4 projection;
42         glm::mat4 view;
43         glm::mat4 vp;
44
45         GLuint m_handle;
46         GLuint mv_handle;
47         GLuint mvp_handle;
48         GLuint light_direction_handle;
49         GLuint light_color_handle;
50         GLuint fog_density_handle;
51
52 };
53
54 }
55
56 #endif