QNX: Create the egl context according to the version in QSurfaceFormat

Change-Id: Iee556d51ad1d7db2593e3996da4d90d938d13e17
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Fabian Bumberger 2014-01-20 19:58:28 +01:00 committed by The Qt Project
parent b8103a4e81
commit a46198a7b3
2 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
}
}
m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, shareContext, contextAttrs());
m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, shareContext, contextAttrs(format));
if (m_eglContext == EGL_NO_CONTEXT) {
checkEGLError("eglCreateContext");
qFatal("QQnxGLContext: failed to create EGL context, err=%d", eglGetError());
@ -274,13 +274,13 @@ EGLDisplay QQnxGLContext::getEglDisplay() {
return ms_eglDisplay;
}
EGLint *QQnxGLContext::contextAttrs()
EGLint *QQnxGLContext::contextAttrs(const QSurfaceFormat &format)
{
qGLContextDebug() << Q_FUNC_INFO;
// Choose EGL settings based on OpenGL version
#if defined(QT_OPENGL_ES_2)
static EGLint attrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
static EGLint attrs[] = { EGL_CONTEXT_CLIENT_VERSION, format.version().first, EGL_NONE };
return attrs;
#else
return 0;

View File

@ -88,7 +88,7 @@ private:
EGLContext m_eglContext;
EGLSurface m_currentEglSurface;
static EGLint *contextAttrs();
static EGLint *contextAttrs(const QSurfaceFormat &format);
};
QT_END_NAMESPACE