From a704318f507f486ac04834747eb209d0a9410702 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 24 Oct 2010 16:02:09 +0000 Subject: keepalive optimizations, r_lights engine variable, OpenGL VBO support --- src/model/vertexarray.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/model/vertexarray.h') 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; }; } -- cgit v1.2.3