X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fvertexarray.h;fp=source%2Fvertexarray.h;h=fb8f51b026d82e40c2ef4dd70da31f2f3c66027f;hb=cfd7b5bc0c69d0b8cc7c8b3ec81a1a9462d04abb;hp=af1817b18461893591bc72c001db80c1dd72c0ce;hpb=d889a4dabc2a8d3b4ed9e8d45f86edf40ba2e69a;p=libs%2Fgl.git diff --git a/source/vertexarray.h b/source/vertexarray.h index af1817b1..fb8f51b0 100644 --- a/source/vertexarray.h +++ b/source/vertexarray.h @@ -6,6 +6,7 @@ #include #include #include "bindable.h" +#include "bufferable.h" #include "datatype.h" #include "primitivetype.h" #include "vertexarraybuilder.h" @@ -16,7 +17,7 @@ namespace GL { class Buffer; -class VertexArray: public Bindable +class VertexArray: public Bindable, public Bufferable { public: class Loader: public DataFile::Loader, public VertexArrayBuilder @@ -38,7 +39,6 @@ private: std::vector data; unsigned stride; std::vector arrays; - Buffer *vbuf; mutable bool dirty; VertexArray(const VertexArray &); @@ -53,14 +53,16 @@ private: static unsigned get_array_slot(unsigned char); public: - void use_vertex_buffer(Buffer *); + /// Deprecated alias for use_buffer + void use_vertex_buffer(Buffer *b) { use_buffer(b); } void clear(); void reserve(unsigned); float *append(); float *modify(unsigned); private: - void set_dirty(); + virtual unsigned get_data_size() const; + virtual void upload_data() const; public: unsigned size() const { return data.size()/stride; }