From 84bae01643b25feabed71e6666da16518b301eba Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 22 Jan 2019 20:21:56 +0000 Subject: [PATCH] Added separate test and rest of _currentVAO to State::resetCurrentVertexArrayStateOnMatch(..) method --- include/osg/State | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/osg/State b/include/osg/State index 864078c2e..afff8341f 100644 --- a/include/osg/State +++ b/include/osg/State @@ -549,8 +549,12 @@ class OSG_EXPORT State : public Referenced /** Set the getCurrentVertexArrayState to the GlobalVertexArrayState.*/ void setCurrentToGlobalVertexArrayState() { _vas = _globalVertexArrayState.get(); } - /** Reset the CurrentVertexArrayObject if it's value equals the specificied vas - use when deleting a vas.*/ - void resetCurrentVertexArrayStateOnMatch(VertexArrayState* vas) { if (_vas==vas) { _vas = _globalVertexArrayState.get(); _currentVAO = 0; } } + /** Reset the CurrentVertexArrayState/VertexArrayObject if it's value matches the specificied vas - use when deleting a vas.*/ + void resetCurrentVertexArrayStateOnMatch(VertexArrayState* vas) + { + if (vas->getVertexArrayObject()== _currentVAO) _currentVAO = 0; + if (_vas==vas) _vas = _globalVertexArrayState.get(); + } /** disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.*/