Hi Martin,

I get the number of screens with the following lines:

_wsi = _gc->getWindowingSystemInterface();
std::cout << "Detected Screens: " << _wsi->getNumScreens() << std::endl;

My question is: How can I define the screen which show me my viewer?

If you're creating your window yourself using osg::GraphicsContext::createGraphicsContext, Nick's suggestion is the right track - you'll need to specify the screen you want in the Traits you pass to createGraphicsContext.

If you're not, then the Viewer is probably creating the graphics context / window for you (using the osgViewer::View::setUpView*() methods). You can use osgViewer::View::setUpViewOnSingleScreen(screenNum) to get the equivalent behavior but be able to specify the screen you want. This will give you a fullscreen viewer - if you want it in a window use osgViewer::View::setUpViewInWindow(x,y,w,h,screenNum).

You can also check out the code for these methods if you're curious. They're there for convenience, if you want total flexibility you'll probably want to inspire yourself from the code there and create your graphics contexts yourself.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to