mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-23 12:40:01 -06:00
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:
19
src/main.cpp
19
src/main.cpp
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user