Show
Ignore:
Timestamp:
04/21/10 18:37:28 (5 years ago)
Author:
robert
Message:

From Mourad Boufarguine, "When compiling the example on VS9, the compiler complain about undefined GL_DEPTH_COMPONENT32F and GL_DEPTH_COMPONENT32F_NV. So I added them to include/osg/FrameBufferObject. The example builds fine and is working for me without crashs unless it is ran whithout argument. I added couple of lines to check for arguments number and print the example usage when needed."

Files:
1 modified

Legend:

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

    r11339 r11355  
    918918    // use an ArgumentParser object to manage the program arguments. 
    919919    ArgumentParser arguments(&argc,argv); 
    920     arguments.getApplicationUsage() 
    921         ->setDescription(arguments.getApplicationName() 
     920    arguments.getApplicationUsage()->setDescription(arguments.getApplicationName() 
    922921                         + " demonstrates using a floating point depth buffer.\nThe user can invert the depth buffer range and choose among available multi-sample configurations."); 
    923     arguments.getApplicationUsage() 
    924         ->addCommandLineOption("--far <number>", "Set far plane value"); 
     922    arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); 
     923    arguments.getApplicationUsage()->addCommandLineOption("--far <number>", "Set far plane value"); 
    925924    // if user request help write it out to cout. 
    926925    if (arguments.read("-h") || arguments.read("--help")) 
     
    949948    width = traits->width; 
    950949    height = traits->height; 
     950    if (arguments.argc()<=1) 
     951    { 
     952        arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); 
     953        return 1; 
     954    } 
    951955    ref_ptr<Node> loadedModel = osgDB::readNodeFiles(arguments); 
    952956    if (!loadedModel) {