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(const std::vector<VertexComponent> &);
31 void batch(PrimitiveType);
32 void winding(FaceWinding);
37 std::list<Batch> batches;
41 const WindingTest *winding;
45 Mesh(const VertexFormat &f);
49 void use_buffers(bool);
51 void create_buffers();
54 const VertexArray &get_vertices() const { return vertices; }
55 unsigned get_n_vertices() const;
56 float *modify_vertex(unsigned);
58 void add_batch(const Batch &b);
59 const std::list<Batch> &get_batches() { return batches; }
61 void set_winding(const WindingTest *);
64 void draw(Renderer &) const;