Changeset 4732 for OpenSceneGraph/trunk/examples/osgcamera/osgcamera.cpp
- Timestamp:
- 11/10/05 16:25:06 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgcamera/osgcamera.cpp
r4631 r4732 91 91 }; 92 92 93 struct CleanUpOperation : public osg::GraphicsThread::Operation 94 { 95 CleanUpOperation(osgUtil::SceneView* sceneView): 96 osg::GraphicsThread::Operation("CleanUp",false), 97 _sceneView(sceneView) 98 { 99 } 100 101 virtual void operator () (osg::GraphicsContext*) 102 { 103 _sceneView->releaseAllGLObjects(); 104 _sceneView->flushAllDeletedGLObjects(); 105 } 106 107 osg::ref_ptr<osgUtil::SceneView> _sceneView; 108 }; 93 109 94 110 // main does the following steps to create a multi-thread, multiple camera/graphics context view of a scene graph. … … 347 363 348 364 } 365 349 366 350 367 std::cout<<"Exiting application"<<std::endl; 368 369 // start clean up. 370 for(gitr = graphicsContextSet.begin(); 371 gitr != graphicsContextSet.end(); 372 ++gitr) 373 { 374 osg::GraphicsContext* context = *gitr; 375 osg::GraphicsThread* thread = context->getGraphicsThread(); 376 if (thread) 377 { 378 thread->removeAllOperations(); 379 thread->setDone(true); 380 } 381 } 382 383 std::cout<<"Removed all operations"<<std::endl; 351 384 352 385 return 0;
