From: Mikko Rasa Date: Tue, 26 Feb 2008 10:29:52 +0000 (+0000) Subject: Add the meshbuilder.* files too X-Git-Tag: 0.9~11 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6b31fae3191e88fe391c3d3eebbf3e56789dd3e3;p=libs%2Fgl.git Add the meshbuilder.* files too --- diff --git a/source/meshbuilder.cpp b/source/meshbuilder.cpp new file mode 100644 index 00000000..cd3be666 --- /dev/null +++ b/source/meshbuilder.cpp @@ -0,0 +1,35 @@ +/* $Id$ + +This file is part of libmspgl +Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + +#include "mesh.h" +#include "meshbuilder.h" + +namespace Msp { +namespace GL { + +MeshBuilder::MeshBuilder(Mesh &m): + PrimitiveBuilder(m.vertices), + mesh(m), + first(0) +{ } + +void MeshBuilder::begin_() +{ + first=array.size(); +} + +void MeshBuilder::end_() +{ + Batch batch(type); + unsigned last=array.size(); + for(unsigned i=first; i