]> git.localhorst.tv Git - blobs.git/blob - src/graphics/PlanetSurface.hpp
concerning orbits
[blobs.git] / src / graphics / PlanetSurface.hpp
1 #ifndef BLOBS_GRAPHICS_PLANETSURFACE_HPP_
2 #define BLOBS_GRAPHICS_PLANETSURFACE_HPP_
3
4 #include "Program.hpp"
5
6 #include "glm.hpp"
7
8
9 namespace blobs {
10 namespace graphics {
11
12 class ArrayTexture;
13
14 class PlanetSurface {
15
16 public:
17         PlanetSurface();
18         ~PlanetSurface();
19
20         PlanetSurface(const PlanetSurface &) = delete;
21         PlanetSurface &operator =(const PlanetSurface &) = delete;
22
23         PlanetSurface(PlanetSurface &&) = delete;
24         PlanetSurface &operator =(PlanetSurface &&) = delete;
25
26 public:
27         void Activate() noexcept;
28
29         void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p) noexcept;
30         void SetNormal(const glm::vec3 &) noexcept;
31         void SetTexture(ArrayTexture &) noexcept;
32         void SetLight(const glm::vec3 &pos, const glm::vec3 &color, float strength) noexcept;
33
34         const glm::mat4 &M() const noexcept { return m; }
35         const glm::mat4 &V() const noexcept { return v; }
36         const glm::mat4 &P() const noexcept { return p; }
37         const glm::mat4 &MV() const noexcept { return mv; }
38         const glm::mat4 &MVP() const noexcept { return mvp; }
39
40 private:
41         Program prog;
42
43         glm::mat4 m;
44         glm::mat4 v;
45         glm::mat4 p;
46         glm::mat4 mv;
47         glm::mat4 mvp;
48
49         GLuint m_handle;
50         GLuint mv_handle;
51         GLuint mvp_handle;
52         GLuint sampler_handle;
53         GLuint normal_handle;
54
55         GLuint light_position_handle;
56         GLuint light_color_handle;
57         GLuint light_strength_handle;
58
59 };
60
61 }
62 }
63
64 #endif