From f7439363eace7c347b1014ea07c5b2aadd6e4343 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 22 Jan 2003 23:34:43 +0000 Subject: [PATCH] Added support for a -c option. --- src/Demos/osgproducer/osgproducer_viewer.cpp | 35 ++++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Demos/osgproducer/osgproducer_viewer.cpp b/src/Demos/osgproducer/osgproducer_viewer.cpp index 82df11d95..580f80ee3 100644 --- a/src/Demos/osgproducer/osgproducer_viewer.cpp +++ b/src/Demos/osgproducer/osgproducer_viewer.cpp @@ -15,10 +15,10 @@ int main( int argc, char **argv ) { // create the camera group. - osgProducer::Viewer viewer; // create the commandline args. std::string pathfile; + std::string configfile; std::vector commandLine; for(int i=1;i= argc ) { + std::cout << "path argument required for -c option."<readCommandLine(commandLine); osgDB::readCommandLine(commandLine); @@ -47,37 +60,37 @@ int main( int argc, char **argv ) // set up the value with sensible defaults. - viewer.setUpViewer(); + viewer->setUpViewer(); if( !pathfile.empty() ) { osg::ref_ptr apm = new osgGA::AnimationPathManipulator(pathfile); if( apm.valid() && apm->valid() ) { - unsigned int num = viewer.addCameraManipulator(apm.get()); - viewer.selectCameraManipulator(num); + unsigned int num = viewer->addCameraManipulator(apm.get()); + viewer->selectCameraManipulator(num); } } // set the scene to render - viewer.setSceneData(loadedModel.get()); + viewer->setSceneData(loadedModel.get()); // set up the pthread stack size to large enough to run into problems. - viewer.setStackSize( 20*1024*1024); + viewer->setStackSize( 20*1024*1024); // create the windows and run the threads. - viewer.realize(Producer::CameraGroup::ThreadPerCamera); + viewer->realize(Producer::CameraGroup::ThreadPerCamera); - while( !viewer.done() ) + while( !viewer->done() ) { // wait for all cull and draw threads to complete. - viewer.sync(); + viewer->sync(); // update the scene by traversing it with the the update visitor which will // call all node update callbacks and animations. - viewer.update(); + viewer->update(); // fire off the cull and draw traversals of the scene. - viewer.frame(); + viewer->frame(); } return 0;