]> git.tdb.fi Git - libs/gl.git/blobdiff - source/immediate.cpp
Fix an index mismatch between setting attribute array pointers and enabling the arrays
[libs/gl.git] / source / immediate.cpp
index 8e761f4329c4c5cec8921d62753849fb5ff98e2d..e12ac9b53ca01ec2b3d9b73a86898605d60c724d 100644 (file)
@@ -18,9 +18,15 @@ Immediate::Immediate(VertexFormat f):
 void Immediate::end_()
 {
        array.apply();
-       glDrawArrays(type, 0, array.size());
+       draw_elements(type, indices.size(), &indices[0]);
 
        array.clear();
+       indices.clear();
+}
+
+void Immediate::element_(unsigned i)
+{
+       indices.push_back(i);
 }
 
 } // namespace GL