Added reading of the P3D_DEVICE env var for setting up the --device entry.

This commit is contained in:
Robert Osfield 2012-10-31 17:06:29 +00:00
parent a6f3e0af78
commit 98e9f187b3

View File

@ -402,6 +402,17 @@ int main( int argc, char **argv )
doSetViewer = false; doSetViewer = false;
} }
const char* p3dDevice = getenv("P3D_DEVICE");
if (p3dDevice)
{
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(p3dDevice);
if (dev.valid())
{
viewer.addDevice(dev.get());
}
}
std::string device; std::string device;
while (arguments.read("--device", device)) while (arguments.read("--device", device))
{ {