Changeset 6067 for OpenSceneGraph/trunk/examples/osgcatch/osgcatch.cpp
- Timestamp:
- 01/28/07 18:12:57 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgcatch/osgcatch.cpp
r5962 r6067 37 37 #include <osgParticle/FireEffect> 38 38 39 #include <osgViewer/Viewer> 40 41 #include <iostream> 39 42 #include <sstream> 40 43 … … 1352 1355 } 1353 1356 1354 1355 1356 #include <osgViewer/Viewer> 1357 #include <iostream> 1357 class CompileStateCallback : public osg::GraphicsOperation 1358 { 1359 public: 1360 CompileStateCallback(GameEventHandler* eh): 1361 osg::GraphicsOperation("CompileStateCallback", false), 1362 _gameEventHandler(eh) {} 1363 1364 virtual void operator()(osg::GraphicsContext* gc) 1365 { 1366 // OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 1367 1368 if (_gameEventHandler) 1369 { 1370 _gameEventHandler->compileGLObjects(*gc->getState()); 1371 } 1372 } 1373 1374 OpenThreads::Mutex _mutex; 1375 GameEventHandler* _gameEventHandler; 1376 }; 1358 1377 1359 1378 int main( int argc, char **argv ) … … 1418 1437 viewer.setSceneData(rootNode.get()); 1419 1438 1420 // viewer.setRealizeCallback(new CompileStateCallback(seh));1439 viewer.setRealizeOperation(new CompileStateCallback(seh)); 1421 1440 1422 1441 double fovy, aspectRatio, zNear, zFar;
