X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexarray.h;h=e38f0afff910b20500b750983fcf957db934d741;hb=61ff840cd211f10d45dca8c4dad2cca5f68aaa42;hp=af1817b18461893591bc72c001db80c1dd72c0ce;hpb=99b3477d16295c9b90daa0a397bfc375dd3aac4d;p=libs%2Fgl.git diff --git a/source/vertexarray.h b/source/vertexarray.h index af1817b1..e38f0aff 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,8 +39,6 @@ private: std::vector data; unsigned stride; std::vector arrays; - Buffer *vbuf; - mutable bool dirty; VertexArray(const VertexArray &); VertexArray &operator=(const VertexArray &); @@ -53,14 +52,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; }