]> git.localhorst.tv Git - blank.git/blobdiff - src/graphics/SkyBoxMesh.hpp
model -> mesh
[blank.git] / src / graphics / SkyBoxMesh.hpp
diff --git a/src/graphics/SkyBoxMesh.hpp b/src/graphics/SkyBoxMesh.hpp
new file mode 100644 (file)
index 0000000..ab1da8d
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef BLANK_GRAPHICS_SKYBOXMESH_HPP_
+#define BLANK_GRAPHICS_SKYBOXMESH_HPP_
+
+#include "VertexArray.hpp"
+
+#include <vector>
+#include <glm/glm.hpp>
+
+
+namespace blank {
+
+class SkyBoxMesh {
+
+public:
+       using Position = glm::vec3;
+       using Index = unsigned int;
+
+       using Positions = std::vector<Position>;
+       using Indices = std::vector<Index>;
+
+       enum Attribute {
+               ATTRIB_VERTEX,
+               ATTRIB_INDEX,
+               ATTRIB_COUNT,
+       };
+
+       struct Buffer {
+
+               Positions vertices;
+               Indices indices;
+
+               void Clear() noexcept {
+                       vertices.clear();
+                       indices.clear();
+               }
+
+               void Reserve(size_t p, size_t i) {
+                       vertices.reserve(p);
+                       indices.reserve(i);
+               }
+
+       };
+
+       using VAO = VertexArray<ATTRIB_COUNT>;
+
+public:
+       void LoadUnitBox();
+       void Update(const Buffer &) noexcept;
+
+       void Draw() const noexcept;
+
+private:
+       VAO vao;
+
+};
+
+}
+
+#endif