From 51c43cb12d0959c0039a5d055523967426ad93ca Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 18 Nov 2004 13:46:13 +0000 Subject: [PATCH] Added a search for the config file, and defaulting to osg.conf --- examples/osglauncher/osglauncher.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/examples/osglauncher/osglauncher.cpp b/examples/osglauncher/osglauncher.cpp index 8ead38b20..152c1306e 100644 --- a/examples/osglauncher/osglauncher.cpp +++ b/examples/osglauncher/osglauncher.cpp @@ -30,6 +30,7 @@ #include #include +#include int runApp(std::string xapp); @@ -220,11 +221,19 @@ int runApp(std::string xapp) void readConfFile(char* confFile) // read confFile 1 { std::cout << "Start reading confFile" << std::endl; + + std::string fileName = osgDB::findDataFile(confFile); + if (fileName.empty()) + { + std::cout << "Config file not found"< confFile" << std::endl; - return 0; + readConfFile("osg.conf"); // read ConfigFile 1 + } + else + { + readConfFile(argv[1]); // read ConfigFile 1 } - readConfFile(argv[1]); // read ConfigFile 1 - // construct the viewer. osgProducer::Viewer viewer;