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>
27 mutable unsigned dirty;
28 const VertexArray *vertex_array;
29 VertexFormat vertex_format;
30 const VertexArray *inst_array;
31 VertexFormat inst_format;
32 const Buffer *index_buffer;
38 void set_format(const VertexFormat &);
39 void set_format_instanced(const VertexFormat &, const VertexFormat &);
41 void set_vertex_array(const VertexArray &);
42 void set_instance_array(const VertexArray &);
43 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 bool verify_format(const VertexFormat &);
50 void update(unsigned) const;
51 void update_vertex_array(const VertexArray &, unsigned, unsigned, bool) const;
59 void set_debug_name(const std::string &);