X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2FSpriteModel.hpp;fp=src%2Fmodel%2FSpriteModel.hpp;h=0000000000000000000000000000000000000000;hb=3542823a1af7f5063d7cc8da84efa248eb889b8a;hp=c5670fcb3bf5161f15d9dfaab13e8c0a68d70808;hpb=1c2994622a6b73f90cbd3ec9c09ffb4d7724cab4;p=blank.git diff --git a/src/model/SpriteModel.hpp b/src/model/SpriteModel.hpp deleted file mode 100644 index c5670fc..0000000 --- a/src/model/SpriteModel.hpp +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef BLANK_MODEL_SPRITEMODEL_HPP_ -#define BLANK_MODEL_SPRITEMODEL_HPP_ - -#include "../graphics/VertexArray.hpp" - -#include -#include -#include - - -namespace blank { - -class SpriteModel { - -public: - using Position = glm::vec3; - using TexCoord = glm::vec2; - using Index = unsigned short; - - using Positions = std::vector; - using TexCoords = std::vector; - using Indices = std::vector; - - enum Attribute { - ATTRIB_VERTEX, - ATTRIB_TEXCOORD, - ATTRIB_INDEX, - ATTRIB_COUNT, - }; - - struct Buffer { - - Positions vertices; - TexCoords coords; - Indices indices; - - void Clear() noexcept { - vertices.clear(); - coords.clear(); - indices.clear(); - } - - void Reserve(size_t p, size_t i) { - vertices.reserve(p); - coords.reserve(p); - indices.reserve(i); - } - - void LoadRect( - float w, float h, - const glm::vec2 &pivot = glm::vec2(0.0f), - const glm::vec2 &tex_begin = glm::vec2(0.0f), - const glm::vec2 &tex_end = glm::vec2(1.0f, 1.0f) - ); - - }; - - using VAO = VertexArray; - -public: - void Update(const Buffer &) noexcept; - - void Draw() noexcept; - -private: - VAO vao; - -}; - -} - -#endif