Added support for configuration file

- BASE_PATH is set using the openspace.cfg file. The binary will look
upwards in the directory hierarchy until it is found.
- All other paths is defined in the configurationfile. Paths may be
absolute or relative using the ${BASE_PATH} token
- Moved SGCT configuration files to its own folder
- Updated tests to support new configuration loading

- TODO: Make the loading of configuration easier for the programmer.
This commit is contained in:
Jonas Strandstedt
2014-04-04 11:00:25 -04:00
parent a27e9a573a
commit 5963920953
17 changed files with 181 additions and 487 deletions

View File

@@ -45,13 +45,26 @@ void mainEncodeFun();
void mainDecodeFun();
int main(int argc, char **argv) {
int newArgc;
char** newArgv;
openspace::OpenSpaceEngine::create(argc, argv, newArgc, newArgv);
// create the OpenSpace engine and get arguments for the sgct engine
std::vector<std::string> sgctArguments;
openspace::OpenSpaceEngine::create(argc, argv, sgctArguments);
// create sgct engine c arguments
int newArgc = sgctArguments.size();
char** newArgv = new char*[newArgc];
for (int i = 0; i < newArgc; ++i) {
//newArgv[i] = new char[sgctArguments.at(i).length()];
//std::strcpy(newArgv[i], sgctArguments.at(i).c_str());
newArgv[i] = const_cast<char*>(sgctArguments.at(i).c_str());
}
_sgctEngine = new sgct::Engine(newArgc, newArgv);
// deallocate sgct c arguments
for (int i = 0; i < newArgc; ++i) {
//delete newArgv[i];
}
delete[] newArgv;
// Bind functions