I'm using osgProducer::Viewer in a Win32 app and I'd like to re-use the viewer object if possible. I've got things setup so I can hit a key to construct a viewer with the proper scene graph and hit another key to kill the viewer. Problem is, when I go to build another viewer after I've already built the first one I get this error message in my output window:
 
"Producer::WGLExtensions: could not make the temporary window's context active"
 
My viewer construction/service code resides on a separate thread. The thread loop looks like this
 
void threadEntry()
{
 
 viewer->setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
 viewer->setSceneData(loadRootNode());
 viewer->realize();
 
 while(run){
 viewer.sync();
 viewer.update();
 viewer.frame();
 }
 

viewer->sync();
viewer->cleanup_frame();
viewer->sync();

}

 

When this thread exits and viewer is deleted I get an exception:
First-chance exception at 0x7c812a5b in osgvislib_driver_console.exe: Microsoft C++ exception: Win32ThreadCanceled at memory location 0x0352f967

This exception is generated by OpenThreads.

 

I thinking that I'm either not cleaning up things properly or I'm trying to do something that shouldn't be tried.

Suggestions?

 
P.S.
I'm running XP Pro using Visual Studio 2005.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to