Changeset 5927 for OpenSceneGraph/trunk/examples/osglogo/osglogo.cpp
- Timestamp:
- 01/08/07 11:00:16 (6 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/examples/osglogo/osglogo.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osglogo/osglogo.cpp
r5463 r5927 16 16 #include <osgGA/TrackballManipulator> 17 17 18 #include <osg Producer/Viewer>18 #include <osgViewer/Viewer> 19 19 20 20 #include <osgDB/ReadFile> 21 22 #include <iostream> 21 23 22 24 static bool s_ProfessionalServices = false; … … 443 445 int main( int argc, char **argv ) 444 446 { 445 446 447 // use an ArgumentParser object to manage the program arguments. 447 448 osg::ArgumentParser arguments(&argc,argv); 448 449 // set up the usage document, in case we need to print out how to use this program.450 arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates both text, animation and billboard via custom transform to create the OpenSceneGraph logo..");451 452 arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+"[options] [filename] ...");453 arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");454 arguments.getApplicationUsage()->addCommandLineOption("ps","Render the Professional Services logo");455 456 449 457 450 osg::DisplaySettings::instance()->setMinimumNumAlphaBits(8); 458 451 459 452 // construct the viewer. 460 osgProducer::Viewer viewer(arguments); 461 462 viewer.setWriteImageFileName("logo.rgb"); 463 464 // set up the value with sensible default event handlers. 465 viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 466 467 // get details on keyboard and mouse bindings used by the viewer. 468 viewer.getUsage(*arguments.getApplicationUsage()); 453 osgViewer::Viewer viewer; 469 454 470 455 // if user request help write it out to cout. … … 476 461 477 462 while (arguments.read("ps")) s_ProfessionalServices = true; 478 479 // any option left unread are converted into errors to write out later.480 arguments.reportRemainingOptionsAsUnrecognized();481 482 // report any errors if they have occured when parsing the program aguments.483 if (arguments.errors())484 {485 arguments.writeErrorMessages(std::cout);486 return 1;487 }488 463 489 464 osg::Node* node = 0; … … 495 470 viewer.setSceneData( node ); 496 471 497 // create the windows and run the threads. 498 viewer.realize(); 499 500 while( !viewer.done() ) 501 { 502 // wait for all cull and draw threads to complete. 503 viewer.sync(); 504 505 // update the scene by traversing it with the the update visitor which will 506 // call all node update callbacks and animations. 507 viewer.update(); 508 509 // fire off the cull and draw traversals of the scene. 510 viewer.frame(); 511 512 } 513 514 // wait for all cull and draw threads to complete. 515 viewer.sync(); 516 517 // run a clean up frame to delete all OpenGL objects. 518 viewer.cleanup_frame(); 519 520 // wait for all the clean up frame to complete. 521 viewer.sync(); 522 523 return 0; 524 } 472 return viewer.run(); 473 }
