From Alan Purvis, with enum name tweaks from Robert Osfield. Addition of
support for turing on/off the usage of vertex buffer objects.
This commit is contained in:
@@ -20,9 +20,9 @@ using namespace osgUtil;
|
||||
GLObjectsVisitor::GLObjectsVisitor(Mode mode)
|
||||
{
|
||||
setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
|
||||
|
||||
|
||||
_mode = mode;
|
||||
|
||||
|
||||
_state = NULL;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,16 @@ void GLObjectsVisitor::apply(osg::Drawable& drawable)
|
||||
{
|
||||
drawable.releaseGLObjects(_state.get());
|
||||
}
|
||||
|
||||
if (_mode&SWITCH_ON_VERTEX_BUFFER_OBJECTS)
|
||||
{
|
||||
drawable.setUseVertexBufferObjects(true);
|
||||
}
|
||||
|
||||
if (_mode&SWITCH_OFF_VERTEX_BUFFER_OBJECTS)
|
||||
{
|
||||
drawable.setUseVertexBufferObjects(false);
|
||||
}
|
||||
}
|
||||
|
||||
void GLObjectsVisitor::apply(osg::StateSet& stateset)
|
||||
|
||||
Reference in New Issue
Block a user