From 77fc6d30f1bd4bdd8894dd98e12373211241a091 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 19 Sep 2012 14:09:16 +0100 Subject: OpenGL: Make use of the requested version and profile in QGLWidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When instatiating a QGLWidget in Qt5 at present it ignores the version and profile information in the QGLFormat meaning that we always end up with an OpenGL 2.x profile rather than what we asked for. This commit properly takes the version and profile into account. Change-Id: I097f10e397c23f5d97c5fcd8d5354667da286896 Reviewed-by: Samuel Rødal --- src/opengl/qgl_qpa.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/opengl/qgl_qpa.cpp') diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 8a07b6a5ad..556463be8d 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -104,6 +104,9 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format) if (format.stencil()) retFormat.setStencilBufferSize(format.stencilBufferSize() == -1 ? 1 : format.stencilBufferSize()); retFormat.setStereo(format.stereo()); + retFormat.setMajorVersion(format.majorVersion()); + retFormat.setMinorVersion(format.minorVersion()); + retFormat.setProfile(static_cast(format.profile())); return retFormat; } -- cgit v1.2.3