Show
Ignore:
Timestamp:
01/08/07 11:00:16 (7 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/osgparametric/osgparametric.cpp

    r5863 r5927  
    1414#include <osgUtil/TriStripVisitor> 
    1515 
    16 #include <osgProducer/Viewer> 
     16#include <osgViewer/Viewer> 
     17 
     18#include <iostream> 
    1719 
    1820// for the grid data.. 
     
    512514    
    513515    // construct the viewer. 
    514     osgProducer::Viewer viewer(arguments); 
    515  
    516     // set up the value with sensible default event handlers. 
    517     viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 
    518      
     516    osgViewer::Viewer viewer; 
     517 
    519518    std::string shader("simple"); 
    520519    while(arguments.read("-s",shader)) {} 
     
    541540    while(arguments.read("--join")) { joinStrips = true; } 
    542541 
    543     // get details on keyboard and mouse bindings used by the viewer. 
    544     viewer.getUsage(*arguments.getApplicationUsage()); 
    545  
    546542    // if user request help write it out to cout. 
    547543    if (arguments.read("-h") || arguments.read("--help")) 
    548544    { 
    549545        arguments.getApplicationUsage()->write(std::cout); 
    550         return 1; 
    551     } 
    552  
    553     // any option left unread are converted into errors to write out later. 
    554     arguments.reportRemainingOptionsAsUnrecognized(); 
    555  
    556     // report any errors if they have occured when parsing the program aguments. 
    557     if (arguments.errors()) 
    558     { 
    559         arguments.writeErrorMessages(std::cout); 
    560546        return 1; 
    561547    } 
     
    567553        return 1; 
    568554    } 
    569  
    570     // add a viewport to the viewer and attach the scene graph. 
     555     
    571556    viewer.setSceneData(model); 
    572      
    573     // create the windows and run the threads. 
    574     viewer.realize(); 
    575  
    576     while( !viewer.done() ) 
    577     { 
    578         // wait for all cull and draw threads to complete. 
    579         viewer.sync(); 
    580  
    581         // update the scene by traversing it with the the update visitor which will 
    582         // call all node update callbacks and animations. 
    583         viewer.update(); 
    584           
    585         // fire off the cull and draw traversals of the scene. 
    586         viewer.frame(); 
    587          
    588     } 
    589      
    590     // wait for all cull and draw threads to complete. 
    591     viewer.sync(); 
    592  
    593     // run a clean up frame to delete all OpenGL objects. 
    594     viewer.cleanup_frame(); 
    595  
    596     // wait for all the clean up frame to complete. 
    597     viewer.sync(); 
    598  
    599     return 0; 
     557 
     558    return viewer.run(); 
    600559}