Hi Fred,
I had tried 0 and 1 before but that gave me the exact same behavior. So in your
application you have a different osgviewer window that displays in each screen
the moment your program starts running ?
I don't know if there is something wrong in the way I'm setting up my graphics
context and widnowing system interface, if you're able to achieve something
similar to what I'm trying.
If its any reference, my code for the graphics context part is copied below:
Code:
osg::GraphicsContext::WindowingSystemInterface* wsi =
osg::GraphicsContext::getWindowingSystemInterface();
if (!wsi)
{
osg::notify(osg::NOTICE)<<"Error, no WindowSystemInterface available,
cannot create windows."<<std::endl;
return 1;
}
unsigned int windowWidth1, windowHeight1;
unsigned int windowWidth2, windowHeight2;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0),
windowWidth1, windowHeight1);
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(1),
windowWidth2, windowHeight2);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
osg::GraphicsContext::Traits;
traits->x = 100;
traits->y = 100;
traits->width = 1000;
traits->height = 800;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
osg::ref_ptr<osg::GraphicsContext> gc =
osg::GraphicsContext::createGraphicsContext(traits.get());
osg::ref_ptr<osg::GraphicsContext> gc2 =
osg::GraphicsContext::createGraphicsContext(traits.get());
osg::ref_ptr<osg::GraphicsContext> gc3 =
osg::GraphicsContext::createGraphicsContext(traits.get());
if (gc.valid() && gc2.valid() && gc3.valid())
{
osg::notify(osg::INFO)<<" GraphicsWindow has been created
successfully."<<std::endl;
// need to ensure that the window is cleared make sure that the complete
window is
//set the correct colour rather than just the parts of the
window that are
//under the camera's viewports
gc->setClearColor(osg::Vec4f(0.2f,0.2f,0.6f,1.0f));
gc->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
gc2->setClearColor(osg::Vec4f(0.2f,0.2f,0.6f,1.0f));
gc2->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
gc3->setClearColor(osg::Vec4f(0.2f,0.2f,0.6f,1.0f));
gc3->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
Thanks.
Sanat.
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30600#30600
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org