diff --git a/examples/osgtext/osgtext.cpp b/examples/osgtext/osgtext.cpp index 7412c6074..78f69eb7a 100644 --- a/examples/osgtext/osgtext.cpp +++ b/examples/osgtext/osgtext.cpp @@ -698,9 +698,12 @@ int main(int argc, char** argv) viewer.setSceneData(group); } -#if 0 - osgDB::writeNodeFile(*viewer.getSceneData(),"text.osg"); -#endif + std::string filename; + if (arguments.read("-o",filename)) + { + osgDB::writeNodeFile(*viewer.getSceneData(),filename); + return 0; + } viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); viewer.addEventHandler(new osgViewer::StatsHandler()); @@ -716,5 +719,7 @@ int main(int argc, char** argv) (*itr)->cancel(); } } + + return 0; }