diff --git a/src/osgUtil/GLObjectsVisitor.cpp b/src/osgUtil/GLObjectsVisitor.cpp index df0286e74..c0bcc661d 100644 --- a/src/osgUtil/GLObjectsVisitor.cpp +++ b/src/osgUtil/GLObjectsVisitor.cpp @@ -79,16 +79,6 @@ void GLObjectsVisitor::apply(osg::Drawable& drawable) drawable.setUseDisplayList(true); } - if (_mode&COMPILE_DISPLAY_LISTS && _renderInfo.getState()) - { - drawable.compileGLObjects(_renderInfo); - } - - if (_mode&RELEASE_DISPLAY_LISTS) - { - drawable.releaseGLObjects(_renderInfo.getState()); - } - if (_mode&SWITCH_ON_VERTEX_BUFFER_OBJECTS) { drawable.setUseVertexBufferObjects(true); @@ -98,6 +88,16 @@ void GLObjectsVisitor::apply(osg::Drawable& drawable) { drawable.setUseVertexBufferObjects(false); } + + if (_mode&COMPILE_DISPLAY_LISTS && _renderInfo.getState()) + { + drawable.compileGLObjects(_renderInfo); + } + + if (_mode&RELEASE_DISPLAY_LISTS) + { + drawable.releaseGLObjects(_renderInfo.getState()); + } } void GLObjectsVisitor::apply(osg::StateSet& stateset)