From 4b07117a2e05f93e8d39134e78a857fcd2b26bd6 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Wed, 16 Oct 2019 15:35:26 +0800 Subject: [PATCH] Mesh: fix material leaking when using VBO --- src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index 325cabc3d3..07030bacfc 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -164,8 +164,9 @@ void MeshRenderer::Private::renderGLArray(SoGLRenderAction *action, GLenum mode) vertices.setCurrentContext(action->getCacheContext()); indices.setCurrentContext(action->getCacheContext()); - glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); vertices.bind(); indices.bind(); @@ -181,8 +182,9 @@ void MeshRenderer::Private::renderGLArray(SoGLRenderAction *action, GLenum mode) vertices.release(); indices.release(); - glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); } void MeshRenderer::Private::renderFacesGLArray(SoGLRenderAction *action)