[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.


    // 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
    // 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:


    return viewer->run();

I hope it helps. Good Luck!

Read this topic online here:

More information about the osg-users mailing list