X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fimmediate.cpp;h=cf1be08ed7204209d0d572b851ce76b7c58469ff;hb=refs%2Fheads%2Fmaster;hp=f341397492a7a2b92d5673685ccb790e9cbeb44c;hpb=85facfb688035b5bbc9a3a87d080582fbf34930b;p=libs%2Fgl.git diff --git a/source/immediate.cpp b/source/immediate.cpp deleted file mode 100644 index f3413974..00000000 --- a/source/immediate.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* $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