X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fimmediate.cpp;h=a387d71b4b283eac45dcd47148dad9e6581fb321;hp=e12ac9b53ca01ec2b3d9b73a86898605d60c724d;hb=76e338af116120d93d082ad247591ec9adad9233;hpb=e17243fb2421977cb781361828b77718e2cf8d48 diff --git a/source/immediate.cpp b/source/immediate.cpp index e12ac9b5..a387d71b 100644 --- a/source/immediate.cpp +++ b/source/immediate.cpp @@ -15,12 +15,20 @@ Immediate::Immediate(VertexFormat f): array(f) { } +void Immediate::reset() +{ + if(in_batch) + throw InvalidState("Can't reset Immediate between begin() and end()"); + + array.clear(); + indices.clear(); +} + void Immediate::end_() { array.apply(); draw_elements(type, indices.size(), &indices[0]); - array.clear(); indices.clear(); }