X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmeshbuilder.cpp;h=57e85fc640ab1a66dc6d5a26187045507d479e1f;hp=cd3be666780285da52c0adfff0e69cd1b0833319;hb=42c1534d95e1551c37e64a1dae288e8b75e8d8ba;hpb=6b31fae3191e88fe391c3d3eebbf3e56789dd3e3 diff --git a/source/meshbuilder.cpp b/source/meshbuilder.cpp index cd3be666..57e85fc6 100644 --- a/source/meshbuilder.cpp +++ b/source/meshbuilder.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include "mesh.h" #include "meshbuilder.h" @@ -14,21 +7,29 @@ namespace GL { MeshBuilder::MeshBuilder(Mesh &m): PrimitiveBuilder(m.vertices), mesh(m), - first(0) + batch(0) { } +void MeshBuilder::auto_offset() +{ + offset(mesh.get_vertices().size()); +} + void MeshBuilder::begin_() { - first=array.size(); + batch = new Batch(type); } void MeshBuilder::end_() { - Batch batch(type); - unsigned last=array.size(); - for(unsigned i=first; iappend(i); } } // namespace GL