From 6b31fae3191e88fe391c3d3eebbf3e56789dd3e3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 26 Feb 2008 10:29:52 +0000 Subject: [PATCH] Add the meshbuilder.* files too --- source/meshbuilder.cpp | 35 +++++++++++++++++++++++++++++++++++ source/meshbuilder.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 source/meshbuilder.cpp create mode 100644 source/meshbuilder.h 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