Ported follow examples to osgViewer:

osgshape
    osgsimplifier
    osgsimulation
    osgslice
    osgspacewarp
    osgspheresegment
    osgspotlight
    osgstereoimage
This commit is contained in:
Robert Osfield
2007-01-11 11:47:01 +00:00
parent 5ee30edbea
commit d6291a0ffc
32 changed files with 185 additions and 521 deletions

View File

@@ -1,4 +1,4 @@
#include <osgProducer/Viewer>
#include <osgViewer/Viewer>
#include <osg/Group>
#include <osg/Geode>
@@ -9,6 +9,7 @@
#include <osg/Geometry>
#include <osgUtil/SmoothingVisitor>
#include <osgUtil/IntersectVisitor>
#include <osgDB/ReadFile>
@@ -24,6 +25,8 @@
#include <osg/io_utils>
#include <iostream>
// for the grid data..
#include "../osghangglide/terrain_coords.h"
@@ -619,13 +622,7 @@ int main(int argc, char **argv)
// construct the viewer.
osgProducer::Viewer viewer(arguments);
// set up the value with sensible default event handlers.
viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
// get details on keyboard and mouse bindings used by the viewer.
viewer.getUsage(*arguments.getApplicationUsage());
osgViewer::Viewer viewer;
// if user request help write it out to cout.
unsigned int testCase = 0;
@@ -655,31 +652,5 @@ int main(int argc, char **argv)
// add a viewport to the viewer and attach the scene graph.
viewer.setSceneData(root);
// create the windows and run the threads.
viewer.realize();
while( !viewer.done() )
{
// wait for all cull and draw threads to complete.
viewer.sync();
// update the scene by traversing it with the the update visitor which will
// call all node update callbacks and animations.
viewer.update();
// fire off the cull and draw traversals of the scene.
viewer.frame();
}
// wait for all cull and draw threads to complete.
viewer.sync();
// run a clean up frame to delete all OpenGL objects.
viewer.cleanup_frame();
// wait for all the clean up frame to complete.
viewer.sync();
return 0;
return viewer.run();
}