Show
Ignore:
Timestamp:
02/06/07 15:38:08 (7 years ago)
Author:
robert
Message:

Added new Viewer threading model options

Files:
1 modified

Legend:

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

    r5996 r6101  
    2828                    { 
    2929                        case(osgViewer::Viewer::SingleThreaded): 
    30                             viewer->setThreadingModel(osgViewer::Viewer::ThreadPerContext); 
    31                             osg::notify(osg::NOTICE)<<"Threading model 'ThreadPerContext' selected."<<std::endl; 
    32                             break; 
    33                         case(osgViewer::Viewer::ThreadPerContext): 
    34                             viewer->setThreadingModel(osgViewer::Viewer::ThreadPerCamera); 
    35                             osg::notify(osg::NOTICE)<<"Threading model 'ThreadPerCamera' selected."<<std::endl; 
    36                             break; 
    37                         case(osgViewer::Viewer::ThreadPerCamera): 
     30                            viewer->setThreadingModel(osgViewer::Viewer::CullDrawThreadPerContext); 
     31                            osg::notify(osg::NOTICE)<<"Threading model 'CullDrawThreadPerContext' selected."<<std::endl; 
     32                            break; 
     33                        case(osgViewer::Viewer::CullDrawThreadPerContext): 
     34                            viewer->setThreadingModel(osgViewer::Viewer::DrawThreadPerContext); 
     35                            osg::notify(osg::NOTICE)<<"Threading model 'DrawThreadPerContext' selected."<<std::endl; 
     36                            break; 
     37                        case(osgViewer::Viewer::DrawThreadPerContext): 
     38                            viewer->setThreadingModel(osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext); 
     39                            osg::notify(osg::NOTICE)<<"Threading model 'CullThreadPerCameraDrawThreadPerContext' selected."<<std::endl; 
     40                            break; 
     41                        case(osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext): 
    3842                            viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded); 
    39                             osg::notify(osg::NOTICE)<<"Threading model 'SingleTheaded' selected."<<std::endl; 
     43                            osg::notify(osg::NOTICE)<<"Threading model 'SingleThreaded' selected."<<std::endl; 
     44                            break; 
     45                        case(osgViewer::Viewer::AutomaticSelection): 
     46                            viewer->setThreadingModel(viewer->suggestBestThreadingModel()); 
     47                            osg::notify(osg::NOTICE)<<"Threading model 'AutomaticSelection' selected."<<std::endl; 
    4048                            break; 
    4149                    } 
     
    242250     
    243251    while (arguments.read("-s")) { viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); } 
    244     while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::Viewer::ThreadPerContext); } 
    245     while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::Viewer::ThreadPerCamera); } 
     252    while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::Viewer::CullDrawThreadPerContext); } 
     253    while (arguments.read("-d")) { viewer.setThreadingModel(osgViewer::Viewer::DrawThreadPerContext); } 
     254    while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext); } 
    246255     
    247256    bool limitNumberOfFrames = false;