]> git.tdb.fi Git - libs/gl.git/blobdiff - source/meshbuilder.cpp
Style update: add spaces around assignment operators
[libs/gl.git] / source / meshbuilder.cpp
index cd3be666780285da52c0adfff0e69cd1b0833319..b238ae63b9a76a608d968bb5b36e44af0cf62445 100644 (file)
@@ -14,21 +14,24 @@ namespace GL {
 MeshBuilder::MeshBuilder(Mesh &m):
        PrimitiveBuilder(m.vertices),
        mesh(m),
-       first(0)
+       batch(0)
 { }
 
 void MeshBuilder::begin_()
 {
-       first=array.size();
+       batch = new Batch(type);
 }
 
 void MeshBuilder::end_()
 {
-       Batch batch(type);
-       unsigned last=array.size();
-       for(unsigned i=first; i<last; ++i)
-               batch.append(i);
-       mesh.add_batch(batch);
+       mesh.add_batch(*batch);
+       delete batch;
+       batch = 0;
+}
+
+void MeshBuilder::element_(unsigned i)
+{
+       batch->append(i);
 }
 
 } // namespace GL