]> git.tdb.fi Git - libs/gl.git/commitdiff
Use BindRestore for binding index buffer
authorMikko Rasa <tdb@tdb.fi>
Wed, 12 Nov 2014 09:04:43 +0000 (11:04 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 12 Nov 2014 09:04:43 +0000 (11:04 +0200)
Plain Bind tries to unbind the buffer afterwards, which causes trouble if
the mesh itself is bound.

source/mesh.cpp

index 301c00f94b331fc6c87087bc9f79a8b558c675a0..44568697f4f6dfd46aca884b9a6ebb8cffc05db3 100644 (file)
@@ -153,7 +153,7 @@ void Mesh::draw() const
 
        if(!current())
                vertices.apply();
-       Bind bind_ibuf(ibuf, ELEMENT_ARRAY_BUFFER);
+       BindRestore bind_ibuf(ibuf, ELEMENT_ARRAY_BUFFER);
        Bind bind_winding(winding);
 
        for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)