Thanks Robert. I it is working now.
When doing the stop/start with my code the window related to the new viewer
showed, but I had to manually call the realize method of the the new window
(rendering context of the new View).
When my code was like this:
parentCViewer->stopThreading();
parentCViewer->addView(monitorView);
parentCViewer->startThreading();
I got this warning and then a seg fault:
"Warning: GraphicsWindow not realized, cannot do makeCurrent"
Then I changed the code to:
parentCViewer->stopThreading();
parentCViewer->addView(monitorView);
osgViewer::CompositeViewer::Windows windows;
parentCViewer->getWindows(viewerwindows);
clear out all the previously assigned operations
for(osgViewer::CompositeViewer::Windows::iterator citr =
windows.begin();citr != windows.end();++citr)
{
if(!((*citr)->isRealizedImplementation()))
{
(*citr)->realizeImplementation();
}
}
parentCViewer->startThreading();
And every thing worked fine. I don't know if the need for this
addition is just because I am doing something wrong else where or is just
because
I am supposed to realize the new window manually.
Thanks for your time,
Nicolas.
2008/4/7, Robert Osfield <[EMAIL PROTECTED]>:
>
> Hi Nicolas,
>
> You can use start/stopThreading() i,e,
>
> viewer.stopThreading();
> do stuff ;
> viewer.startThreading();
>
> Robert.
>
> On Mon, Apr 7, 2008 at 2:55 PM, nicolas peña <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> >
> > I am having problems when adding Views to an already running
> > CompositeViewer.
> > The behaviour looks to depend on the nature of the single Camera of the
> > View I am
> > adding to the CompositeViewer:
> > - If the camera of the new View use the rendering context that is
> > already in use by the
> > Camera of the View that was added to the Composite Viewer before the
> > Viewer was
> > realized the new View works well.
> > - If the Camera of the new View uses a different rendering context it is
> > never
> > initiated.
> > ¿It is possible to add Views in general to an already running
> > CompositeViewer?
> > ¿What I am missing here?
> >
> >
> > Thanks in advance.
> >
> > Regards,
> >
> > Nicolas.
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org