3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #include "primitivebuilder.h"
13 PrimitiveBuilder::PrimitiveBuilder(VertexArray &a):
18 void PrimitiveBuilder::begin(PrimitiveType t)
21 throw InvalidState("begin() already called");
25 builder=array.modify();
30 void PrimitiveBuilder::end()
33 throw InvalidState("end() called without begin()");
41 PrimitiveType PrimitiveBuilder::get_type() const
44 throw InvalidState("Not between begin() and end()");
48 void PrimitiveBuilder::vertex_(float x, float y, float z, float w)
51 throw InvalidState("Vertex specification not between begin() and end()");
53 builder->texcoord(ts, tt, tr,tq);
54 builder->color(cr, cg, cb, ca);
55 builder->normal(nx, ny, nz);
56 builder->vertex(x, y, z, w);