]> git.localhorst.tv Git - blank.git/blobdiff - src/graphics/EntityMesh.hpp
glm backwards compatibility
[blank.git] / src / graphics / EntityMesh.hpp
index 804bb6ede5f1a59488fdff2226b9492267c4c36a..cdb7ed2515cb743d478e29fc52f3d499d05395bb 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef BLANK_GRAPHICS_ENTITYMESH_HPP_
 #define BLANK_GRAPHICS_ENTITYMESH_HPP_
 
+#include "glm.hpp"
 #include "VertexArray.hpp"
 
 #include <vector>
 #include <GL/glew.h>
-#include <glm/glm.hpp>
 
 
 namespace blank {
@@ -15,7 +15,7 @@ class EntityMesh {
 public:
        using Position = glm::vec3;
        using TexCoord = glm::vec3;
-       using ColorMod = glm::tvec3<unsigned char>;
+       using ColorMod = TVEC3<unsigned char, glm::precision(0)>;
        using Normal = glm::vec3;
        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;