Added osgUI::Widget::set/getGraphicsSubgraph() to hold the subgraph that does the rendering portion of widgets

This commit is contained in:
Robert Osfield
2014-05-22 10:02:35 +00:00
parent 0b5b3213fe
commit bda5ec4875
8 changed files with 77 additions and 78 deletions

View File

@@ -215,9 +215,13 @@ void Widget::traverseImplementation(osg::NodeVisitor& nv)
}
}
}
osg::Group::traverse(nv);
}
else
{
if (_graphicsSubgraph.valid()) _graphicsSubgraph->accept(nv);
osg::Group::traverse(nv);
}
}
@@ -285,3 +289,16 @@ osg::BoundingSphere Widget::computeBound() const
if (_extents.valid()) return osg::BoundingSphere(_extents);
else return osg::Group::computeBound();
}
void Widget::resizeGLObjectBuffers(unsigned int maxSize)
{
if (_graphicsSubgraph.valid()) _graphicsSubgraph->resizeGLObjectBuffers(maxSize);
Group::resizeGLObjectBuffers(maxSize);
}
void Widget::releaseGLObjects(osg::State* state) const
{
if (_graphicsSubgraph.valid()) _graphicsSubgraph->releaseGLObjects(state);
Group::releaseGLObjects(state);
}