Show
Ignore:
Timestamp:
01/10/07 14:52:22 (8 years ago)
Author:
robert
Message:

Ported following examples to osgViewer:

osgparticleeffects
osgphotoalbum
osgpick
osgpoints
osgpointsprite
osgprecipitation
osgprerender
osgprerendercubemap
osgreflect
osgscalarbar
osgscribe
osgsequence
osgplanets

Files:
1 modified

Legend:

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

    r5757 r5954  
    1 #include <osgProducer/Viewer> 
     1#include <osgViewer/Viewer> 
    22 
    33#include <osg/Projection> 
     
    1818#include <osg/Material> 
    1919#include <osg/PositionAttitudeTransform> 
     20#include <osg/ArgumentParser> 
    2021 
    2122#include <osg/Camera> 
    2223#include <osg/TexGenNode> 
     24 
     25#include <iostream> 
    2326 
    2427using namespace osg; 
     
    288291 
    289292    // construct the viewer. 
    290     osgProducer::Viewer viewer(arguments); 
    291  
    292     // set up the value with sensible default event handlers. 
    293     viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 
    294  
    295     // get details on keyboard and mouse bindings used by the viewer. 
    296     viewer.getUsage(*arguments. getApplicationUsage()); 
     293    osgViewer::Viewer viewer; 
    297294 
    298295    // if user request help write it out to cout. 
     
    332329    if (!reflectedSubgraph.valid()) return 1; 
    333330 
    334     ref_ptr<Group> reflectedScene = createShadowedScene(reflectedSubgraph.get(), createReflector(), 0, viewer.getClearColor(), 
     331    ref_ptr<Group> reflectedScene = createShadowedScene(reflectedSubgraph.get(), createReflector(), 0, viewer.getCamera()->getClearColor(), 
    335332                                                        tex_width, tex_height, renderImplementation); 
    336333 
     
    339336    viewer.setSceneData(scene.get()); 
    340337 
    341     // create the windows and run the threads. 
    342     viewer.realize(); 
    343  
    344     while (!viewer.done()) 
    345     { 
    346       // wait for all cull and draw threads to complete. 
    347       viewer.sync(); 
    348  
    349       // update the scene by traversing it with the the update visitor which will 
    350       // call all node update callbacks and animations. 
    351       viewer.update(); 
    352           
    353       // fire off the cull and draw traversals of the scene. 
    354       viewer.frame(); 
    355     } 
    356      
    357     // wait for all cull and draw threads to complete. 
    358     viewer.sync(); 
    359  
    360     // run a clean up frame to delete all OpenGL objects. 
    361     viewer.cleanup_frame(); 
    362  
    363     // wait for all the clean up frame to complete. 
    364     viewer.sync(); 
    365  
    366     return 0; 
     338    return viewer.run(); 
    367339}