]> git.localhorst.tv Git - blank.git/blob - src/graphics/BlockLighting.hpp
9b3e8afcb72a56d19759965c711b451088e94e45
[blank.git] / src / graphics / BlockLighting.hpp
1 #ifndef BLANK_GRAPHICS_BLOCKLIGHTING_HPP_
2 #define BLANK_GRAPHICS_BLOCKLIGHTING_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 ArrayTexture;
13
14 class BlockLighting {
15
16 public:
17         BlockLighting();
18
19         void Activate() noexcept;
20
21         void SetTexture(ArrayTexture &) noexcept;
22         void SetFogDensity(float) noexcept;
23
24         void SetM(const glm::mat4 &m) noexcept;
25         void SetProjection(const glm::mat4 &p) noexcept;
26         void SetView(const glm::mat4 &v) noexcept;
27         void SetVP(const glm::mat4 &v, const glm::mat4 &p) noexcept;
28         void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p) noexcept;
29
30         const glm::mat4 &Projection() const noexcept { return projection; }
31         const glm::mat4 &View() const noexcept { return view; }
32         const glm::mat4 &GetVP() const noexcept { return vp; }
33
34 private:
35         Program program;
36
37         glm::mat4 projection;
38         glm::mat4 view;
39         glm::mat4 vp;
40
41         GLuint mv_handle;
42         GLuint mvp_handle;
43         GLuint sampler_handle;
44         GLuint light_direction_handle;
45         GLuint light_color_handle;
46         GLuint fog_density_handle;
47
48 };
49
50 }
51
52 #endif