1 #ifndef MSP_GL_VERTEXSETUP_H_
2 #define MSP_GL_VERTEXSETUP_H_
5 #include "vertexformat.h"
14 Combines a VertexArray with an index buffer. This wraps OpenGL's vertex array
15 objects. Intended for internal use.
28 mutable unsigned dirty;
29 const VertexArray *vertex_array;
30 VertexFormat vertex_format;
31 const VertexArray *inst_array;
32 VertexFormat inst_format;
33 const Buffer *index_buffer;
39 void set_format(const VertexFormat &);
40 void set_format_instanced(const VertexFormat &, const VertexFormat &);
42 void set_vertex_array(const VertexArray &);
43 void set_instance_array(const VertexArray &);
44 void set_index_buffer(const Buffer &);
45 const VertexArray *get_vertex_array() const { return vertex_array; }
46 const VertexArray *get_instance_array() const { return inst_array; }
47 const Buffer *get_index_buffer() const { return index_buffer; }
50 static bool verify_format(const VertexFormat &);
52 void update_vertex_array(const VertexArray &, unsigned, unsigned, bool) const;
55 void refresh() const { if(dirty) update(); }
57 unsigned get_id() const { return id; }
61 void set_debug_name(const std::string &);