Hello to all
when launching my application I have this error:
Warning: GraphicsWindowWin32::grabFocus() - Failed grabbing the focus
What could be the problem?
Thanks in advance
Miriam
Here carryover part of my code:
....
osgViewer::Viewer v;
...
osg::GraphicsContext::WindowingSystemInterface* wsi =
osg::GraphicsContext::getWindowingSystemInterface();
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0),
width, height);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
osg::GraphicsContext::Traits;
...
osg::ref_ptr<osg::GraphicsContext> gc =
osg::GraphicsContext::createGraphicsContext(traits.get());
if (gc.valid())
{
gc->setClearColor(osg::Vec4f(0.2f,0.2f,0.6f,1.0f));
gc->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
v.setSceneData(root);
v.getCamera()->setViewport(new osg::Viewport(0,0, traits->width,
traits->height));
v.getCamera()->setGraphicsContext(gc.get());
v.setCameraManipulator(keyswitchManipulator.get());
// add the state manipulator
osg::ref_ptr<osgGA::StateSetManipulator> statesetManipulator =
new osgGA::StateSetManipulator;
statesetManipulator->setStateSet(v.getCamera()->getOrCreateStateSet());
v.addEventHandler( statesetManipulator.get() );
v.realize();
v.run();
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org