X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2FModel.hpp;fp=src%2Fmodel%2FModel.hpp;h=0000000000000000000000000000000000000000;hb=5998b18978bd8e7a0c9deb516474634e1d3521c9;hp=95ad086402a6c58838012b0c9102350538cb9499;hpb=7c2a8b8285278b8a3077b311d82f05ea0463a96e;p=blank.git diff --git a/src/model/Model.hpp b/src/model/Model.hpp deleted file mode 100644 index 95ad086..0000000 --- a/src/model/Model.hpp +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef BLANK_MODEL_MODEL_HPP_ -#define BLANK_MODEL_MODEL_HPP_ - -#include -#include -#include - - -namespace blank { - -class Model { - -public: - using Position = glm::vec3; - using Color = glm::vec3; - using Normal = glm::vec3; - using Index = unsigned int; - - using Positions = std::vector; - using Colors = std::vector; - using Normals = std::vector; - using Indices = std::vector; - -public: - struct Buffer { - - Positions vertices; - Colors colors; - Normals normals; - Indices indices; - - void Clear() noexcept { - vertices.clear(); - colors.clear(); - normals.clear(); - indices.clear(); - } - - void Reserve(size_t p, size_t i) { - vertices.reserve(p); - colors.reserve(p); - normals.reserve(p); - indices.reserve(i); - } - - }; - -public: - Model() noexcept; - ~Model() noexcept; - - Model(const Model &) = delete; - Model &operator =(const Model &) = delete; - - Model(Model &&) noexcept; - Model &operator =(Model &&) noexcept; - - void Update(const Buffer &) noexcept; - - void Draw() const noexcept; - -private: - enum Attribute { - ATTRIB_VERTEX, - ATTRIB_COLOR, - ATTRIB_NORMAL, - ATTRIB_INDEX, - ATTRIB_COUNT, - }; - - GLuint va; - GLuint handle[ATTRIB_COUNT]; - size_t count; - -}; - -} - -#endif