diff options
Diffstat (limited to 'src/model/vertexarray.h')
-rw-r--r-- | src/model/vertexarray.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/model/vertexarray.h b/src/model/vertexarray.h index 2e43f2a..9a71811 100644 --- a/src/model/vertexarray.h +++ b/src/model/vertexarray.h @@ -38,6 +38,11 @@ public: return vertex_overflow; } + /// return true if the vertex data has changed and needs to uploaded to video memory + inline bool dirty() const { + return vertex_dirty; + } + /// pointer to model vertices, sequential in GL_T2F_N3F_V3F format inline const float *ptr() const { return vertex_data; @@ -52,6 +57,10 @@ public: inline size_t index() const { return vertex_index; } + + inline void set_dirty(const bool dirty = true) { + vertex_dirty = dirty; + } static inline VertexArray *instance() { return vertex_instance; @@ -69,6 +78,8 @@ private: static VertexArray *vertex_instance; bool vertex_overflow; + + bool vertex_dirty; }; } |