Added support for "--output filename.osg" command line option to avoid debugging of generated presentations

This commit is contained in:
Robert Osfield 2009-09-09 13:23:49 +00:00
parent d28b052fb7
commit 13a7ecebde

View File

@ -576,6 +576,10 @@ int main( int argc, char **argv )
osg::DisplaySettings::instance()->setScreenWidth(width);
}
std::string outputFileName;
while(arguments.read("--output",outputFileName)) {}
// get details on keyboard and mouse bindings used by the viewer.
viewer.getUsage(*arguments.getApplicationUsage());
@ -780,7 +784,11 @@ int main( int argc, char **argv )
seh->home();
// osgDB::writeNodeFile(*loadedModel,"saved.osg");
if (!outputFileName.empty())
{
osgDB::writeNodeFile(*loadedModel,outputFileName);
return 0;
}
osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick();
double targetFrameTime = 1.0/targetFrameRate;