diff --git a/oscar/SleepLib/common.cpp b/oscar/SleepLib/common.cpp index be4e249f..87f31c15 100644 --- a/oscar/SleepLib/common.cpp +++ b/oscar/SleepLib/common.cpp @@ -122,7 +122,7 @@ QString getOpenGLVersionString() QOpenGLFunctions f; f.initializeOpenGLFunctions(); glversion = QString(QLatin1String(reinterpret_cast(f.glGetString(GL_VERSION)))); - qDebug() << "OpenGL Version:" << glversion; + qDebug() << "Graphics Engine:" << glversion; #endif } return glversion; @@ -163,7 +163,7 @@ QString getGraphicsEngine() gfxEngine = CSTR_GFX_BrokenGL; #else QString glversion = getOpenGLVersionString(); - qDebug() << "Gfx Engine" << glversion; +// qDebug() << "Graphics Engine" << glversion; if (glversion.contains(CSTR_GFX_ANGLE)) { gfxEngine = CSTR_GFX_ANGLE; } else if (glversion.contains("Mesa")) { diff --git a/oscar/main.cpp b/oscar/main.cpp index b6723b28..ccce31a7 100644 --- a/oscar/main.cpp +++ b/oscar/main.cpp @@ -11,6 +11,7 @@ #endif #include +#include #include #include #include @@ -266,18 +267,16 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationDomain(getDeveloperDomain()); QSettings settings; - GFXEngine gfxEngine = (GFXEngine)qMin((unsigned int)settings.value(GFXEngineSetting, (unsigned int)GFX_OpenGL).toUInt(), (unsigned int)MaxGFXEngine); - switch (gfxEngine) { - case 0: - QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); - break; - case 1: - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); - break; - case 2: - default: - QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); + QApplication a(argc, argv); + QStringList args = a.arguments(); + + // If shift key was held down when OSCAR was launched, force Software graphics Engine (aka LegacyGFX) + Qt::KeyboardModifiers keymodifier = QApplication::queryKeyboardModifiers(); + QString forcedEngine = ""; + if (keymodifier == Qt::ShiftModifier){ + settings.setValue(GFXEngineSetting, (unsigned int)GFX_Software); + forcedEngine = "Software Engine forced by shift key at launch"; } QString lastlanguage = settings.value(LangSetting, "").toString(); @@ -287,10 +286,6 @@ int main(int argc, char *argv[]) { bool changing_language = false; QString load_profile = ""; - QApplication a(argc, argv); - QStringList args = a.arguments(); - - if (lastlanguage.isEmpty()) changing_language = true; @@ -302,7 +297,12 @@ int main(int argc, char *argv[]) { else if (args[i] == "--language") { changing_language = true; // reset to force language dialog settings.setValue(LangSetting,""); - } else if (args[i] == "-p") + } + else if (args[i] == "--legacy") { + settings.setValue(GFXEngineSetting, (unsigned int)GFX_Software); + forcedEngine = "Software Engine forced by --legacy command line switch"; + } + else if (args[i] == "-p") QThread::msleep(1000); else if (args[i] == "--profile") { if ((i+1) < args.size()) @@ -325,6 +325,20 @@ int main(int argc, char *argv[]) { } // end of for args loop + GFXEngine gfxEngine = (GFXEngine)qMin((unsigned int)settings.value(GFXEngineSetting, (unsigned int)GFX_OpenGL).toUInt(), (unsigned int)MaxGFXEngine); + + switch (gfxEngine) { + case 0: + QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); + break; + case 1: + QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); + break; + case 2: + default: + QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); + } + initializeLogger(); QThread::msleep(50); // Logger takes a little bit to catch up #ifdef QT_DEBUG @@ -334,6 +348,8 @@ int main(int argc, char *argv[]) { #endif relinfo = "("+QSysInfo::kernelType()+" "+QSysInfo::currentCpuArchitecture()+relinfo+")"; qDebug() << STR_AppName.toLocal8Bit().data() << VersionString.toLocal8Bit().data() << relinfo.toLocal8Bit().data() << "built with Qt" << QT_VERSION_STR << "on" << __DATE__ << __TIME__; + if (forcedEngine != "") + qDebug() << forcedEngine; //////////////////////////////////////////////////////////////////////////////////////////// // Language Selection