Changeset 5910 for OpenSceneGraph/trunk/examples/osganimate/osganimate.cpp
- Timestamp:
- 01/05/07 16:52:33 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osganimate/osganimate.cpp
r5903 r5910 207 207 int main( int argc, char **argv ) 208 208 { 209 // use an ArgumentParser object to manage the program arguments. 209 210 bool overlay = false; 210 211 osg::ArgumentParser arguments(&argc,argv); 211 212 // set up the usage document, in case we need to print out how to use this program. 213 arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates use of osg::AnimationPath and UpdateCallbacks for adding animation to your scenes."); 214 arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); 215 arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 216 212 while (arguments.read("--overlay")) overlay = true; 213 217 214 // initialize the viewer. 218 215 osgViewer::Viewer viewer; 219 216 220 // if user request help write it out to cout.221 if (arguments.read("-h") || arguments.read("--help"))222 {223 arguments.getApplicationUsage()->write(std::cout);224 return 1;225 }226 227 bool overlay = false;228 while (arguments.read("--overlay")) overlay = true;229 230 // any option left unread are converted into errors to write out later.231 arguments.reportRemainingOptionsAsUnrecognized();232 233 // report any errors if they have occured when parsing the program aguments.234 if (arguments.errors())235 {236 arguments.writeErrorMessages(std::cout);237 return 1;238 }239 240 217 // load the nodes from the commandline arguments. 241 218 osg::Node* model = createModel(overlay);
