+++ /dev/null
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include "batch.h"
-#include "immediate.h"
-
-namespace Msp {
-namespace GL {
-
-Immediate::Immediate(VertexFormat f):
- PrimitiveBuilder(array),
- array(f)
-{
- array.use_vertex_buffer(0);
-}
-
-void Immediate::reset()
-{
- if(in_batch)
- throw InvalidState("Can't reset Immediate between begin() and end()");
-
- array.clear();
-}
-
-void Immediate::begin_()
-{
- indices.clear();
-}
-
-void Immediate::end_()
-{
- Batch batch(type);
- batch.append(indices);
- array.apply();
- batch.draw();
-}
-
-void Immediate::element_(unsigned i)
-{
- indices.push_back(i);
-}
-
-} // namespace GL
-} // namespace Msp