Moved getenv usage across to safer osg::getEnvVar() usage

This commit is contained in:
Robert Osfield
2017-11-01 17:38:33 +00:00
parent 0e7e06349e
commit 338b0e2b7b
6 changed files with 39 additions and 24 deletions

View File

@@ -18,6 +18,7 @@
#include <osg/View>
#include <osg/GLObjects>
#include <osg/ContextData>
#include <osg/EnvVar>
#include <osg/FrameBufferObject>
#include <osg/Program>
@@ -153,10 +154,10 @@ std::string GraphicsContext::ScreenIdentifier::displayName() const
void GraphicsContext::ScreenIdentifier::readDISPLAY()
{
const char* ptr = 0;
if ((ptr=getenv("DISPLAY")) != 0)
std::string str;
if (getEnvVar("DISPLAY", str))
{
setScreenIdentifier(ptr);
setScreenIdentifier(str);
}
}