X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FPrimitiveMesh.hpp;h=247cc6a0b3b52ca90ca835d5a69194c061cbcdd3;hb=f6e33d9f79ff6a47c3efa3c9fb1206cc1d27ecde;hp=013bf37bde34175c57b0d13c773fa11334eb3cda;hpb=2da9efc1037fba0461303327151318b8edf4dfc7;p=blank.git diff --git a/src/graphics/PrimitiveMesh.hpp b/src/graphics/PrimitiveMesh.hpp index 013bf37..247cc6a 100644 --- a/src/graphics/PrimitiveMesh.hpp +++ b/src/graphics/PrimitiveMesh.hpp @@ -1,11 +1,11 @@ #ifndef BLANK_GRAPHICS_PRIMITIVEMESH_HPP_ #define BLANK_GRAPHICS_PRIMITIVEMESH_HPP_ +#include "glm.hpp" #include "VertexArray.hpp" #include #include -#include namespace blank { @@ -16,7 +16,7 @@ class PrimitiveMesh { public: using Position = glm::vec3; - using Color = glm::vec4; + using Color = TVEC4; using Index = unsigned short; using Positions = std::vector; @@ -50,13 +50,13 @@ public: void FillRect( float w, float h, - const glm::vec4 &color = glm::vec4(0.0f), + const Color &color = Color(0), const glm::vec2 &pivot = glm::vec2(0.0f) ); void OutlineBox( const AABB &, - const glm::vec4 &color = glm::vec4(0.0f) + const Color &color = Color(0) ); }; @@ -66,8 +66,14 @@ public: public: void Update(const Buffer &) noexcept; - void DrawLines() noexcept; - void DrawTriangles() noexcept; + bool Empty() const noexcept { + return vao.Empty(); + } + + void DrawLines() const noexcept; + void DrawTriangles() const noexcept { + vao.DrawTriangleElements(); + } private: VAO vao;