Hi all,
I'm having an with creating and destroying multiple viewers that load a
paged database. I've put together a very simple example of this that
creates a viewer to display a model, waits for it to complete, then creates
another viewer.
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc,argv);
osgViewer::Viewer* viewer = new osgViewer::Viewer();
viewer->setUpViewInWindow(100,100,500,500);
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
viewer->setSceneData( loadedModel.get() );
viewer->run();
delete viewer; //Comment out this line and things run fine.
viewer = new osgViewer::Viewer();
viewer->setUpViewInWindow(100,100,500,500);
loadedModel = osgDB::readNodeFiles(arguments);
viewer->setSceneData( loadedModel.get() );
viewer->run();
delete viewer;
}
If I load a simple model like cow.osg, things are ok except for the fact
that the cow is white on the second run. If I run using a paged database
such as http://www.openscenegraph.org/data/earth_bayarea/earth.ive, the app
crashes.
This happens in the SVN trunk of OSG as well as the 2.8.2 release. Is there
something special that I need to do with the viewers when dealing with paged
databases to clean things up correctly?
Thanks,
Jason
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org