X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FOutlineMesh.hpp;fp=src%2Fgraphics%2FOutlineMesh.hpp;h=77e0436b1c6c3265606ec96e6b319f14c9face29;hb=3542823a1af7f5063d7cc8da84efa248eb889b8a;hp=0000000000000000000000000000000000000000;hpb=1c2994622a6b73f90cbd3ec9c09ffb4d7724cab4;p=blank.git diff --git a/src/graphics/OutlineMesh.hpp b/src/graphics/OutlineMesh.hpp new file mode 100644 index 0000000..77e0436 --- /dev/null +++ b/src/graphics/OutlineMesh.hpp @@ -0,0 +1,65 @@ +#ifndef BLANK_GRAPHICS_OUTLINEMESH_HPP_ +#define BLANK_GRAPHICS_OUTLINEMESH_HPP_ + +#include "VertexArray.hpp" + +#include +#include +#include + + +namespace blank { + +class OutlineMesh { + +public: + using Position = glm::vec3; + using Color = glm::vec3; + using Index = unsigned short; + + using Positions = std::vector; + using Colors = std::vector; + using Indices = std::vector; + + enum Attribute { + ATTRIB_VERTEX, + ATTRIB_COLOR, + ATTRIB_INDEX, + ATTRIB_COUNT, + }; + + struct Buffer { + + Positions vertices; + Colors colors; + Indices indices; + + void Clear() noexcept { + vertices.clear(); + colors.clear(); + indices.clear(); + } + + void Reserve(size_t p, size_t i) { + vertices.reserve(p); + colors.reserve(p); + indices.reserve(i); + } + + }; + + using VAO = VertexArray; + +public: + void Update(const Buffer &) noexcept; + + void Draw() noexcept; + +private: + VAO vao; + +}; + +} + +#endif