X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexarray.h;h=0223a1f4434df584cc16dd59a0a659f23d2f1409;hb=98cc25ffe956bc162c053c96df659ba40dfe2d6e;hp=82a6b6ac5260cb3bd074404480187022f2b03b37;hpb=2e9f905d2a2b0abdb7902aa3d3416a97666c489a;p=libs%2Fgl.git diff --git a/source/vertexarray.h b/source/vertexarray.h index 82a6b6ac..0223a1f4 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,9 +39,6 @@ private: std::vector data; unsigned stride; std::vector arrays; - RefPtr vbuf; - bool defer_vbuf; - mutable bool dirty; VertexArray(const VertexArray &); VertexArray &operator=(const VertexArray &); @@ -54,15 +52,16 @@ private: static unsigned get_array_slot(unsigned char); public: - void use_vertex_buffer(); - 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 const void *get_data_pointer() const { return &data[0]; } public: unsigned size() const { return data.size()/stride; }