Browse Source

Delete VAO in Mesh only if it is nonzero.

glDeleteVertexArrays() was called even after the Mesh was moved out to
another object. On my NVidia it was working but it might cause issues
elsewhere.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
da4ceb7cbc
  1. 2
      src/Mesh.cpp

2
src/Mesh.cpp

@ -230,7 +230,7 @@ void Mesh::destroyImplementationDefault() {}
void Mesh::destroyImplementationVAO() {
/** @todo Get some extension wrangler instead to avoid linker errors to glDeleteVertexArrays() on ES2 */
#ifndef MAGNUM_TARGET_GLES2
glDeleteVertexArrays(1, &vao);
if(vao) glDeleteVertexArrays(1, &vao);
#endif
}

Loading…
Cancel
Save