Qt: Don't attempt to create a GL2 context if GL2 is disabled

This commit is contained in:
Vicki Pfau 2021-03-21 16:06:07 -07:00
parent b8b494eea6
commit 425baa1773
1 changed files with 2 additions and 0 deletions

View File

@ -27,6 +27,7 @@ Display* Display::create(QWidget* parent) {
switch (s_driver) {
#if defined(BUILD_GL) || defined(BUILD_GLES2) || defined(USE_EPOXY)
case Driver::OPENGL:
#if defined(BUILD_GLES2) || defined(USE_EPOXY)
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) {
format.setVersion(2, 0);
} else {
@ -47,6 +48,7 @@ Display* Display::create(QWidget* parent) {
}
return new DisplayGL(format, parent);
#endif
#endif
#ifdef BUILD_GL
case Driver::OPENGL1:
format.setVersion(1, 4);