Mesh can draw itself, it's usually used as part of Renderables rather than on
its own.
*/
-class Mesh
+class Mesh: public Bindable<Mesh>
{
friend class MeshBuilder;
std::list<Batch> batches;
Buffer *vbuf;
Buffer *ibuf;
+ unsigned vao_id;
bool defer_buffers;
+ mutable bool dirty;
const WindingTest *winding;
public:
void use_buffers(bool);
private:
void create_buffers();
+ void setup_vao() const;
public:
const VertexArray &get_vertices() const { return vertices; }
+ const Buffer *get_index_buffer() const { return ibuf; }
unsigned get_n_vertices() const;
float *modify_vertex(unsigned);
void draw() const;
void draw(Renderer &) const;
+
+ void bind() const;
+
+ static void unbind();
};
} // namespace GL