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
22 friend class MeshBuilder;
25 class Loader: public DataFile::ObjectLoader<Mesh>
30 void vertices(VertexFormat);
31 void batch(PrimitiveType);
32 void winding(FaceWinding);
37 std::list<Batch> batches;
40 const WindingTest *winding;
44 Mesh(const VertexFormat &f);
48 void use_buffers(bool);
50 const VertexArray &get_vertices() const { return vertices; }
51 unsigned get_n_vertices() const;
52 float *modify_vertex(unsigned);
54 void add_batch(const Batch &b);
55 const std::list<Batch> &get_batches() { return batches; }
57 void set_winding(const WindingTest *);
60 void draw(Renderer &) const;