X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvertexsetup.h;h=9e7409ac64b71f3574a32c778964089e21bdf3bf;hp=466eed40659d3d61fa8c9a27b00520ac43849c73;hb=56beca9d8b4f7b4edac81411d31e24df88e84ac3;hpb=f3ee640033ec6367915b51a3beaf2330f39d75ac diff --git a/source/vertexsetup.h b/source/vertexsetup.h index 466eed40..9e7409ac 100644 --- a/source/vertexsetup.h +++ b/source/vertexsetup.h @@ -15,9 +15,17 @@ objects. Intended for internal use. class VertexSetup: public Bindable { private: + enum ComponentMask + { + VERTEX_ARRAY = 1, + INSTANCE_ARRAY = 2, + INDEX_BUFFER = 4 + }; + unsigned id; - mutable bool dirty; - const VertexArray *array; + mutable unsigned dirty; + const VertexArray *vertex_array; + const VertexArray *inst_array; const Buffer *index_buffer; public: @@ -25,11 +33,15 @@ public: ~VertexSetup(); void set_vertex_array(const VertexArray &); + void set_instance_array(const VertexArray *); void set_index_buffer(const Buffer &); + const VertexArray *get_vertex_array() const { return vertex_array; } + const VertexArray *get_instance_array() const { return inst_array; } const Buffer *get_index_buffer() const { return index_buffer; } private: - void update() const; + void update(unsigned) const; + void update_vertex_array(const VertexArray &, unsigned, unsigned, bool) const; public: void bind() const;