Show
Ignore:
Timestamp:
01/11/07 12:47:01 (8 years ago)
Author:
robert
Message:

Ported follow examples to osgViewer:

osgshape
osgsimplifier
osgsimulation
osgslice
osgspacewarp
osgspheresegment
osgspotlight
osgstereoimage

Files:
1 modified

Legend:

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

    r5381 r5959  
    1 #include <osgProducer/Viewer> 
     1#include <osgViewer/Viewer> 
    22 
    33#include <osg/Group> 
     
    1010 
    1111#include <osgUtil/SmoothingVisitor> 
     12#include <osgUtil/IntersectVisitor> 
    1213 
    1314#include <osgDB/ReadFile> 
     
    2425 
    2526#include <osg/io_utils> 
     27 
     28#include <iostream> 
    2629 
    2730// for the grid data.. 
     
    620623 
    621624    // 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; 
    629626 
    630627    // if user request help write it out to cout. 
     
    656653    viewer.setSceneData(root); 
    657654         
    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(); 
    685656}