4 #include <msp/datafile/objectloader.h>
6 #include "vertexarray.h"
7 #include "windingtest.h"
16 Raw mesh data, consisting of a VertexArray and one or more Batches. Though a
17 Mesh can draw itself, it's usually used as part of Renderables rather than on
20 class Mesh: public Bindable<Mesh>
22 friend class MeshBuilder;
25 class Loader: public DataFile::ObjectLoader<Mesh>
30 void vertices(const std::vector<VertexComponent> &);
31 void batch(PrimitiveType);
32 void winding(FaceWinding);
37 std::list<Batch> batches;
43 const WindingTest *winding;
47 Mesh(const VertexFormat &f);
51 void use_buffers(bool);
53 void create_buffers();
54 void setup_vao() const;
57 const VertexArray &get_vertices() const { return vertices; }
58 const Buffer *get_index_buffer() const { return ibuf; }
59 unsigned get_n_vertices() const;
60 float *modify_vertex(unsigned);
62 void add_batch(const Batch &b);
63 const std::list<Batch> &get_batches() { return batches; }
65 void set_winding(const WindingTest *);
68 void draw(Renderer &) const;