X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel.hpp;h=1e9dab9d1cde0132c30c1cdad9d656c3e5a47a7a;hb=482114e156e91729f2529ea6bb1fe98dacdee97f;hp=b2a6e21a64a424fbd02639ef78004ddd369b9f3b;hpb=49c81f76b80e0de99ca57db49510eb5e3385e1d1;p=blank.git diff --git a/src/model.hpp b/src/model.hpp index b2a6e21..1e9dab9 100644 --- a/src/model.hpp +++ b/src/model.hpp @@ -1,6 +1,8 @@ #ifndef BLANK_MODEL_HPP_ #define BLANK_MODEL_HPP_ +#include +#include #include @@ -8,31 +10,38 @@ namespace blank { class Model { +public: + std::vector vertices; + std::vector colors; + std::vector normals; + public: Model(); ~Model(); - glm::mat4 Transform() const; + Model(const Model &) = delete; + Model &operator =(const Model &) = delete; - void Velocity(glm::vec3 vel) { velocity = vel; } - void Position(glm::vec3 pos) { position = pos; } - void Move(glm::vec3 delta) { position += delta; } + void Invalidate() { dirty = true; } - // all angles in radians (full circle = 2π) - float Pitch() const { return pitch; } - void Pitch(float p) { pitch = p; } - void RotatePitch(float delta) { pitch += delta; } - float Yaw() const { return yaw; } - void Yaw(float y) { yaw = y; } - void RotateYaw(float delta) { yaw += delta; } + void Clear(); + void Reserve(int); - void Update(int dt); + void Draw(); + +private: + void Update(); private: - glm::vec3 velocity; - glm::vec3 position; - float pitch; - float yaw; + enum Attribute { + ATTRIB_VERTEX, + ATTRIB_COLOR, + ATTRIB_NORMAL, + ATTRIB_COUNT, + }; + + GLuint handle[ATTRIB_COUNT]; + bool dirty; };