Commit a2cc7ba5 authored by Martin Schultz's avatar Martin Schultz

changed options and settings for opengl profile and version selection,

so they are not always overwritten
parent 7580642d
...@@ -358,7 +358,6 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, QString *err ...@@ -358,7 +358,6 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, QString *err
parser.addOption(samplesOption); parser.addOption(samplesOption);
QCommandLineOption profileOption("profile",QCoreApplication::translate("main","Request OpenGL context profile <profile> with profile set as compat or core"),QCoreApplication::translate("main","< compat | core >")); QCommandLineOption profileOption("profile",QCoreApplication::translate("main","Request OpenGL context profile <profile> with profile set as compat or core"),QCoreApplication::translate("main","< compat | core >"));
profileOption.setDefaultValue("compat");
parser.addOption(profileOption); parser.addOption(profileOption);
const QCommandLineOption helpOption = parser.addHelpOption(); const QCommandLineOption helpOption = parser.addHelpOption();
const QCommandLineOption versionOption = parser.addVersionOption(); const QCommandLineOption versionOption = parser.addVersionOption();
......
...@@ -410,7 +410,12 @@ QPair<int,int> glVersion(){ ...@@ -410,7 +410,12 @@ QPair<int,int> glVersion(){
if(versionOverride_) if(versionOverride_)
return version_; return version_;
else else
return OpenFlipperSettings().value("Core/OpenGL/Version",QVariant::fromValue(QPair<int,int>(4,6))).value<QPair<int,int>>(); {
// unfortunately QVariant cant store QPair directly, we could try std::pair but its good for now
int major = OpenFlipperSettings().value("Core/OpenGL/VersionMajor", 4).value<int>();
int minor = OpenFlipperSettings().value("Core/OpenGL/VersionMinor", 6).value<int>();
return QPair<int, int>(major,minor);
}
} }
/// Store opengl version setting /// Store opengl version setting
...@@ -423,7 +428,10 @@ void glVersion(const QPair<int,int> & _version, bool _temporary) ...@@ -423,7 +428,10 @@ void glVersion(const QPair<int,int> & _version, bool _temporary)
versionOverride_ = true; versionOverride_ = true;
} }
else else
OpenFlipperSettings().setValue("Core/OpenGL/Version",QVariant::fromValue(_version)); {
OpenFlipperSettings().setValue("Core/OpenGL/VersionMajor",_version.first);
OpenFlipperSettings().setValue("Core/OpenGL/VersionMinor",_version.second);
}
} }
/// Store opengl MSAA sample count /// Store opengl MSAA sample count
void samples(int _samples, bool _temporary) { void samples(int _samples, bool _temporary) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment