Added code to Viewer::addViewport(..) to force the sharing of a single
osg::State object between viewports.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user