summaryrefslogtreecommitdiff
path: root/src/opengl/qgl_qpa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qgl_qpa.cpp')
-rw-r--r--src/opengl/qgl_qpa.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 8b66c891bb..4f4df8d2e4 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -321,21 +321,23 @@ QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *)
d->context = new QOpenGLContext;
#if !defined(QT_OPENGL_ES)
- // On desktop, request latest released version
- QSurfaceFormat format;
+ if (!QOpenGLFunctions::isES()) {
+ // On desktop, request latest released version
+ QSurfaceFormat format;
#if defined(Q_OS_MAC)
- // OS X is limited to OpenGL 3.2 Core Profile at present
- // so set that here. If we use compatibility profile it
- // only reports 2.x contexts.
- format.setMajorVersion(3);
- format.setMinorVersion(2);
- format.setProfile(QSurfaceFormat::CoreProfile);
+ // OS X is limited to OpenGL 3.2 Core Profile at present
+ // so set that here. If we use compatibility profile it
+ // only reports 2.x contexts.
+ format.setMajorVersion(3);
+ format.setMinorVersion(2);
+ format.setProfile(QSurfaceFormat::CoreProfile);
#else
- format.setMajorVersion(4);
- format.setMinorVersion(3);
-#endif
- d->context->setFormat(format);
+ format.setMajorVersion(4);
+ format.setMinorVersion(3);
#endif
+ d->context->setFormat(format);
+ }
+#endif // QT_OPENGL_ES
d->context->create();
d->context->makeCurrent(d->window);
}