Changeset 3701 for OpenSceneGraph/trunk/examples/osgshape/osgshape.cpp
- Timestamp:
- 11/24/04 20:10:44 (9 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgshape/osgshape.cpp
r2767 r3701 13 13 #include "../osghangglide/terrain_coords.h" 14 14 15 osg::Geode* createShapes( )15 osg::Geode* createShapes( char* img_filename ) 16 16 { 17 17 osg::Geode* geode = new osg::Geode(); … … 22 22 osg::StateSet* stateset = new osg::StateSet(); 23 23 24 osg::Image* image = osgDB::readImageFile("Images/lz.rgb"); 24 if( ! img_filename ) img_filename = "Images/lz.rgb"; 25 osg::Image* image = osgDB::readImageFile( img_filename ); 26 25 27 if (image) 26 28 { … … 92 94 // set up the usage document, in case we need to print out how to use this program. 93 95 arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates the osg::Shape classes."); 94 arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");96 arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] [image_filename]"); 95 97 arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 96 98 … … 120 122 return 1; 121 123 } 124 125 char* img_filename = 0; 126 for( int pos = 1; pos < arguments.argc(); ++pos ) 127 { 128 if( arguments.isString(pos) ) 129 { 130 img_filename = arguments[pos]; 131 break; 132 } 133 } 122 134 123 osg::Node* node = createShapes( );135 osg::Node* node = createShapes( img_filename ); 124 136 125 137 // add model to viewer.
