#ifndef BLANK_GRAPHICS_PRIMITIVEMESH_HPP_
#define BLANK_GRAPHICS_PRIMITIVEMESH_HPP_
+#include "glm.hpp"
#include "VertexArray.hpp"
#include <vector>
#include <GL/glew.h>
-#include <glm/glm.hpp>
namespace blank {
+struct AABB;
+
class PrimitiveMesh {
public:
using Position = glm::vec3;
- using Color = glm::vec4;
+ using Color = TVEC4<unsigned char, glm::precision(0)>;
using Index = unsigned short;
using Positions = std::vector<Position>;
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 Color &color = Color(0)
+ );
+
};
using VAO = VertexArray<ATTRIB_COUNT>;
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;