]> git.localhorst.tv Git - blank.git/blob - src/graphics/SkyBoxMesh.hpp
runtime-selectable camera mode
[blank.git] / src / graphics / SkyBoxMesh.hpp
1 #ifndef BLANK_GRAPHICS_SKYBOXMESH_HPP_
2 #define BLANK_GRAPHICS_SKYBOXMESH_HPP_
3
4 #include "VertexArray.hpp"
5
6 #include <vector>
7 #include <glm/glm.hpp>
8
9
10 namespace blank {
11
12 class SkyBoxMesh {
13
14 public:
15         using Position = glm::vec3;
16         using Index = unsigned int;
17
18         using Positions = std::vector<Position>;
19         using Indices = std::vector<Index>;
20
21         enum Attribute {
22                 ATTRIB_VERTEX,
23                 ATTRIB_INDEX,
24                 ATTRIB_COUNT,
25         };
26
27         struct Buffer {
28
29                 Positions vertices;
30                 Indices indices;
31
32                 void Clear() noexcept {
33                         vertices.clear();
34                         indices.clear();
35                 }
36
37                 void Reserve(size_t p, size_t i) {
38                         vertices.reserve(p);
39                         indices.reserve(i);
40                 }
41
42         };
43
44         using VAO = VertexArray<ATTRIB_COUNT>;
45
46 public:
47         void LoadUnitBox();
48         void Update(const Buffer &) noexcept;
49
50         void Draw() const noexcept;
51
52 private:
53         VAO vao;
54
55 };
56
57 }
58
59 #endif