Added -4 command line entry that creates two seperate windows within CompositeViewer
This commit is contained in:
parent
ceed09afea
commit
3be15a310e
@ -198,6 +198,46 @@ int main( int argc, char **argv )
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (arguments.read("-4"))
|
||||
{
|
||||
|
||||
// view one
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("View one");
|
||||
viewer.addView(view);
|
||||
|
||||
view->setUpViewInWindow(0, 0, 800, 600);
|
||||
view->setSceneData(scene.get());
|
||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||
|
||||
// add the state manipulator
|
||||
osg::ref_ptr<osgGA::StateSetManipulator> statesetManipulator = new osgGA::StateSetManipulator;
|
||||
statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet());
|
||||
|
||||
view->addEventHandler( statesetManipulator.get() );
|
||||
}
|
||||
|
||||
// view two
|
||||
{
|
||||
osgViewer::View* view = new osgViewer::View;
|
||||
view->setName("View two");
|
||||
viewer.addView(view);
|
||||
|
||||
view->setUpViewInWindow(1000, 0, 800, 600);
|
||||
view->setSceneData(scene.get());
|
||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||
|
||||
view->addEventHandler( new osgViewer::StatsHandler );
|
||||
|
||||
|
||||
// add the handler for doing the picking
|
||||
view->addEventHandler(new PickHandler());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (arguments.read("-3") || viewer.getNumViews()==0)
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user