]> git.tdb.fi Git - libs/gl.git/blobdiff - source/meshbuilder.cpp
Add an element offset to PrimitiveBuilder
[libs/gl.git] / source / meshbuilder.cpp
index 025bced159fc999c748e244efdb1a87df12fd3f3..6f90f67de40cd9940dd381727b9a592b0876582b 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Copyright © 2008, 2010-2011  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -17,16 +17,21 @@ MeshBuilder::MeshBuilder(Mesh &m):
        batch(0)
 { }
 
+void MeshBuilder::auto_offset()
+{
+       offset(mesh.get_vertices().size());
+}
+
 void MeshBuilder::begin_()
 {
-       batch=new Batch(type);
+       batch = new Batch(type);
 }
 
 void MeshBuilder::end_()
 {
        mesh.add_batch(*batch);
        delete batch;
-       batch=0;
+       batch = 0;
 }
 
 void MeshBuilder::element_(unsigned i)