+++ /dev/null
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include "immediate.h"
-
-namespace Msp {
-namespace GL {
-
-Immediate::Immediate(VertexFormat f):
- array(f),
- in_batch(false),
- n_vertices(0)
-{ }
-
-void Immediate::begin(PrimitiveType t)
-{
- type=t;
- in_batch=true;
- n_vertices=0;
- builder=array.modify();
-}
-
-void Immediate::end()
-{
- builder=0;
-
- array.apply();
- glDrawArrays(type, 0, n_vertices);
-
- array.clear();
- in_batch=false;
-}
-
-void Immediate::vertex_(float x, float y, float z, float w)
-{
- if(!in_batch)
- throw InvalidState("Vertex specification not between begin and end");
-
- builder->texcoord(ts, tt, tr,tq);
- builder->color(cr, cg, cb, ca);
- builder->normal(nx, ny, nz);
- builder->vertex(x, y, z, w);
-
- ++n_vertices;
-}
-
-} // namespace GL
-} // namespace Msp