Show
Ignore:
Timestamp:
01/08/07 11:00:16 (8 years ago)
Author:
robert
Message:

Ported following examples to osgViewer:

osggeodemo
osggeometry
osghud
osgimpostor
osgkeyboard
osglauncher
osglight
osglightpoint
osglogicop
osglogo
osgmovie
osgmultiplecameras
osgmultitexture
osgoccluder
osgparametric
osgparticle

Files:
1 modified

Legend:

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

    r5381 r5927  
    11#include <osg/GL> 
    2 #include <osgProducer/Viewer> 
     2#include <osgViewer/Viewer> 
    33 
    44#include <osg/MatrixTransform> 
     
    1919#include <osgSim/LightPointNode> 
    2020 
    21  
     21#include <iostream> 
    2222 
    2323#define INTERPOLATE(member) lp.member = start.member*rstart + end.member*rend; 
     
    190190int main( int argc, char **argv ) 
    191191{ 
    192  
    193192    // use an ArgumentParser object to manage the program arguments. 
    194193    osg::ArgumentParser arguments(&argc,argv); 
     
    201200 
    202201    // construct the viewer. 
    203     osgProducer::Viewer viewer(arguments); 
    204  
    205     // set up the value with sensible default event handlers. 
    206     viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 
    207  
    208     // get details on keyboard and mouse bindings used by the viewer. 
    209     viewer.getUsage(*arguments.getApplicationUsage()); 
     202    osgViewer::Viewer viewer; 
    210203 
    211204    // if user request help write it out to cout. 
     
    219212    while (arguments.read("--sprites")) { usePointSprites = true; }; 
    220213 
    221     // any option left unread are converted into errors to write out later. 
    222     arguments.reportRemainingOptionsAsUnrecognized(); 
    223  
    224     // report any errors if they have occured when parsing the program aguments. 
    225     if (arguments.errors()) 
    226     { 
    227         arguments.writeErrorMessages(std::cout); 
    228         return 1; 
    229     } 
    230      
    231214    osg::Group* rootnode = new osg::Group; 
    232215 
     
    243226    viewer.setSceneData( rootnode ); 
    244227     
    245     // create the windows and run the threads. 
    246     viewer.realize(); 
    247  
    248     while( !viewer.done() ) 
    249     { 
    250         // wait for all cull and draw threads to complete. 
    251         viewer.sync(); 
    252  
    253         // update the scene by traversing it with the the update visitor which will 
    254         // call all node update callbacks and animations. 
    255         viewer.update(); 
    256           
    257         // fire off the cull and draw traversals of the scene. 
    258         viewer.frame(); 
    259          
    260     } 
    261      
    262     // wait for all cull and draw threads to complete. 
    263     viewer.sync(); 
    264  
    265     // run a clean up frame to delete all OpenGL objects. 
    266     viewer.cleanup_frame(); 
    267  
    268     // wait for all the clean up frame to complete. 
    269     viewer.sync(); 
    270  
    271     return 0; 
    272 } 
     228    return viewer.run(); 
     229}