[osg-users] OsgOcean

Nickolai Medvedev raizel.dev at yandex.ru
Mon Nov 28 03:41:50 PST 2016


Hi, Rambabu.

In the osgOcean example use both osgViewer::Viewer and osgViewer::View.

You need use osgViewer::Viewer only.

oceanExample:

//------------------------------------------------------------------------
    // Set up the viewer
    //------------------------------------------------------------------------

    //osg::ref_ptr<osgViewer::Viewer> viewer;
    //osgViewer::View* view = 0;
	

    osgViewer::Viewer* viewer = new osgViewer::Viewer;
    //viewer = singleViewer;
    //view = singleViewer;

	viewer->setUpViewOnSingleScreen(0); //this function tell osg work with one screen
	//view->setUpViewOnSingleScreen(0);
    // Otherwise, a window with a single view.
    //view->setUpViewInWindow( 0, 0, 1600, 900, 0 );
	viewer->getCamera()->setViewport(new osg::Viewport(0, 0, 1920, 1080));

then you need:

    viewer->realize();

    return viewer->run();

I hope it helps. Good Luck!

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69514#69514








More information about the osg-users mailing list