diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index fe6f65bb6..6bb3d6f5e 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -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)) {