]> git.localhorst.tv Git - blobs.git/blob - src/graphics/SkyBox.hpp
basic sky box
[blobs.git] / src / graphics / SkyBox.hpp
1 #ifndef BLOBS_GRAPHICS_SKYBOX_HPP_
2 #define BLOBS_GRAPHICS_SKYBOX_HPP_
3
4 #include "Program.hpp"
5 #include "SimpleVAO.hpp"
6
7 #include  <cstdint>
8
9
10 namespace blobs {
11 namespace graphics {
12
13 class CubeMap;
14
15 class SkyBox {
16
17 public:
18         SkyBox();
19         ~SkyBox();
20
21         SkyBox(const SkyBox &) = delete;
22         SkyBox &operator =(const SkyBox &) = delete;
23
24         SkyBox(SkyBox &&) = delete;
25         SkyBox &operator =(SkyBox &&) = delete;
26
27 public:
28         void Activate() noexcept;
29
30         void SetV(const glm::mat4 &v) noexcept;
31         void SetP(const glm::mat4 &p) noexcept;
32         void SetVP(const glm::mat4 &v, const glm::mat4 &p) noexcept;
33         void SetTexture(CubeMap &) noexcept;
34
35         const glm::mat4 &V() const noexcept { return v; }
36         const glm::mat4 &P() const noexcept { return p; }
37         const glm::mat4 &VP() const noexcept { return vp; }
38
39         void Draw() const noexcept;
40
41 private:
42         Program prog;
43
44         glm::mat4 v;
45         glm::mat4 p;
46         glm::mat4 vp;
47
48         GLuint vp_handle;
49         GLuint sampler_handle;
50
51         SimpleVAO<glm::vec3, std::uint8_t> vao;
52
53 };
54
55 }
56 }
57
58 #endif