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 void Mesh::add_batch(const Batch &b)
42 void Mesh::draw() const
45 for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
50 Mesh::Loader::Loader(Mesh &m):
53 add("vertices", &Loader::vertices);
54 add("batch", &Loader::batch);
57 void Mesh::Loader::vertices(VertexFormat f)
59 mesh.vertices.reset(f);
60 load_sub(mesh.vertices);
63 void Mesh::Loader::batch(PrimitiveType p)
65 mesh.batches.push_back(Batch(p));
66 load_sub(mesh.batches.back());