X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexsetup.h;fp=source%2Fvertexsetup.h;h=466eed40659d3d61fa8c9a27b00520ac43849c73;hb=f3ee640033ec6367915b51a3beaf2330f39d75ac;hp=0000000000000000000000000000000000000000;hpb=1c03d9e430782b329c684fbf9c9e10230eec1966;p=libs%2Fgl.git diff --git a/source/vertexsetup.h b/source/vertexsetup.h new file mode 100644 index 00000000..466eed40 --- /dev/null +++ b/source/vertexsetup.h @@ -0,0 +1,42 @@ +#ifndef MSP_GL_VERTEXSETUP_H_ +#define MSP_GL_VERTEXSETUP_H_ + +#include "bindable.h" + +namespace Msp { +namespace GL { + +class VertexArray; + +/** +Combines a VertexArray with an index buffer. This wraps OpenGL's vertex array +objects. Intended for internal use. +*/ +class VertexSetup: public Bindable +{ +private: + unsigned id; + mutable bool dirty; + const VertexArray *array; + const Buffer *index_buffer; + +public: + VertexSetup(); + ~VertexSetup(); + + void set_vertex_array(const VertexArray &); + void set_index_buffer(const Buffer &); + const Buffer *get_index_buffer() const { return index_buffer; } + +private: + void update() const; + +public: + void bind() const; + static void unbind(); +}; + +} // namespace GL +} // namespace Msp + +#endif