1 #ifndef MSP_GL_VERTEXSETUP_H_
2 #define MSP_GL_VERTEXSETUP_H_
5 #include "vertexformat.h"
13 Combines a VertexArray with an index buffer. This wraps OpenGL's vertex array
14 objects. Intended for internal use.
16 class VertexSetup: public Bindable<VertexSetup>
29 mutable unsigned dirty;
30 const VertexArray *vertex_array;
31 VertexFormat vertex_format;
32 const VertexArray *inst_array;
33 VertexFormat inst_format;
34 const Buffer *index_buffer;
40 void set_vertex_array(const VertexArray &);
41 void set_instance_array(const VertexArray *);
42 void set_index_buffer(const Buffer &);
44 const VertexArray *get_vertex_array() const { return vertex_array; }
45 const VertexArray *get_instance_array() const { return inst_array; }
46 const Buffer *get_index_buffer() const { return index_buffer; }
49 static unsigned get_attribs(const VertexFormat &);
50 static unsigned get_update_mask(unsigned, const VertexFormat &, const VertexArray &);
51 void update(unsigned) const;
52 void update_vertex_array(const VertexArray &, unsigned, unsigned, bool) const;