X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel.hpp;h=6e9583b3ec84f6ae05c7f1beaeeaa05b7e36e75b;hb=9c1f7b20394808f7ec7a6cadd9e0dd665c6f6bd5;hp=4fd4515563022215e0ca8e2f847813b4610b501f;hpb=2d8c7c015478a4528c0909f11d43998b1393948d;p=blank.git diff --git a/src/model.hpp b/src/model.hpp index 4fd4515..6e9583b 100644 --- a/src/model.hpp +++ b/src/model.hpp @@ -10,10 +10,14 @@ namespace blank { class Model { +public: + using Index = unsigned int; + public: std::vector vertices; std::vector colors; std::vector normals; + std::vector indices; public: Model(); @@ -22,10 +26,13 @@ public: Model(const Model &) = delete; Model &operator =(const Model &) = delete; + Model(Model &&); + Model &operator =(Model &&); + void Invalidate() { dirty = true; } void Clear(); - void Reserve(int); + void Reserve(int vtx_count, int idx_count); void Draw(); @@ -37,6 +44,7 @@ private: ATTRIB_VERTEX, ATTRIB_COLOR, ATTRIB_NORMAL, + ATTRIB_INDEX, ATTRIB_COUNT, }; @@ -48,9 +56,13 @@ private: class OutlineModel { +public: + using Index = unsigned short; + public: std::vector vertices; std::vector colors; + std::vector indices; public: OutlineModel(); @@ -62,7 +74,7 @@ public: void Invalidate() { dirty = true; } void Clear(); - void Reserve(int); + void Reserve(int vtx_count, int idx_count); void Draw(); @@ -73,6 +85,7 @@ private: enum Attribute { ATTRIB_VERTEX, ATTRIB_COLOR, + ATTRIB_INDEX, ATTRIB_COUNT, };