X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fimmediate.cpp;fp=source%2Fimmediate.cpp;h=15d3a634a13248063efd29c2f5889fff7110c120;hp=3d808d320897d9c1610ebf2da3650d56e7859d94;hb=c48cb5362edb16c33ed5f6862a908bb9a754c85a;hpb=df1f68d366e145716225f1a4dd223b0129280fb2 diff --git a/source/immediate.cpp b/source/immediate.cpp index 3d808d32..15d3a634 100644 --- a/source/immediate.cpp +++ b/source/immediate.cpp @@ -5,6 +5,7 @@ Copyright © 2007 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ +#include "batch.h" #include "immediate.h" namespace Msp { @@ -23,15 +24,19 @@ void Immediate::reset() 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(); - draw_elements(type, indices.size(), &indices[0]); - - indices.clear(); + batch.draw(); } void Immediate::element_(unsigned i)