diff --git a/examples/osgcamera/osgcamera.cpp b/examples/osgcamera/osgcamera.cpp index 138689450..c2d61ec34 100644 --- a/examples/osgcamera/osgcamera.cpp +++ b/examples/osgcamera/osgcamera.cpp @@ -16,8 +16,6 @@ * THE SOFTWARE. */ -#if 1 - #include #include #include @@ -186,6 +184,37 @@ int main( int argc, char **argv ) return 1; } + unsigned int numRepeats = 2; + if (arguments.read("--repeat",numRepeats) || arguments.read("-r",numRepeats) || arguments.read("--repeat") || arguments.read("-r")) + { + bool sharedModel = arguments.read("--shared"); + osg::ref_ptr model; + if (sharedModel) model = osgDB::readNodeFiles(arguments); + + osgViewer::Viewer::ThreadingModel threadingModel = osgViewer::Viewer::AutomaticSelection; + while (arguments.read("-s")) { threadingModel = osgViewer::Viewer::SingleThreaded; } + while (arguments.read("-g")) { threadingModel = osgViewer::Viewer::CullDrawThreadPerContext; } + while (arguments.read("-d")) { threadingModel = osgViewer::Viewer::DrawThreadPerContext; } + while (arguments.read("-c")) { threadingModel = osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext; } + + for(unsigned int i=0; i apm = 0; @@ -277,26 +306,3 @@ int main( int argc, char **argv ) return 0; } -#else - -#include -#include -#include - -int main( int, char **) -{ - osg::ref_ptr model = osgDB::readNodeFile("cow.osg"); - - for(unsigned int i=0; i<5; ++i) - { - osg::notify(osg::NOTICE)<<"New frame *******************************"<