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

Added control of threading model, setting default to SingleThreaded? to avoid crash
associated with mixing useCursor(false) and multi-threading.

Files:
1 modified

Legend:

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

    r6690 r6834  
    400400    arguments.getApplicationUsage()->addCommandLineOption("-y <float>","Vertical offset of left and right images."); 
    401401    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 
     402    arguments.getApplicationUsage()->addCommandLineOption("--SingleThreaded","Select SingleThreaded threading model for viewer."); 
     403    arguments.getApplicationUsage()->addCommandLineOption("--CullDrawThreadPerContext","Select CullDrawThreadPerContext threading model for viewer."); 
     404    arguments.getApplicationUsage()->addCommandLineOption("--DrawThreadPerContext","Select DrawThreadPerContext threading model for viewer."); 
     405    arguments.getApplicationUsage()->addCommandLineOption("--CullThreadPerCameraDrawThreadPerContext","Select CullThreadPerCameraDrawThreadPerContext threading model for viewer."); 
    402406     
    403407 
     
    428432        return 1; 
    429433    } 
     434 
     435    osgViewer::Viewer::ThreadingModel threading = osgViewer::Viewer::SingleThreaded; 
     436    while (arguments.read("--SingleThreaded")) threading = osgViewer::Viewer::SingleThreaded; 
     437    while (arguments.read("--CullDrawThreadPerContext")) threading = osgViewer::Viewer::CullDrawThreadPerContext; 
     438    while (arguments.read("--DrawThreadPerContext")) threading = osgViewer::Viewer::DrawThreadPerContext; 
     439    while (arguments.read("--CullThreadPerCameraDrawThreadPerContext")) threading = osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext; 
     440 
     441    viewer.setThreadingModel(threading); 
    430442 
    431443    // any option left unread are converted into errors to write out later. 
     
    486498    // set the scene to render 
    487499    viewer.setSceneData(rootNode.get()); 
     500 
    488501 
    489502    // create the windows and run the threads.