From 18aae36a90c0753f1b1e615ba8437d8ebd1bd2fb Mon Sep 17 00:00:00 2001 From: David Morgan Date: Tue, 23 Sep 2014 16:43:32 +0100 Subject: OpenGL: Add versioned functions support for opengl 4.4 and 4.5 Previous errors in versioned function classes for OpenGL versions prior to 4.4 have also been fixed to comply with the new OpenGL xml specification. Such mistakes were due to either bugs in the old plain text specification files or problems due to the difficulty in parsing the old spec files. In some cases this has meant adding in missing functions that were absent previously. The other class of problem was when functions were erroneously included in the versioned function classes when they should not have been present. That is, some core profile classes incorrectly had member functions for deprecated functions that should only be present in the compatibility profile classes. In these cases these incorrect functions will now trigger a qFatal if called. This is fine as any applications that called these by mistake in the past would have been dereferencing a null pointer as the function pointer resolution would have failed for these functions. [ChangeLog][QtGui] Add version function classes for OpenGL 4.4 and 4.5 and deprecate some erroneously classified functions. Task-Id: QTBUG-33671 Task-Id: QTBUG-44364 Change-Id: I224108dcaf4f8b4933bc121827511841e2a41590 Reviewed-by: Giuseppe D'Angelo --- src/gui/opengl/qopenglversionfunctionsfactory.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/gui/opengl/qopenglversionfunctionsfactory.cpp') diff --git a/src/gui/opengl/qopenglversionfunctionsfactory.cpp b/src/gui/opengl/qopenglversionfunctionsfactory.cpp index 35fe14ca54b..adf7b3be0fa 100644 --- a/src/gui/opengl/qopenglversionfunctionsfactory.cpp +++ b/src/gui/opengl/qopenglversionfunctionsfactory.cpp @@ -43,6 +43,10 @@ #include "qopenglversionfunctionsfactory_p.h" #if !defined(QT_OPENGL_ES_2) +#include "qopenglfunctions_4_5_core.h" +#include "qopenglfunctions_4_5_compatibility.h" +#include "qopenglfunctions_4_4_core.h" +#include "qopenglfunctions_4_4_compatibility.h" #include "qopenglfunctions_4_3_core.h" #include "qopenglfunctions_4_3_compatibility.h" #include "qopenglfunctions_4_2_core.h" @@ -80,7 +84,11 @@ QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVe if (versionProfile.hasProfiles()) { switch (versionProfile.profile()) { case QSurfaceFormat::CoreProfile: - if (major == 4 && minor == 3) + if (major == 4 && minor == 5) + return new QOpenGLFunctions_4_5_Core; + else if (major == 4 && minor == 4) + return new QOpenGLFunctions_4_4_Core; + else if (major == 4 && minor == 3) return new QOpenGLFunctions_4_3_Core; else if (major == 4 && minor == 2) return new QOpenGLFunctions_4_2_Core; @@ -95,7 +103,11 @@ QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVe break; case QSurfaceFormat::CompatibilityProfile: - if (major == 4 && minor == 3) + if (major == 4 && minor == 5) + return new QOpenGLFunctions_4_5_Compatibility; + else if (major == 4 && minor == 4) + return new QOpenGLFunctions_4_4_Compatibility; + else if (major == 4 && minor == 3) return new QOpenGLFunctions_4_3_Compatibility; else if (major == 4 && minor == 2) return new QOpenGLFunctions_4_2_Compatibility; -- cgit v1.2.3