Show
Ignore:
Timestamp:
01/05/07 16:52:33 (8 years ago)
Author:
robert
Message:

Simplified the osganimate and osgautotransform mains, removing most or all of the argument parser code.

Files:
1 modified

Legend:

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

    r5905 r5910  
    158158} 
    159159 
    160 int main( int argc, char **argv ) 
     160int main(int, char**) 
    161161{ 
    162  
    163     // use an ArgumentParser object to manage the program arguments. 
    164     osg::ArgumentParser arguments(&argc,argv); 
    165      
    166     // set up the usage document, in case we need to print out how to use this program. 
    167     arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates how to do Head Up Displays."); 
    168     arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] [filename] ..."); 
    169     arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 
    170      
    171  
    172162    // construct the viewer. 
    173163    osgViewer::Viewer viewer; 
    174  
    175     // if user request help write it out to cout. 
    176     if (arguments.read("-h") || arguments.read("--help")) 
    177     { 
    178         arguments.getApplicationUsage()->write(std::cout); 
    179         return 1; 
    180     } 
    181  
    182     // any option left unread are converted into errors to write out later. 
    183     arguments.reportRemainingOptionsAsUnrecognized(); 
    184  
    185     // report any errors if they have occured when parsing the program aguments. 
    186     if (arguments.errors()) 
    187     { 
    188         arguments.writeErrorMessages(std::cout); 
    189         return 1; 
    190     } 
    191      
    192164 
    193165    // set the scene to render 
    194166    viewer.setSceneData(createScene()); 
    195167     
     168    // run the viewers frame loop 
    196169    return viewer.run(); 
    197  
    198  
    199 //     osg::Node* obj = new osg::Node; 
    200 //     cout << "obj = "<<obj<<endl; 
    201 //     cout << "sizeof(obj) = "<<sizeof(*obj)<<endl; 
    202 //     cout << "sizeof(osg::Object) = "<<sizeof(osg::Object)<<endl; 
    203 //     cout << "sizeof(osg::Referenced) = "<<sizeof(osg::Referenced)<<endl; 
    204 //     cout << "vtbl = "<<*((unsigned int*)obj)<<endl; 
    205 //     cout << "next = "<<*((unsigned int*)obj+1)<<endl; 
    206 //  
    207 //     osg::Node* obj2 = new osg::Node; 
    208 //     obj2->ref(); 
    209 //     obj2->ref(); 
    210 //     obj2->ref(); 
    211 //     cout << "obj = "<<obj2<<endl; 
    212 //     cout << "sizeof(obj) = "<<sizeof(*obj)<<endl; 
    213 //     cout << "sizeof(osg::Object) = "<<sizeof(osg::Object)<<endl; 
    214 //     cout << "sizeof(osg::Referenced) = "<<sizeof(osg::Referenced)<<endl; 
    215 //     cout << "vtbl = "<<*((unsigned int*)obj2)<<endl; 
    216 //     cout << "next = "<<*((unsigned int*)obj2+1)<<endl; 
    217 //  
    218 //     osg::Group* obj3 = new osg::Group; 
    219 //     cout << "obj = "<<obj3<<endl; 
    220 //     cout << "sizeof(obj) = "<<sizeof(*obj3)<<endl; 
    221 //     cout << "sizeof(osg::Object) = "<<sizeof(osg::Object)<<endl; 
    222 //     cout << "sizeof(osg::Referenced) = "<<sizeof(osg::Referenced)<<endl; 
    223 //     cout << "vtbl = "<<*((unsigned int*)obj3)<<endl; 
    224 //     cout << "next = "<<*((unsigned int*)obj3+1)<<endl; 
    225170}