X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmesh.cpp;h=5f9c60d03919e2fe262d4bf848325eaee30dd6e5;hp=8d039977e0ff2532992adce536a9a73a20f2256f;hb=HEAD;hpb=cea3c333797cadd9629aefaa5b82243173a02d16 diff --git a/source/mesh.cpp b/source/mesh.cpp deleted file mode 100644 index 8d039977..00000000 --- a/source/mesh.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include "mesh.h" - -using namespace std; - -namespace Msp { -namespace GL { - -Mesh::Mesh(): - vertices(NODATA) -{ - vertices.use_vertex_buffer(); -} - -Mesh::Mesh(VertexFormat f): - vertices(f) -{ - vertices.use_vertex_buffer(); -} - -void Mesh::add_batch(const Batch &b) -{ - batches.push_back(b); -} - -void Mesh::draw() const -{ - vertices.apply(); - for(list::const_iterator i=batches.begin(); i!=batches.end(); ++i) - i->draw(); -} - - -Mesh::Loader::Loader(Mesh &m): - mesh(m) -{ - add("vertices", &Loader::vertices); - add("batch", &Loader::batch); -} - -void Mesh::Loader::vertices(VertexFormat f) -{ - mesh.vertices.reset(f); - load_sub(mesh.vertices); -} - -void Mesh::Loader::batch(PrimitiveType p) -{ - mesh.batches.push_back(Batch(p)); - load_sub(mesh.batches.back()); -} - -} // namespace GL -} // namespace Msp