Show
Ignore:
Timestamp:
01/06/07 22:35:57 (8 years ago)
Author:
robert
Message:

Ported osgcopy, osgcubemap, osgdelaunay, osgdepthpartion, osgdistortion, osgfadetext, osgforest and osgfxbrowser to osgViewer

Files:
1 modified

Legend:

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

    r5381 r5923  
    77#include <osg/LightSource> 
    88 
    9 #include <osgProducer/Viewer> 
     9#include <osgViewer/Viewer> 
    1010 
    1111#include <osgDB/ReadFile> 
     
    2626#include <vector> 
    2727#include <string> 
     28#include <iostream> 
    2829 
    2930class RotateCallback: public osg::NodeCallback { 
     
    260261} 
    261262 
    262 void build_world(osg::Group* root, osg::Node* scene, osgProducer::Viewer& viewer) 
     263void build_world(osg::Group* root, osg::Node* scene, osgViewer::Viewer& viewer) 
    263264{ 
    264265    osg::ref_ptr<EffectPanel> effect_panel = build_gui(root); 
     
    266267    effect_panel->rebuild(); 
    267268 
    268     viewer.getEventHandlerList().push_front(new EffectPanel::KeyboardHandler(effect_panel.get())); 
     269    viewer.addEventHandler(new EffectPanel::KeyboardHandler(effect_panel.get())); 
    269270 
    270271    root->addChild(effect_panel->getRoot()); 
     
    289290 
    290291    // construct the viewer. 
    291     osgProducer::Viewer viewer(arguments); 
    292  
    293     // set up the value with sensible default event handlers. 
    294     viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 
    295  
    296     // get details on keyboard and mouse bindings used by the viewer. 
    297     viewer.getUsage(*arguments.getApplicationUsage()); 
     292    osgViewer::Viewer viewer; 
    298293 
    299294    // if user request help write it out to cout. 
     
    359354    viewer.setSceneData(root.get()); 
    360355 
    361     // create the windows and run the threads. 
    362     viewer.realize(); 
    363  
    364     while(!viewer.done()) 
    365     { 
    366         // wait for all cull and draw threads to complete. 
    367         viewer.sync(); 
    368  
    369         // update the scene by traversing it with the the update visitor which will 
    370         // call all node update callbacks and animations. 
    371         viewer.update(); 
    372  
    373         // fire off the cull and draw traversals of the scene. 
    374         viewer.frame(); 
    375  
    376     } 
    377  
    378     // wait for all cull and draw threads to complete. 
    379     viewer.sync(); 
    380  
    381     // run a clean up frame to delete all OpenGL objects. 
    382     viewer.cleanup_frame(); 
    383  
    384     // wait for all the clean up frame to complete. 
    385     viewer.sync(); 
    386  
    387     return 0; 
     356    return viewer.run(); 
    388357}