Show
Ignore:
Timestamp:
11/11/08 18:29:48 (6 years ago)
Author:
robert
Message:

Added default fallback of a window context is none is otherwise specified.

Files:
1 modified

Legend:

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

    r9146 r9147  
    317317    arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" tests OpenGL and Windowing memory scalability.."); 
    318318    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","List command line options."); 
     319    arguments.getApplicationUsage()->addCommandLineOption("--pbuffer","Create a 512x512 pixel buffer."); 
    319320    arguments.getApplicationUsage()->addCommandLineOption("--pbuffer <width> <height>","Create a pixel buffer of specified dimensions."); 
    320     arguments.getApplicationUsage()->addCommandLineOption("--pbuffer","Create a 512x512 pixel buffer."); 
     321    arguments.getApplicationUsage()->addCommandLineOption("--window","Create a 512x512 graphics window."); 
    321322    arguments.getApplicationUsage()->addCommandLineOption("--window <width> <height>","Create a graphics window of specified dimensions."); 
    322     arguments.getApplicationUsage()->addCommandLineOption("--window","Create a 512x512 graphics window."); 
    323323    arguments.getApplicationUsage()->addCommandLineOption("--delay <micoseconds>","Set a delay in microseconds before all OpenGL object operations."); 
    324324    arguments.getApplicationUsage()->addCommandLineOption("--texture <width> <height> <depth>","Allocate a 3D texture of specified dimensions."); 
     
    337337        return 1; 
    338338    } 
    339      
    340     // report any errors if they have occurred when parsing the program arguments. 
    341     if (arguments.errors()) 
    342     { 
    343         arguments.writeErrorMessages(std::cout); 
    344         return 1; 
    345     } 
    346      
     339 
    347340    if (arguments.argc()<=1) 
    348341    { 
     
    391384    while(arguments.read("-g",maxNumGLIterations)) {} 
    392385 
    393  
     386#if 0 
    394387    // any option left unread are converted into errors to write out later. 
    395388    arguments.reportRemainingOptionsAsUnrecognized(); 
     
    401394        return 1; 
    402395    } 
     396#endif 
    403397     
    404398    typedef std::list< osg::ref_ptr<osg::GraphicsContext> > Contexts; 
     
    406400    Contexts allocatedContexts; 
    407401    GLObjects glObjects; 
     402     
     403    if (contextTests.empty()) 
     404    { 
     405        if (glMemoryTests.empty()) 
     406        { 
     407            std::cout<<"Not tests specified, please specify test using the command line options below."<<std::endl<<std::endl; 
     408         
     409            arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); 
     410            return 1;             
     411        } 
     412        else 
     413        { 
     414            contextTests.push_back(new ContextTest(512,512, false)); 
     415        } 
     416    } 
    408417 
    409418    osg::Timer_t startTick = osg::Timer::instance()->tick();