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;