- Timestamp:
- 01/11/07 12:47:01 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgspheresegment/osgspheresegment.cpp
r5381 r5959 1 #include <osg Producer/Viewer>1 #include <osgViewer/Viewer> 2 2 3 3 #include <osg/Group> … … 10 10 11 11 #include <osgUtil/SmoothingVisitor> 12 #include <osgUtil/IntersectVisitor> 12 13 13 14 #include <osgDB/ReadFile> … … 24 25 25 26 #include <osg/io_utils> 27 28 #include <iostream> 26 29 27 30 // for the grid data.. … … 620 623 621 624 // construct the viewer. 622 osgProducer::Viewer viewer(arguments); 623 624 // set up the value with sensible default event handlers. 625 viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 626 627 // get details on keyboard and mouse bindings used by the viewer. 628 viewer.getUsage(*arguments.getApplicationUsage()); 625 osgViewer::Viewer viewer; 629 626 630 627 // if user request help write it out to cout. … … 656 653 viewer.setSceneData(root); 657 654 658 // create the windows and run the threads. 659 viewer.realize(); 660 661 while( !viewer.done() ) 662 { 663 // wait for all cull and draw threads to complete. 664 viewer.sync(); 665 666 // update the scene by traversing it with the the update visitor which will 667 // call all node update callbacks and animations. 668 viewer.update(); 669 670 // fire off the cull and draw traversals of the scene. 671 viewer.frame(); 672 673 } 674 675 // wait for all cull and draw threads to complete. 676 viewer.sync(); 677 678 // run a clean up frame to delete all OpenGL objects. 679 viewer.cleanup_frame(); 680 681 // wait for all the clean up frame to complete. 682 viewer.sync(); 683 684 return 0; 655 return viewer.run(); 685 656 }
