]> git.localhorst.tv Git - blank.git/blob - src/model/SkyBoxModel.hpp
transmit player input from client to server
[blank.git] / src / model / SkyBoxModel.hpp
1 #ifndef BLANK_MODEL_SKYBOXMODEL_HPP_
2 #define BLANK_MODEL_SKYBOXMODEL_HPP_
3
4 #include "../graphics/VertexArray.hpp"
5
6 #include <vector>
7 #include <glm/glm.hpp>
8
9
10 namespace blank {
11
12 class SkyBoxModel {
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