Show
Ignore:
Timestamp:
01/04/07 22:58:37 (8 years ago)
Author:
robert
Message:

Changed compile paths into runtime selected paths using command line parameters

Files:
1 modified

Legend:

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

    r5894 r5895  
    145145    } 
    146146 
     147    osgViewer::Viewer viewer; 
     148     
     149    while (arguments.read("-s")) { viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); } 
     150    while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::Viewer::ThreadPerContext); } 
     151    while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::Viewer::ThreadPerCamera); } 
     152     
     153    bool limitNumberOfFrames = false; 
     154    unsigned int maxFrames = 10; 
     155    while (arguments.read("--run-till-frame-number",maxFrames)) { limitNumberOfFrames = true; } 
     156 
     157    // alternative viewer window setups. 
     158    while (arguments.read("-1")) { singleWindowMultipleCameras(viewer); } 
     159    while (arguments.read("-2")) { multipleWindowMultipleCameras(viewer); } 
     160 
     161 
     162    if (apm.valid()) viewer.setCameraManipulator(apm.get()); 
     163    else viewer.setCameraManipulator( new osgGA::TrackballManipulator() ); 
     164 
    147165    // load the scene. 
    148166    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 
     
    153171    } 
    154172 
    155     osgViewer::Viewer viewer; 
    156      
    157     while (arguments.read("-s")) { viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); } 
    158     while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::Viewer::ThreadPerContext); } 
    159     while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::Viewer::ThreadPerCamera); } 
    160  
    161 //    viewer.setSceneData(loadedModel.get()); 
    162  
    163     if (apm.valid()) viewer.setCameraManipulator(apm.get()); 
    164     else viewer.setCameraManipulator( new osgGA::TrackballManipulator() ); 
    165  
    166 #if 1 
    167  
    168     // singleWindowMultipleCameras(viewer); 
    169      
    170     multipleWindowMultipleCameras(viewer); 
    171  
    172 #endif 
    173  
    174173    viewer.setSceneData(loadedModel.get()); 
    175174 
    176175    viewer.realize(); 
    177176 
    178     bool limitNumberOfFrames = false; 
    179177    unsigned int numFrames = 0; 
    180     unsigned int maxFrames = 10; 
    181  
    182178    while(!viewer.done() && !(limitNumberOfFrames && numFrames>=maxFrames)) 
    183179    {