Cleaned up Geometry::dirtyGLOjects() and Geometry::releaseGLObjects()

This commit is contained in:
Robert Osfield 2018-12-31 12:14:26 +00:00
parent 337f24051b
commit 25c60dc675

View File

@ -694,6 +694,28 @@ void Geometry::setUseVertexBufferObjects(bool flag)
void Geometry::dirtyGLObjects()
{
Drawable::dirtyGLObjects();
ArrayList arrays;
if (getArrayList(arrays))
{
for(ArrayList::iterator itr = arrays.begin();
itr != arrays.end();
++itr)
{
(*itr)->dirty();
}
}
DrawElementsList drawElements;
if (getDrawElementsList(drawElements))
{
for(DrawElementsList::iterator itr = drawElements.begin();
itr != drawElements.end();
++itr)
{
(*itr)->dirty();
}
}
}
void Geometry::resizeGLObjectBuffers(unsigned int maxSize)
@ -727,16 +749,6 @@ void Geometry::releaseGLObjects(State* state) const
{
Drawable::releaseGLObjects(state);
if (state)
{
if (_vertexArrayStateList[state->getContextID()].valid())
{
_vertexArrayStateList[state->getContextID()]->release();
_vertexArrayStateList[state->getContextID()] = 0;
}
}
else _vertexArrayStateList.clear();
ArrayList arrays;
if (getArrayList(arrays))
{