X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexarray.h;h=281996d457da92894c6a4eb58111564c81c0ef43;hb=76e338af116120d93d082ad247591ec9adad9233;hp=02fa64f70b0f0cfdfe5c9fa0c893433fa59818f1;hpb=dc1d1159a61f378bda11e5989ad694a86b9a3c77;p=libs%2Fgl.git diff --git a/source/vertexarray.h b/source/vertexarray.h index 02fa64f7..281996d4 100644 --- a/source/vertexarray.h +++ b/source/vertexarray.h @@ -19,7 +19,7 @@ Distributed under the LGPL namespace Msp { namespace GL { -class VertexBuffer; +class Buffer; class VertexArray { @@ -34,30 +34,30 @@ private: VertexFormat format; std::vector data; uint stride; - VertexBuffer *vbuf; + Buffer *vbuf; bool own_vbuf; VertexArray(const VertexArray &); VertexArray &operator=(const VertexArray &); public: - VertexArray(VertexFormat); + VertexArray(const VertexFormat &); ~VertexArray(); - VertexFormat get_format() const { return format; } + const VertexFormat &get_format() const { return format; } const std::vector &get_data() const { return data; } void use_vertex_buffer(); - void use_vertex_buffer(VertexBuffer *); + void use_vertex_buffer(Buffer *); void reserve(unsigned); unsigned size() const { return data.size()/stride; } void clear(); - void reset(VertexFormat); + void reset(const VertexFormat &); void apply() const; void update_data(); float *append(); float *operator[](unsigned i) { return &data[0]+i*stride; } const float *operator[](unsigned i) const { return &data[0]+i*stride; } private: - void set_array(unsigned, unsigned, unsigned) const; + void set_array(unsigned, bool, unsigned) const; static unsigned enabled_arrays; };