diff --git a/deploy/qgroundcontrol_installer.nsi b/deploy/qgroundcontrol_installer.nsi index 1b7a971727b496523b5da7a3a066471d1d22032b..1b1f1fcde08bf611179a8e8b96e28b48111a0d34 100644 --- a/deploy/qgroundcontrol_installer.nsi +++ b/deploy/qgroundcontrol_installer.nsi @@ -70,6 +70,8 @@ Section "create Start Menu Shortcuts" SetShellVarContext all CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl.lnk" "$INSTDIR\qgroundcontrol.exe" "" "$INSTDIR\qgroundcontrol.exe" 0 + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Compatibility Mode).lnk" "$INSTDIR\qgroundcontrol.exe" "-angle" "$INSTDIR\qgroundcontrol.exe" 0 + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Safe Mode).lnk" "$INSTDIR\qgroundcontrol.exe" "-swrast" "$INSTDIR\qgroundcontrol.exe" 0 SectionEnd Function .onInit diff --git a/src/main.cc b/src/main.cc index 3839800e7be1fb9d9fec07ff49ecae3355d40fc3..22fdf1b1a5affa6686b690e478e70c85e3f6e6ad 100644 --- a/src/main.cc +++ b/src/main.cc @@ -139,9 +139,17 @@ int main(int argc, char *argv[]) #endif #endif - // install the message handler #ifdef Q_OS_WIN + // install the message handler qInstallMessageHandler(msgHandler); + + // Set our own OpenGL buglist + qputenv("QT_OPENGL_BUGLIST", ":/opengl/resources/opengl/buglist.json"); + if (QCoreApplication::arguments().contains(QStringLiteral("-angle"))) { + QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); + } else if (QCoreApplication::arguments().contains(QStringLiteral("-swrast"))) { + QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); + } #endif // The following calls to qRegisterMetaType are done to silence debug output which warns @@ -204,9 +212,6 @@ int main(int argc, char *argv[]) DWORD dwMode = SetErrorMode(SEM_NOGPFAULTERRORBOX); SetErrorMode(dwMode | SEM_NOGPFAULTERRORBOX); } - - // Set our own OpenGL buglist - qputenv("QT_OPENGL_BUGLIST", ":/opengl/resources/opengl/buglist.json"); #endif #endif // QT_DEBUG