Hi robert,
My composite viewer is set as :
m_rpCompoViewer = new osgViewer::CompositeViewer;
m_rpCompoViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
I've found a osg message "[osg-users] Adding Views to a Running
CompositeViewer" wich talks about the same problem as I have.
I've juste added the code below after calling :
m_rpCompoViewer->addView(rpView.get());
osgViewer::CompositeViewer::Windows windows;
m_rpCompoViewer->getWindows(windows);
// clear out all the previously assigned operations
for(osgViewer::CompositeViewer::Windows::iterator citr =
windows.begin();citr != windows.end();++citr)
{
if(!((*citr)->isRealizedImplementation()))
{
(*citr)->realizeImplementation();
}
}
and everything works fine.
2008/6/23 Robert Osfield <[EMAIL PROTECTED]>:
>
> HI Alex,
>
> I can't work out exactly what you mean w.r.t your setup. What
> threading model is the viewer set up as?
>
> W.r.t SingleThreaded not setting the _threadsRunning flag... well, if
> it's single threaded then no extra threads will be running, so the
> code is perfectly correct.
>
> Also if you report a crash, please make sure you provide a stack trace
> as this is essential for others to be able to help look for the cause
> of the problem.
>
> Robert.
>
> On Mon, Jun 23, 2008 at 10:30 AM, amalric alexandre
> <[EMAIL PROTECTED]> wrote:
> > Hi osg-users,
> >
> > I maybe found a bug on CompositeViewer::addView(osgViewer::View* view)
in
> > OSG 2.5.2.
> >
> > I have an application wich add and remove views on a compositeViewer
> > embedded in MFC windows. When I try to add a new view it crashes.
> >
> > With debug information I've noticed that in addView function
_threadsRunning
> > variable was always false, so that stopThreading is never called.
> >
> > I've searched why _threadsRunning was false and I've found that in
> > ViewerBase::startThreading(), _threadsRunning is never set to true
because
> > we return before at line 269 in case we're SingleThreaded, otherwise if
> > we're CullDrawThreadPerContext for example we just break but we don't
> > return. Is it normal ?
> >
> > Kind Regards,
> > _______________________________________________
> > 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
new osgViewer::CompositeViewer;
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org