Add support for OpenGL software rendering.

In some systems, the default Qt hardware renderer is buggy. There's a Qt
option for forcing software rendering. This commit adds support for a
new environment variable, ANKI_SOFTWAREOPENGL, that, when set, will
prompt Anki to force software OpenGL in Qt.
This commit is contained in:
Mike Hordecki 2019-08-16 22:35:39 +02:00
parent c4eca03dd8
commit 8617ec7250

View file

@ -309,6 +309,10 @@ def _run(argv=None, exec=True):
if not os.environ.get("ANKI_NOHIGHDPI"):
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
# Opt into software rendering. Useful for buggy systems.
if os.environ.get("ANKI_SOFTWAREOPENGL"):
QCoreApplication.setAttribute(Qt.AA_UseSoftwareOpenGL)
# create the app
QCoreApplication.setApplicationName("Anki")
QGuiApplication.setDesktopFileName("anki.desktop")