From e5d7b40938e4ae38c41ae6ed054319f7f3fa600f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 12 Nov 2014 11:04:43 +0200 Subject: [PATCH] Use BindRestore for binding index buffer Plain Bind tries to unbind the buffer afterwards, which causes trouble if the mesh itself is bound. --- source/mesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.43.0