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

Moved osgautotransform across to osgViewer

Files:
1 modified

Legend:

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

    r5381 r5905  
    1414#include <osgUtil/Optimizer> 
    1515#include <osgDB/ReadFile> 
    16 #include <osgProducer/Viewer> 
     16#include <osgViewer/Viewer> 
    1717 
    1818#include <osg/Material> 
     
    2525 
    2626#include <osgText/Text> 
     27 
     28#include <iostream> 
    2729 
    2830osg::Node* createLabel(const osg::Vec3& pos, float size, const std::string& label, osgText::Text::AxisAlignment axisAlignment) 
     
    169171 
    170172    // construct the viewer. 
    171     osgProducer::Viewer viewer(arguments); 
    172  
    173     // set up the value with sensible default event handlers. 
    174     viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 
    175  
    176     // get details on keyboard and mouse bindings used by the viewer. 
    177     viewer.getUsage(*arguments.getApplicationUsage()); 
     173    osgViewer::Viewer viewer; 
    178174 
    179175    // if user request help write it out to cout. 
     
    197193    // set the scene to render 
    198194    viewer.setSceneData(createScene()); 
    199  
    200     // create the windows and run the threads. 
    201     viewer.realize(); 
    202  
    203     while( !viewer.done() ) 
    204     { 
    205         // wait for all cull and draw threads to complete. 
    206         viewer.sync(); 
    207  
    208         // update the scene by traversing it with the the update visitor which will 
    209         // call all node update callbacks and animations. 
    210         viewer.update(); 
    211           
    212         // fire off the cull and draw traversals of the scene. 
    213         viewer.frame(); 
    214          
    215     } 
    216      
    217     // wait for all cull and draw threads to complete. 
    218     viewer.sync(); 
    219  
    220     // run a clean up frame to delete all OpenGL objects. 
    221     viewer.cleanup_frame(); 
    222  
    223     // wait for all the clean up frame to complete. 
    224     viewer.sync(); 
    225      
    226     return 0; 
     195     
     196    return viewer.run(); 
    227197 
    228198