Adding support for controlling visual settings via environmental variables

and command line paramters.  Including support for stereo and stencil buffer.
This commit is contained in:
Robert Osfield
2001-12-19 00:38:23 +00:00
parent a3fe8ebb18
commit 296865e250
24 changed files with 825 additions and 300 deletions

View File

@@ -2,6 +2,7 @@
#include <osg/Object>
#include <osg/Image>
#include <osg/Node>
#include <osg/Group>
#include <osgDB/Registry>
#include <osgDB/ReadFile>
@@ -34,3 +35,52 @@ Node* osgDB::readNodeFile(const std::string& filename)
if (rr.error()) notify(WARN) << rr.message() << std::endl;
return NULL;
}
Node* osgDB::readNodeFiles(std::vector<std::string>& commandLine)
{
typedef std::vector<osg::Node*> NodeList;
NodeList nodeList;
// note currently doesn't delete the loaded files yet...
for(std::vector<std::string>::iterator itr=commandLine.begin();
itr!=commandLine.end();
++itr)
{
if ((*itr)[0]!='-')
{
// not an option so assume string is a filename.
osg::Node *node = osgDB::readNodeFile( *itr );
if( node != (osg::Node *)0L )
{
if (node->getName().empty()) node->setName( *itr );
nodeList.push_back(node);
}
}
}
if (nodeList.empty())
{
return NULL;
}
if (nodeList.size()==1)
{
return nodeList.front();
}
else // size >1
{
osg::Group* group = new osg::Group();
for(NodeList::iterator itr=nodeList.begin();
itr!=nodeList.end();
++itr)
{
group->addChild(*itr);
}
return group;
}
}