Show
Ignore:
Timestamp:
11/11/08 16:00:29 (5 years ago)
Author:
robert
Message:

Added --delay <microseconds> option that is run between each OpenGL object apply, defaults to 0

Files:
1 modified

Legend:

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

    r9141 r9142  
    2525#include <osgViewer/Viewer> 
    2626 
     27#include <stdio.h> 
     28 
    2729class MemoryTest : public osg::Referenced 
    2830{ 
     
    225227    while(arguments.read("--fbo",width,height)) { tests.push_back(new FboTest(width,height,2)); } 
    226228    while(arguments.read("--fbo")) { tests.push_back(new FboTest(1024,1024,2)); } 
     229 
     230    unsigned int sleepTime = 0; 
     231    while(arguments.read("--delay",sleepTime)) {} 
    227232 
    228233    int maxNumContextIterations = 1; 
     
    293298                        ++gitr) 
    294299                    { 
     300                        if (sleepTime>0) OpenThreads::Thread::microSleep( sleepTime ); 
     301 
     302                        printf("%i ",numGLObjectsApplied);fflush(stdout); 
     303 
    295304                        (*gitr)->apply(*(context->getState())); 
    296305                        ++numGLObjectsApplied; 
     
    298307                     
    299308                    context->releaseContext(); 
     309                    printf("\n\n"); fflush(stdout); 
    300310                } 
    301311            } 
     
    304314    catch(const char* errorString) 
    305315    { 
    306         printf("Exception caught, contexts completed = %i, gl objects successfully applied =%i, error = %s\n",numContextIterations, numGLObjectsApplied, errorString); 
     316        printf("\nException caught, contexts completed = %i, gl objects successfully applied =%i, error = %s\n\n",numContextIterations, numGLObjectsApplied, errorString); 
    307317        return 1; 
    308318    } 
    309319    catch(...) 
    310320    { 
    311         printf("Exception caught, contexts completed = %i, gl objects successfully applied =%i\n",numContextIterations, numGLObjectsApplied); 
     321        printf("\nException caught, contexts completed = %i, gl objects successfully applied =%i\n\n",numContextIterations, numGLObjectsApplied); 
    312322        return 1; 
    313323    } 
    314324 
    315     printf("Successful completion, contexts created = %i, gl objects applied =%i\n",numContextIterations, numGLObjectsApplied); 
     325    printf("\nSuccessful completion, contexts created = %i, gl objects applied =%i\n\n",numContextIterations, numGLObjectsApplied); 
    316326     
    317327    return 0;