X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fimmediate.h;h=40e25cd667c8f6771f01890a49e89a96c134f672;hp=b979973c10a859fcd3aa2203d7cf9f98b0b69ad1;hb=56beca9d8b4f7b4edac81411d31e24df88e84ac3;hpb=85facfb688035b5bbc9a3a87d080582fbf34930b diff --git a/source/immediate.h b/source/immediate.h index b979973c..40e25cd6 100644 --- a/source/immediate.h +++ b/source/immediate.h @@ -1,16 +1,7 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_IMMEDIATE_H_ #define MSP_GL_IMMEDIATE_H_ -#include "primitivetype.h" -#include "vertexarray.h" -#include "vertexbuilder.h" +#include "primitivebuilder.h" namespace Msp { namespace GL { @@ -22,20 +13,19 @@ end() to terminate the batch. However, unlike OpenGL immediate mode, vertices are not drawn as they are specified. Instead, they are accumulated in a VertexArray and drawn when end() is called. */ -class Immediate: public VertexBuilder +class Immediate: public PrimitiveBuilder { -public: - Immediate(VertexFormat); - void begin(PrimitiveType); - void end(); private: VertexArray array; - RefPtr builder; - PrimitiveType type; - bool in_batch; - unsigned n_vertices; + std::vector indices; - virtual void vertex_(float, float, float, float); +public: + Immediate(VertexFormat); + void reset(); +private: + virtual void begin_(); + virtual void end_(); + virtual void element_(unsigned); }; } // namespace GL