From: Mikko Rasa Date: Wed, 12 Nov 2014 09:04:43 +0000 (+0200) Subject: Use BindRestore for binding index buffer X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e5d7b40938e4ae38c41ae6ed054319f7f3fa600f;p=libs%2Fgl.git Use BindRestore for binding index buffer Plain Bind tries to unbind the buffer afterwards, which causes trouble if the mesh itself is bound. --- diff --git a/source/mesh.cpp b/source/mesh.cpp index 301c00f9..44568697 100644 --- a/source/mesh.cpp +++ b/source/mesh.cpp @@ -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::const_iterator i=batches.begin(); i!=batches.end(); ++i)