]> git.tdb.fi Git - libs/gl.git/blobdiff - source/immediate.cpp
Generalize VertexBuffer into Buffer with support for other types as well
[libs/gl.git] / source / immediate.cpp
index e12ac9b53ca01ec2b3d9b73a86898605d60c724d..a387d71b4b283eac45dcd47148dad9e6581fb321 100644 (file)
@@ -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();
 }