]> git.localhorst.tv Git - blank.git/blobdiff - src/graphics/BlockMesh.hpp
avoid zero vertex draw calls
[blank.git] / src / graphics / BlockMesh.hpp
index e62b601fcfa5449be2cbcd9aedf94db5b41a10b6..534299233a2cc5d6eae9f5aa47b117246acc3d4c 100644 (file)
@@ -15,7 +15,7 @@ class BlockMesh {
 public:
        using Position = glm::vec3;
        using TexCoord = glm::vec3;
-       using ColorMod = glm::vec3;
+       using ColorMod = glm::tvec3<unsigned char>;
        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;