From 98e9f187b3c5909c4d018c362726bbfae755f71b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 31 Oct 2012 17:06:29 +0000 Subject: [PATCH] Added reading of the P3D_DEVICE env var for setting up the --device entry. --- applications/present3D/present3D.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index 3dfe08a66..85eb43b0e 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -402,6 +402,17 @@ int main( int argc, char **argv ) doSetViewer = false; } + const char* p3dDevice = getenv("P3D_DEVICE"); + if (p3dDevice) + { + osg::ref_ptr dev = osgDB::readFile(p3dDevice); + if (dev.valid()) + { + viewer.addDevice(dev.get()); + } + } + + std::string device; while (arguments.read("--device", device)) {