]> git.localhorst.tv Git - blank.git/blobdiff - src/graphics/BlockMesh.hpp
glm backwards compatibility
[blank.git] / src / graphics / BlockMesh.hpp
index e62b601fcfa5449be2cbcd9aedf94db5b41a10b6..ff41df915dfd2a2e7542d14266df3313c99ab005 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef BLANK_GRAPHICS_BLOCKMESH_HPP_
 #define BLANK_GRAPHICS_BLOCKMESH_HPP_
 
+#include "glm.hpp"
 #include "VertexArray.hpp"
 
 #include <vector>
 #include <GL/glew.h>
-#include <glm/glm.hpp>
 
 
 namespace blank {
@@ -15,7 +15,7 @@ class BlockMesh {
 public:
        using Position = glm::vec3;
        using TexCoord = glm::vec3;
-       using ColorMod = glm::vec3;
+       using ColorMod = TVEC3<unsigned char, glm::precision(0)>;
        using Light = float;
        using Index = unsigned int;
 
@@ -69,7 +69,13 @@ public:
 public:
        void Update(const Buffer &) noexcept;
 
-       void Draw() const noexcept;
+       bool Empty() const noexcept {
+               return vao.Empty();
+       }
+
+       void Draw() const noexcept {
+               vao.DrawTriangleElements();
+       }
 
 private:
        VAO vao;