Added code to Viewer::addViewport(..) to force the sharing of a single

osg::State object between viewports.
This commit is contained in:
Robert Osfield
2002-10-07 10:02:47 +00:00
parent 65934ef824
commit 5f1a5f0c41

View File

@@ -1468,9 +1468,18 @@ unsigned int Viewer::addViewport(osgUtil::SceneView* sv,
def.viewport[2] = width;
def.viewport[3] = height;
if (!_viewportList.empty())
{
// force all the viewports to share the same state object as
// they all share the same graphics context.
osg::State* state = _viewportList.front().sceneView->getState();
def.sceneView->setState(state);
}
unsigned int pos = _viewportList.size();
_viewportList.push_back(def);
return pos;
}