Show
Ignore:
Timestamp:
01/05/07 15:48:50 (7 years ago)
Author:
robert
Message:

Converted osganimate example to osgViewer

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osganimate/osganimate.cpp

    r5381 r5903  
    1616#include <osgSim/OverlayNode> 
    1717 
    18 #include <osgProducer/Viewer> 
    19  
     18#include <osgViewer/Viewer> 
     19#include <iostream> 
    2020 
    2121osg::AnimationPath* createAnimationPath(const osg::Vec3& center,float radius,double looptime) 
     
    216216 
    217217    // initialize the viewer. 
    218     osgProducer::Viewer viewer(arguments); 
    219  
    220     // set up the value with sensible default event handlers. 
    221     viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 
    222  
    223     // get details on keyboard and mouse bindings used by the viewer. 
    224     viewer.getUsage(*arguments.getApplicationUsage()); 
     218    osgViewer::Viewer viewer; 
    225219 
    226220    // if user request help write it out to cout. 
     
    263257    viewer.setSceneData(rootnode); 
    264258 
    265     // create the windows and run the threads. 
    266     viewer.realize(); 
    267  
    268     while( !viewer.done() ) 
    269     { 
    270         // wait for all cull and draw threads to complete. 
    271         viewer.sync(); 
    272  
    273         // update the scene by traversing it with the the update visitor which will 
    274         // call all node update callbacks and animations. 
    275         viewer.update(); 
    276           
    277         // fire off the cull and draw traversals of the scene. 
    278         viewer.frame(); 
    279          
    280     } 
    281      
    282     // wait for all cull and draw threads to complete. 
    283     viewer.sync(); 
    284  
    285     // run a clean up frame to delete all OpenGL objects. 
    286     viewer.cleanup_frame(); 
    287  
    288     // wait for all the clean up frame to complete. 
    289     viewer.sync(); 
    290  
    291     return 0; 
    292 } 
     259    return viewer.run(); 
     260}