Show
Ignore:
Timestamp:
06/08/07 17:11:04 (7 years ago)
Author:
robert
Message:

Added default file when no command line options are supplied.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgkeyboardmouse/osgkeyboardmouse.cpp

    r6817 r6913  
    322322int main( int argc, char **argv ) 
    323323{ 
    324     if (argc<2)  
    325     { 
    326         std::cout << argv[0] <<": requires filename argument." << std::endl; 
    327         return 1; 
    328     } 
    329  
     324    osg::ref_ptr<osg::Node> loadedModel; 
     325     
    330326    // load the scene. 
    331     osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(argv[1]); 
     327    if (argc>1) loadedModel = osgDB::readNodeFile(argv[1]); 
     328     
     329    // if not loaded assume no arguments passed in, try use default mode instead. 
     330    if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osg"); 
     331     
    332332    if (!loadedModel)  
    333333    {