Added separate test and rest of _currentVAO to State::resetCurrentVertexArrayStateOnMatch(..) method

This commit is contained in:
Robert Osfield 2019-01-22 20:21:56 +00:00
parent 8a5d1b9f44
commit 84bae01643

View File

@ -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.*/