3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
19 Mesh::Mesh(VertexFormat f):
23 void Mesh::use_vertex_buffer(bool b)
26 vertices.use_vertex_buffer();
28 vertices.use_vertex_buffer(0);
31 RefPtr<MeshBuilder> Mesh::modify()
33 return new MeshBuilder(*this);
36 void Mesh::add_batch(const Batch &b)
41 void Mesh::draw() const
44 for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
49 Mesh::Loader::Loader(Mesh &m):
52 add("vertices", &Loader::vertices);
53 add("batch", &Loader::batch);
56 void Mesh::Loader::vertices(VertexFormat f)
58 mesh.vertices.reset(f);
59 load_sub(mesh.vertices);
62 void Mesh::Loader::batch(PrimitiveType p)
64 mesh.batches.push_back(Batch(p));
65 load_sub(mesh.batches.back());