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 aee747885a
commit 587c893f84

View File

@ -572,8 +572,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.*/