From 0a94e2af3c29afa6e8d7ae3041bed4f187b3c1ca Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 16 Aug 2010 12:19:06 +1000 Subject: Fix OpenGLVersionFlags on OpenGL 4.0 systems If the OpenGL version was 4.0 or higher, the flags for 1.1, 1.5, 2.0, and so on were not being set. This lead to the flags indicating that older OpenGL versions were not supported when they clearly were. Back port parts of 28659c21d12a267b10e5b441bf4c776e04d69bdc from Qt 4.7 to fix this in Qt 4.6. Task-number: QTBUG-12554 Reviewed-by: Sarah Smith --- dist/changes-4.6.4 | 1 + src/opengl/qgl.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index dbb2189..389aa3a 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -68,6 +68,7 @@ QtOpenGL * [QTBUG-12591] setUniformValue(QSize) was setting (w,w) not (w,h). * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL implementation has the GL_ARB_ES2_compatibility extension. + * [QTBUG-12554] Wrong OpenGLVersionFlags on OpenGL 4.0 systems. QtScript -------- diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0137c85..81e55b3 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1173,8 +1173,16 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co QGLFormat::OpenGL_Version_2_1 | QGLFormat::OpenGL_Version_3_0; } - else - qWarning("Unrecognised OpenGL version"); + else { + versionFlags |= QGLFormat::OpenGL_Version_1_1 | + QGLFormat::OpenGL_Version_1_2 | + QGLFormat::OpenGL_Version_1_3 | + QGLFormat::OpenGL_Version_1_4 | + QGLFormat::OpenGL_Version_1_5 | + QGLFormat::OpenGL_Version_2_0 | + QGLFormat::OpenGL_Version_2_1 | + QGLFormat::OpenGL_Version_3_0; + } } return versionFlags; } -- cgit v0.12