Hu Emmanuel,
On 6/5/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
Concerning the issue I had with my scene data not taken into account I found
the explanation: it came from the fact that I was adding a "slave camera"...
apprently the master scene data is not shared by default is it ?...
It should be shared by default, see the default parameter values for
addSlave in include/osg/View.
If it isn't be shared then they must be some sequencing issue related
to what the scene data is set. Without having an example in front of
me that I can test its really hard to know what might be up.
any way,
if I use this simplyfied code, everything works good:
{
osg::ref_ptr<osg::GraphicsContext::Traits> traits =
new osg::GraphicsContext::Traits;
traits->x = 50;
traits->y = 50;
traits->width = 640;
traits->height = 480;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->supportsResize = true;
osg::ref_ptr<osg::GraphicsContext> gc =
osg::GraphicsContext::createGraphicsContext(traits.get());
osg::ref_ptr<osg::Camera> camera = viewer.getCamera(); // using the
existing camera directly ! :-)
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0,0, traits->width,
traits->height));
}
Now I will try moving this code to thread 1... as you said it should work
:-)
In general if you just need one Camera, use the View's existing master
Camera rather than resetting it.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/