Added support for osgViewer::Config in osgViewer::Viewer command line parsing

This commit is contained in:
Robert Osfield
2013-05-15 12:50:38 +00:00
parent bcbaaefa02
commit 9552567cd4

View File

@@ -26,6 +26,7 @@
#include <osgViewer/Viewer>
#include <osgViewer/Renderer>
#include <osgViewer/CompositeViewer>
#include <osgViewer/Config>
#include <sstream>
#include <string.h>
@@ -299,6 +300,15 @@ bool Viewer::readConfiguration(const std::string& filename)
//OSG_NOTICE<<"Error: Unable to load configuration file \""<<filename<<"\""<<std::endl;
return false;
}
Config* config = dynamic_cast<Config*>(object.get());
if (config)
{
OSG_NOTICE<<"Using osgViewer::Config : "<<config->className()<<std::endl;
config->configure(*this);
return true;
}
CompositeViewer* compositeViewer = dynamic_cast<CompositeViewer*>(object.get());
if (compositeViewer)