Hi,
 
when I create two instances of "osgViewer::Viewer" in one program, then
the first viewer freezes (no trackball manipulation possible) when
setting threading model of both viewers to "SingleThreaded". Is that
expected behaviour and why, or is it a bug?
When I'm setting one or both viewer(s) to e.g. "ThreadPerContext", then
both viewers are working properly.
 
I'm using OSG-Rev. 8402 and OpenSUSE-10.2-64.

Thanks in advance!
Rudi

 
The following code reproduces the problem:
 
#include <osg/ref_ptr>
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
#include <osgGA/TrackballManipulator>

int main( int argc, char * argv[] )
{
  // read model
  osg::ref_ptr< osg::Node > model = osgDB::readNodeFile( "cow.osg" );

  // create viewer #1
  osg::ref_ptr< osgViewer::Viewer > viewer1 = new osgViewer::Viewer;
  viewer1->setSceneData( model.get() );
  viewer1->setUpViewInWindow( 10, 10, 400, 300 );
  viewer1->setCameraManipulator( new osgGA::TrackballManipulator() );
  viewer1->setThreadingModel( osgViewer::Viewer::SingleThreaded );
//  viewer1->setThreadingModel( osgViewer::Viewer::ThreadPerContext );

  // create viewer #2
  osg::ref_ptr< osgViewer::Viewer > viewer2 = new osgViewer::Viewer;
  viewer2->setSceneData( model.get() );
  viewer2->setUpViewInWindow( 500, 10, 200, 300 );
  viewer2->setCameraManipulator( new osgGA::TrackballManipulator() );
  viewer2->setThreadingModel( osgViewer::Viewer::SingleThreaded );
//  viewer2->setThreadingModel( osgViewer::Viewer::ThreadPerContext );

  // render
  while( ( viewer1->done() == false ) && ( viewer2->done() == false ) )
  {
    viewer1->frame();
    viewer2->frame();
  }

  return 0;
}

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to