Replace commandline argument with automatically detecting the supported OpenGL version

This commit is contained in:
Alexander Bock
2015-05-28 20:33:22 +02:00
parent 2d145faced
commit fc3faab5f1
3 changed files with 31 additions and 30 deletions

View File

@@ -96,7 +96,6 @@ namespace {
struct {
std::string configurationName;
std::string sgctConfigurationName;
std::string openGlVersion;
} commandlineArgumentPlaceholders;
}
@@ -148,8 +147,7 @@ OpenSpaceEngine& OpenSpaceEngine::ref() {
bool OpenSpaceEngine::create(
int argc, char** argv,
std::vector<std::string>& sgctArguments,
std::string& openGlVersion)
std::vector<std::string>& sgctArguments)
{
ghoul::initialize();
@@ -260,10 +258,6 @@ bool OpenSpaceEngine::create(
sgctConfigurationPath = commandlineArgumentPlaceholders.sgctConfigurationName;
}
openGlVersion = commandlineArgumentPlaceholders.openGlVersion;
if (openGlVersion != DefaultOpenGlVersion)
LINFO("Using OpenGL version " << openGlVersion);
// Prepend the outgoing sgctArguments with the program name
// as well as the configuration file that sgct is supposed to use
sgctArguments.insert(sgctArguments.begin(), argv[0]);
@@ -401,13 +395,6 @@ bool OpenSpaceEngine::gatherCommandlineArguments() {
"the OpenSpace configuration file");
_commandlineParser->addCommand(sgctConfigFileCommand);
commandlineArgumentPlaceholders.openGlVersion = DefaultOpenGlVersion;
CommandlineCommand* openGlVersionCommand = new SingleCommand<std::string>(
&commandlineArgumentPlaceholders.openGlVersion,
"-ogl", "-o",
"Sets the OpenGL version that is to be used; valid values are '4.2' and '4.3'");
_commandlineParser->addCommand(openGlVersionCommand);
return true;
}