From 73f3f501f331444b3f188b21db7265f723e4f383 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 22 Jan 2020 17:01:30 +0100 Subject: [PATCH] Move versioned OpenGL functions from QtGui to QtOpenGL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The context—which lives in QtGui—now knows nothing about versioned functions. This changes the public API for getting version functions for a context. [ChangeLog][QtGui][OpenGL] QOpenGLContext::versionFunctions() has been removed. QOpenGLVersionFunctionsFactory::get() from the QtOpenGL module should be used instead. Previously one would call context->versionFunctions(); Which now becomes QOpenGLVersionFunctionsFactory::get(context); The rest of the API should be identical. Since glgen no longer compiles, and the links to its input (gl.spec and gl.tm) are dead, I've edited the previously generated files manually. If glgen is fixed, it should be quite easy to make it generate the new way. Task-number: QTBUG-74409 Change-Id: I800527e0af16a79005b276eeb74417770193c62f Reviewed-by: Qt CI Bot Reviewed-by: Laszlo Agocs --- src/gui/.prev_CMakeLists.txt | 44 +---- src/gui/CMakeLists.txt | 44 +---- src/gui/doc/src/dontdocument.qdoc | 30 ---- src/gui/kernel/qopenglcontext.cpp | 151 ------------------ src/gui/kernel/qopenglcontext.h | 16 -- src/gui/kernel/qopenglcontext_p.h | 4 - src/gui/opengl/opengl.pri | 69 -------- src/opengl/.prev_CMakeLists.txt | 44 ++++- src/opengl/CMakeLists.txt | 34 ++++ src/opengl/doc/src/dontdocument.qdoc | 59 +++++++ src/opengl/opengl.pro | 67 +++++++- src/{gui => }/opengl/qopenglfunctions_1_0.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_1_0.h | 11 +- src/{gui => }/opengl/qopenglfunctions_1_1.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_1_1.h | 11 +- src/{gui => }/opengl/qopenglfunctions_1_2.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_1_2.h | 12 +- src/{gui => }/opengl/qopenglfunctions_1_3.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_1_3.h | 11 +- src/{gui => }/opengl/qopenglfunctions_1_4.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_1_4.h | 11 +- src/{gui => }/opengl/qopenglfunctions_1_5.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_1_5.h | 11 +- src/{gui => }/opengl/qopenglfunctions_2_0.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_2_0.h | 11 +- src/{gui => }/opengl/qopenglfunctions_2_1.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_2_1.h | 11 +- src/{gui => }/opengl/qopenglfunctions_3_0.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_3_0.h | 11 +- src/{gui => }/opengl/qopenglfunctions_3_1.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_3_1.h | 11 +- .../qopenglfunctions_3_2_compatibility.cpp | 4 +- .../qopenglfunctions_3_2_compatibility.h | 11 +- .../opengl/qopenglfunctions_3_2_core.cpp | 4 +- .../opengl/qopenglfunctions_3_2_core.h | 11 +- .../qopenglfunctions_3_3_compatibility.cpp | 4 +- .../qopenglfunctions_3_3_compatibility.h | 11 +- .../opengl/qopenglfunctions_3_3_core.cpp | 4 +- .../opengl/qopenglfunctions_3_3_core.h | 11 +- .../qopenglfunctions_4_0_compatibility.cpp | 4 +- .../qopenglfunctions_4_0_compatibility.h | 11 +- .../opengl/qopenglfunctions_4_0_core.cpp | 4 +- .../opengl/qopenglfunctions_4_0_core.h | 11 +- .../qopenglfunctions_4_1_compatibility.cpp | 4 +- .../qopenglfunctions_4_1_compatibility.h | 11 +- .../opengl/qopenglfunctions_4_1_core.cpp | 4 +- .../opengl/qopenglfunctions_4_1_core.h | 11 +- .../qopenglfunctions_4_2_compatibility.cpp | 4 +- .../qopenglfunctions_4_2_compatibility.h | 11 +- .../opengl/qopenglfunctions_4_2_core.cpp | 4 +- .../opengl/qopenglfunctions_4_2_core.h | 11 +- .../qopenglfunctions_4_3_compatibility.cpp | 4 +- .../qopenglfunctions_4_3_compatibility.h | 11 +- .../opengl/qopenglfunctions_4_3_core.cpp | 4 +- .../opengl/qopenglfunctions_4_3_core.h | 11 +- .../qopenglfunctions_4_4_compatibility.cpp | 4 +- .../qopenglfunctions_4_4_compatibility.h | 11 +- .../opengl/qopenglfunctions_4_4_core.cpp | 4 +- .../opengl/qopenglfunctions_4_4_core.h | 11 +- .../qopenglfunctions_4_5_compatibility.cpp | 4 +- .../qopenglfunctions_4_5_compatibility.h | 11 +- .../opengl/qopenglfunctions_4_5_core.cpp | 4 +- .../opengl/qopenglfunctions_4_5_core.h | 11 +- src/{gui => }/opengl/qopenglfunctions_es2.cpp | 4 +- src/{gui => }/opengl/qopenglfunctions_es2.h | 9 +- src/opengl/qopenglshaderprogram.cpp | 5 +- .../opengl/qopenglversionfunctions.cpp | 40 ++++- .../opengl/qopenglversionfunctions.h | 8 +- .../qopenglversionfunctions_p.h} | 28 ++-- .../opengl/qopenglversionfunctionsfactory.cpp | 123 +++++++++++++- src/opengl/qopenglversionfunctionsfactory.h | 74 +++++++++ .../opengl/qopenglversionprofile.cpp | 4 +- src/{gui => }/opengl/qopenglversionprofile.h | 12 +- src/opengl/qopenglvertexarrayobject.cpp | 9 +- src/opengl/qtopenglglobal.h | 1 + tests/auto/gui/qopengl/tst_qopengl.cpp | 5 +- 76 files changed, 683 insertions(+), 592 deletions(-) create mode 100644 src/opengl/doc/src/dontdocument.qdoc rename src/{gui => }/opengl/qopenglfunctions_1_0.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_1_0.h (99%) rename src/{gui => }/opengl/qopenglfunctions_1_1.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_1_1.h (99%) rename src/{gui => }/opengl/qopenglfunctions_1_2.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_1_2.h (99%) rename src/{gui => }/opengl/qopenglfunctions_1_3.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_1_3.h (99%) rename src/{gui => }/opengl/qopenglfunctions_1_4.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_1_4.h (99%) rename src/{gui => }/opengl/qopenglfunctions_1_5.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_1_5.h (99%) rename src/{gui => }/opengl/qopenglfunctions_2_0.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_2_0.h (99%) rename src/{gui => }/opengl/qopenglfunctions_2_1.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_2_1.h (99%) rename src/{gui => }/opengl/qopenglfunctions_3_0.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_3_0.h (99%) rename src/{gui => }/opengl/qopenglfunctions_3_1.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_3_1.h (99%) rename src/{gui => }/opengl/qopenglfunctions_3_2_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_3_2_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_3_2_core.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_3_2_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_3_3_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_3_3_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_3_3_core.cpp (98%) rename src/{gui => }/opengl/qopenglfunctions_3_3_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_0_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_0_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_0_core.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_0_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_1_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_1_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_1_core.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_1_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_2_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_2_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_2_core.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_2_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_3_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_3_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_3_core.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_3_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_4_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_4_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_4_core.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_4_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_5_compatibility.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_5_compatibility.h (99%) rename src/{gui => }/opengl/qopenglfunctions_4_5_core.cpp (99%) rename src/{gui => }/opengl/qopenglfunctions_4_5_core.h (99%) rename src/{gui => }/opengl/qopenglfunctions_es2.cpp (97%) rename src/{gui => }/opengl/qopenglfunctions_es2.h (99%) rename src/{gui => }/opengl/qopenglversionfunctions.cpp (90%) rename src/{gui => }/opengl/qopenglversionfunctions.h (99%) rename src/{gui/opengl/qopenglversionfunctionsfactory_p.h => opengl/qopenglversionfunctions_p.h} (77%) rename src/{gui => }/opengl/qopenglversionfunctionsfactory.cpp (55%) create mode 100644 src/opengl/qopenglversionfunctionsfactory.h rename src/{gui => }/opengl/qopenglversionprofile.cpp (98%) rename src/{gui => }/opengl/qopenglversionprofile.h (93%) diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt index 7754f19d49..d1464e2966 100644 --- a/src/gui/.prev_CMakeLists.txt +++ b/src/gui/.prev_CMakeLists.txt @@ -260,9 +260,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_opengl opengl/qopenglextrafunctions.h opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h - opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h - opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h - opengl/qopenglversionprofile.cpp opengl/qopenglversionprofile.h rhi/qrhigles2.cpp rhi/qrhigles2_p.h rhi/qrhigles2_p_p.h ) @@ -569,41 +566,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_undogroup util/qundogroup.cpp util/qundogroup.h ) -qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 - SOURCES - opengl/qopenglfunctions_1_0.cpp opengl/qopenglfunctions_1_0.h - opengl/qopenglfunctions_1_1.cpp opengl/qopenglfunctions_1_1.h - opengl/qopenglfunctions_1_2.cpp opengl/qopenglfunctions_1_2.h - opengl/qopenglfunctions_1_3.cpp opengl/qopenglfunctions_1_3.h - opengl/qopenglfunctions_1_4.cpp opengl/qopenglfunctions_1_4.h - opengl/qopenglfunctions_1_5.cpp opengl/qopenglfunctions_1_5.h - opengl/qopenglfunctions_2_0.cpp opengl/qopenglfunctions_2_0.h - opengl/qopenglfunctions_2_1.cpp opengl/qopenglfunctions_2_1.h - opengl/qopenglfunctions_3_0.cpp opengl/qopenglfunctions_3_0.h - opengl/qopenglfunctions_3_1.cpp opengl/qopenglfunctions_3_1.h - opengl/qopenglfunctions_3_2_compatibility.cpp opengl/qopenglfunctions_3_2_compatibility.h - opengl/qopenglfunctions_3_2_core.cpp opengl/qopenglfunctions_3_2_core.h - opengl/qopenglfunctions_3_3_compatibility.cpp opengl/qopenglfunctions_3_3_compatibility.h - opengl/qopenglfunctions_3_3_core.cpp opengl/qopenglfunctions_3_3_core.h - opengl/qopenglfunctions_4_0_compatibility.cpp opengl/qopenglfunctions_4_0_compatibility.h - opengl/qopenglfunctions_4_0_core.cpp opengl/qopenglfunctions_4_0_core.h - opengl/qopenglfunctions_4_1_compatibility.cpp opengl/qopenglfunctions_4_1_compatibility.h - opengl/qopenglfunctions_4_1_core.cpp opengl/qopenglfunctions_4_1_core.h - opengl/qopenglfunctions_4_2_compatibility.cpp opengl/qopenglfunctions_4_2_compatibility.h - opengl/qopenglfunctions_4_2_core.cpp opengl/qopenglfunctions_4_2_core.h - opengl/qopenglfunctions_4_3_compatibility.cpp opengl/qopenglfunctions_4_3_compatibility.h - opengl/qopenglfunctions_4_3_core.cpp opengl/qopenglfunctions_4_3_core.h - opengl/qopenglfunctions_4_4_compatibility.cpp opengl/qopenglfunctions_4_4_compatibility.h - opengl/qopenglfunctions_4_4_core.cpp opengl/qopenglfunctions_4_4_core.h - opengl/qopenglfunctions_4_5_compatibility.cpp opengl/qopenglfunctions_4_5_compatibility.h - opengl/qopenglfunctions_4_5_core.cpp opengl/qopenglfunctions_4_5_core.h -) - -qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2 - SOURCES - opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h -) - qt_extend_target(Gui CONDITION QT_FEATURE_vulkan SOURCES rhi/qrhivulkan.cpp rhi/qrhivulkan_p.h @@ -616,7 +578,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan Vulkan::Vulkan_nolink ) -#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: +#### Keys ignored in scope 82:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: # QMAKE_EXTRA_COMPILERS = "qvkgen_h" "qvkgen_ph" "qvkgen_pimpl" # QMAKE_QVKGEN_INPUT = "vulkan/vk.xml" # QMAKE_QVKGEN_LICENSE_HEADER = "$$QT_SOURCE_TREE/header.LGPL" @@ -632,10 +594,10 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan # qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT" # qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp" -#### Keys ignored in scope 85:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: +#### Keys ignored in scope 83:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: # qvkgen_h.variable_out = "HEADERS" -#### Keys ignored in scope 86:.:vulkan:vulkan/vulkan.pri:else: +#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:else: # qvkgen_h.CONFIG = "target_predeps" "no_link" qt_extend_target(Gui CONDITION WASM diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index eaf24bc658..1d67aa5bc0 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -353,9 +353,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_opengl opengl/qopenglextrafunctions.h opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h - opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h - opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h - opengl/qopenglversionprofile.cpp opengl/qopenglversionprofile.h rhi/qrhigles2.cpp rhi/qrhigles2_p.h rhi/qrhigles2_p_p.h ) @@ -681,41 +678,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_undogroup util/qundogroup.cpp util/qundogroup.h ) -qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 - SOURCES - opengl/qopenglfunctions_1_0.cpp opengl/qopenglfunctions_1_0.h - opengl/qopenglfunctions_1_1.cpp opengl/qopenglfunctions_1_1.h - opengl/qopenglfunctions_1_2.cpp opengl/qopenglfunctions_1_2.h - opengl/qopenglfunctions_1_3.cpp opengl/qopenglfunctions_1_3.h - opengl/qopenglfunctions_1_4.cpp opengl/qopenglfunctions_1_4.h - opengl/qopenglfunctions_1_5.cpp opengl/qopenglfunctions_1_5.h - opengl/qopenglfunctions_2_0.cpp opengl/qopenglfunctions_2_0.h - opengl/qopenglfunctions_2_1.cpp opengl/qopenglfunctions_2_1.h - opengl/qopenglfunctions_3_0.cpp opengl/qopenglfunctions_3_0.h - opengl/qopenglfunctions_3_1.cpp opengl/qopenglfunctions_3_1.h - opengl/qopenglfunctions_3_2_compatibility.cpp opengl/qopenglfunctions_3_2_compatibility.h - opengl/qopenglfunctions_3_2_core.cpp opengl/qopenglfunctions_3_2_core.h - opengl/qopenglfunctions_3_3_compatibility.cpp opengl/qopenglfunctions_3_3_compatibility.h - opengl/qopenglfunctions_3_3_core.cpp opengl/qopenglfunctions_3_3_core.h - opengl/qopenglfunctions_4_0_compatibility.cpp opengl/qopenglfunctions_4_0_compatibility.h - opengl/qopenglfunctions_4_0_core.cpp opengl/qopenglfunctions_4_0_core.h - opengl/qopenglfunctions_4_1_compatibility.cpp opengl/qopenglfunctions_4_1_compatibility.h - opengl/qopenglfunctions_4_1_core.cpp opengl/qopenglfunctions_4_1_core.h - opengl/qopenglfunctions_4_2_compatibility.cpp opengl/qopenglfunctions_4_2_compatibility.h - opengl/qopenglfunctions_4_2_core.cpp opengl/qopenglfunctions_4_2_core.h - opengl/qopenglfunctions_4_3_compatibility.cpp opengl/qopenglfunctions_4_3_compatibility.h - opengl/qopenglfunctions_4_3_core.cpp opengl/qopenglfunctions_4_3_core.h - opengl/qopenglfunctions_4_4_compatibility.cpp opengl/qopenglfunctions_4_4_compatibility.h - opengl/qopenglfunctions_4_4_core.cpp opengl/qopenglfunctions_4_4_core.h - opengl/qopenglfunctions_4_5_compatibility.cpp opengl/qopenglfunctions_4_5_compatibility.h - opengl/qopenglfunctions_4_5_core.cpp opengl/qopenglfunctions_4_5_core.h -) - -qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2 - SOURCES - opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h -) - qt_extend_target(Gui CONDITION QT_FEATURE_vulkan SOURCES rhi/qrhivulkan.cpp rhi/qrhivulkan_p.h @@ -728,7 +690,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan Vulkan::Vulkan_nolink ) -#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: +#### Keys ignored in scope 82:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: # special case begin # We must always generate syncqt-injected header files, # because we added a custom command earlier for those for framework builds. @@ -784,10 +746,10 @@ add_custom_command( # qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT" # qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp" -#### Keys ignored in scope 85:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: +#### Keys ignored in scope 83:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: # qvkgen_h.variable_out = "HEADERS" -#### Keys ignored in scope 86:.:vulkan:vulkan/vulkan.pri:else: +#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:else: # qvkgen_h.CONFIG = "target_predeps" "no_link" qt_extend_target(Gui CONDITION WASM diff --git a/src/gui/doc/src/dontdocument.qdoc b/src/gui/doc/src/dontdocument.qdoc index 6b50daba88..6711644359 100644 --- a/src/gui/doc/src/dontdocument.qdoc +++ b/src/gui/doc/src/dontdocument.qdoc @@ -28,36 +28,6 @@ /*! \dontdocument (QTypeInfo QScreenOrientationChangeEvent QApplicationStateChangeEvent QMetaTypeId QAbstractUndoItem - QOpenGLVersionStatus - QOpenGLVersionFunctionsBackend - QOpenGLVersionFunctionsStorage - QOpenGLFunctions_1_0_CoreBackend - QOpenGLFunctions_1_1_CoreBackend - QOpenGLFunctions_1_2_CoreBackend - QOpenGLFunctions_1_3_CoreBackend - QOpenGLFunctions_1_4_CoreBackend - QOpenGLFunctions_1_5_CoreBackend - QOpenGLFunctions_2_0_CoreBackend - QOpenGLFunctions_2_1_CoreBackend - QOpenGLFunctions_3_0_CoreBackend - QOpenGLFunctions_3_1_CoreBackend - QOpenGLFunctions_3_2_CoreBackend - QOpenGLFunctions_3_3_CoreBackend - QOpenGLFunctions_4_0_CoreBackend - QOpenGLFunctions_4_1_CoreBackend - QOpenGLFunctions_4_2_CoreBackend - QOpenGLFunctions_4_3_CoreBackend - QOpenGLFunctions_4_4_CoreBackend - QOpenGLFunctions_4_5_CoreBackend - QOpenGLFunctions_1_0_DeprecatedBackend - QOpenGLFunctions_1_1_DeprecatedBackend - QOpenGLFunctions_1_2_DeprecatedBackend - QOpenGLFunctions_1_3_DeprecatedBackend - QOpenGLFunctions_1_4_DeprecatedBackend - QOpenGLFunctions_2_0_DeprecatedBackend - QOpenGLFunctions_3_0_DeprecatedBackend - QOpenGLFunctions_3_3_DeprecatedBackend - QOpenGLFunctions_4_5_DeprecatedBackend QTextFrameLayoutData QPlatformDropQtResponse QPlatformDragQtResponse QPlatformOffscreenSurface QColorDialogOptions QFontDialogOptions QFileDialogOptions QMessageDialogOptions QMessageDialogOptions::CustomButton diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index b0474ceb3d..a004d9e10d 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -54,15 +54,9 @@ #include #include -#include #include -#ifndef QT_OPENGL_ES_2 -#include -#include -#endif - QT_BEGIN_NAMESPACE class QGuiGLThreadContext @@ -484,15 +478,6 @@ void QOpenGLContext::destroy() delete d->functions; d->functions = nullptr; - for (QAbstractOpenGLFunctions *func : qAsConst(d->externalVersionFunctions)) { - QAbstractOpenGLFunctionsPrivate *func_d = QAbstractOpenGLFunctionsPrivate::get(func); - func_d->owningContext = nullptr; - func_d->initialized = false; - } - d->externalVersionFunctions.clear(); - qDeleteAll(d->versionFunctions); - d->versionFunctions.clear(); - if (d->textureFunctionsDestroyCallback) { d->textureFunctionsDestroyCallback(); d->textureFunctionsDestroyCallback = nullptr; @@ -588,115 +573,6 @@ QOpenGLExtraFunctions *QOpenGLContext::extraFunctions() const return static_cast(functions()); } -/*! - \fn T *QOpenGLContext::versionFunctions() const - - \overload versionFunctions() - - Returns a pointer to an object that provides access to all functions for - the version and profile of this context. There is no need to call - QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as this context - is current. It is also possible to call this function when the context is not - current, but in that case it is the caller's responsibility to ensure proper - initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() - afterwards. - - Usually one would use the template version of this function to automatically - have the result cast to the correct type. - - \code - QOpenGLFunctions_3_3_Core* funcs = 0; - funcs = context->versionFunctions(); - if (!funcs) { - qWarning() << "Could not obtain required OpenGL context version"; - exit(1); - } - \endcode - - It is possible to request a functions object for a different version and profile - than that for which the context was created. To do this either use the template - version of this function specifying the desired functions object type as the - template parameter or by passing in a QOpenGLVersionProfile object as an argument - to the non-template function. - - Note that requests for function objects of other versions or profiles can fail and - in doing so will return \nullptr. Situations in which creation of the functions - object can fail are if the request cannot be satisfied due to asking for functions - that are not in the version or profile of this context. For example: - - \list - \li Requesting a 3.3 core profile functions object would succeed. - \li Requesting a 3.3 compatibility profile functions object would fail. We would fail - to resolve the deprecated functions. - \li Requesting a 4.3 core profile functions object would fail. We would fail to resolve - the new core functions introduced in versions 4.0-4.3. - \li Requesting a 3.1 functions object would succeed. There is nothing in 3.1 that is not - also in 3.3 core. - \endlist - - Note that if creating a functions object via this method that the QOpenGLContext - retains ownership of the object. This is to allow the object to be cached and shared. -*/ - -/*! - Returns a pointer to an object that provides access to all functions for the - \a versionProfile of this context. There is no need to call - QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as this context - is current. It is also possible to call this function when the context is not - current, but in that case it is the caller's responsibility to ensure proper - initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() - afterwards. - - Usually one would use the template version of this function to automatically - have the result cast to the correct type. -*/ -QAbstractOpenGLFunctions *QOpenGLContext::versionFunctions(const QOpenGLVersionProfile &versionProfile) const -{ -#ifndef QT_OPENGL_ES_2 - if (isOpenGLES()) { - qWarning("versionFunctions: Not supported on OpenGL ES"); - return nullptr; - } -#endif // QT_OPENGL_ES_2 - - Q_D(const QOpenGLContext); - const QSurfaceFormat f = format(); - - // Ensure we have a valid version and profile. Default to context's if none specified - QOpenGLVersionProfile vp = versionProfile; - if (!vp.isValid()) - vp = QOpenGLVersionProfile(f); - - // Check that context is compatible with requested version - const QPair v = qMakePair(f.majorVersion(), f.minorVersion()); - if (v < vp.version()) - return nullptr; - - // If this context only offers core profile functions then we can't create - // function objects for legacy or compatibility profile requests - if (((vp.hasProfiles() && vp.profile() != QSurfaceFormat::CoreProfile) || vp.isLegacyVersion()) - && f.profile() == QSurfaceFormat::CoreProfile) - return nullptr; - - // Create object if suitable one not cached - QAbstractOpenGLFunctions* funcs = nullptr; - auto it = d->versionFunctions.constFind(vp); - if (it == d->versionFunctions.constEnd()) { - funcs = QOpenGLVersionFunctionsFactory::create(vp); - if (funcs) { - funcs->setOwningContext(this); - d->versionFunctions.insert(vp, funcs); - } - } else { - funcs = it.value(); - } - - if (funcs && QOpenGLContext::currentContext() == this) - funcs->initializeOpenGLFunctions(); - - return funcs; -} - /*! Returns the set of OpenGL extensions supported by this context. @@ -1143,33 +1019,6 @@ QOpenGLContext *QOpenGLContext::globalShareContext() return qt_gl_global_share_context(); } -/*! - \internal -*/ -QOpenGLVersionFunctionsStorage *QOpenGLContext::functionsBackendStorage() const -{ - Q_D(const QOpenGLContext); - return &d->versionFunctionsStorage; -} - -/*! - \internal - */ -void QOpenGLContext::insertExternalFunctions(QAbstractOpenGLFunctions *f) -{ - Q_D(QOpenGLContext); - d->externalVersionFunctions.insert(f); -} - -/*! - \internal - */ -void QOpenGLContext::removeExternalFunctions(QAbstractOpenGLFunctions *f) -{ - Q_D(QOpenGLContext); - d->externalVersionFunctions.remove(f); -} - /*! \internal */ diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index b26a3e2ede..a0d8a3edba 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -58,9 +58,6 @@ #endif #include -#include -// TODO: ideally get rid of this include -#include #include @@ -141,15 +138,6 @@ public: QOpenGLFunctions *functions() const; QOpenGLExtraFunctions *extraFunctions() const; - QAbstractOpenGLFunctions *versionFunctions(const QOpenGLVersionProfile &versionProfile = QOpenGLVersionProfile()) const; - - template - TYPE *versionFunctions() const - { - QOpenGLVersionProfile v = TYPE::versionProfile(); - return static_cast(versionFunctions(v)); - } - QSet extensions() const; bool hasExtension(const QByteArray &extension) const; @@ -185,10 +173,6 @@ private: friend class QAbstractOpenGLFunctionsPrivate; friend class QOpenGLTexturePrivate; - QOpenGLVersionFunctionsStorage* functionsBackendStorage() const; - void insertExternalFunctions(QAbstractOpenGLFunctions *f); - void removeExternalFunctions(QAbstractOpenGLFunctions *f); - QOpenGLTextureHelper* textureFunctions() const; void setTextureFunctions(QOpenGLTextureHelper* textureFuncs, std::function destroyCallback); diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index d769f03fd3..c017bf9a34 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -222,10 +222,6 @@ public: //QWidgetPrivate::deleteTLSysExtra() } - mutable QHash versionFunctions; - mutable QOpenGLVersionFunctionsStorage versionFunctionsStorage; - mutable QSet externalVersionFunctions; - QSurfaceFormat requestedFormat; QPlatformOpenGLContext *platformGLContext; QOpenGLContext *shareContext; diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri index 2ca3809b4b..85fdb609cd 100644 --- a/src/gui/opengl/opengl.pri +++ b/src/gui/opengl/opengl.pri @@ -4,83 +4,14 @@ qtConfig(opengl): CONFIG += opengl qtConfig(opengles2): CONFIG += opengles2 qtConfig(opengl) { - HEADERS += opengl/qopengl.h \ opengl/qopengl_p.h \ opengl/qopenglfunctions.h \ opengl/qopenglextensions_p.h \ - opengl/qopenglversionfunctions.h \ - opengl/qopenglversionfunctionsfactory_p.h \ - opengl/qopenglversionprofile.h \ opengl/qopenglextrafunctions.h \ opengl/qopenglprogrambinarycache_p.h SOURCES += opengl/qopengl.cpp \ opengl/qopenglfunctions.cpp \ - opengl/qopenglversionfunctions.cpp \ - opengl/qopenglversionfunctionsfactory.cpp \ - opengl/qopenglversionprofile.cpp \ opengl/qopenglprogrambinarycache.cpp - - !qtConfig(opengles2) { - HEADERS += opengl/qopenglfunctions_1_0.h \ - opengl/qopenglfunctions_1_1.h \ - opengl/qopenglfunctions_1_2.h \ - opengl/qopenglfunctions_1_3.h \ - opengl/qopenglfunctions_1_4.h \ - opengl/qopenglfunctions_1_5.h \ - opengl/qopenglfunctions_2_0.h \ - opengl/qopenglfunctions_2_1.h \ - opengl/qopenglfunctions_3_0.h \ - opengl/qopenglfunctions_3_1.h \ - opengl/qopenglfunctions_3_2_core.h \ - opengl/qopenglfunctions_3_3_core.h \ - opengl/qopenglfunctions_4_0_core.h \ - opengl/qopenglfunctions_4_1_core.h \ - opengl/qopenglfunctions_4_2_core.h \ - opengl/qopenglfunctions_4_3_core.h \ - opengl/qopenglfunctions_4_4_core.h \ - opengl/qopenglfunctions_4_5_core.h \ - opengl/qopenglfunctions_3_2_compatibility.h \ - opengl/qopenglfunctions_3_3_compatibility.h \ - opengl/qopenglfunctions_4_0_compatibility.h \ - opengl/qopenglfunctions_4_1_compatibility.h \ - opengl/qopenglfunctions_4_2_compatibility.h \ - opengl/qopenglfunctions_4_3_compatibility.h \ - opengl/qopenglfunctions_4_4_compatibility.h \ - opengl/qopenglfunctions_4_5_compatibility.h - - SOURCES += opengl/qopenglfunctions_1_0.cpp \ - opengl/qopenglfunctions_1_1.cpp \ - opengl/qopenglfunctions_1_2.cpp \ - opengl/qopenglfunctions_1_3.cpp \ - opengl/qopenglfunctions_1_4.cpp \ - opengl/qopenglfunctions_1_5.cpp \ - opengl/qopenglfunctions_2_0.cpp \ - opengl/qopenglfunctions_2_1.cpp \ - opengl/qopenglfunctions_3_0.cpp \ - opengl/qopenglfunctions_3_1.cpp \ - opengl/qopenglfunctions_3_2_core.cpp \ - opengl/qopenglfunctions_3_3_core.cpp \ - opengl/qopenglfunctions_4_0_core.cpp \ - opengl/qopenglfunctions_4_1_core.cpp \ - opengl/qopenglfunctions_4_2_core.cpp \ - opengl/qopenglfunctions_4_3_core.cpp \ - opengl/qopenglfunctions_4_4_core.cpp \ - opengl/qopenglfunctions_4_5_core.cpp \ - opengl/qopenglfunctions_3_2_compatibility.cpp \ - opengl/qopenglfunctions_3_3_compatibility.cpp \ - opengl/qopenglfunctions_4_0_compatibility.cpp \ - opengl/qopenglfunctions_4_1_compatibility.cpp \ - opengl/qopenglfunctions_4_2_compatibility.cpp \ - opengl/qopenglfunctions_4_3_compatibility.cpp \ - opengl/qopenglfunctions_4_4_compatibility.cpp \ - opengl/qopenglfunctions_4_5_compatibility.cpp - } - - qtConfig(opengles2) { - HEADERS += opengl/qopenglfunctions_es2.h - - SOURCES += opengl/qopenglfunctions_es2.cpp - } } diff --git a/src/opengl/.prev_CMakeLists.txt b/src/opengl/.prev_CMakeLists.txt index eb125273bc..569fe18fc4 100644 --- a/src/opengl/.prev_CMakeLists.txt +++ b/src/opengl/.prev_CMakeLists.txt @@ -7,20 +7,28 @@ qt_add_module(OpenGL SOURCES qopengl2pexvertexarray.cpp qopengl2pexvertexarray_p.h + qopenglbuffer.cpp qopenglbuffer.h qopenglcustomshaderstage.cpp qopenglcustomshaderstage_p.h qopengldebug.cpp qopengldebug.h qopenglengineshadermanager.cpp qopenglengineshadermanager_p.h qopenglengineshadersource_p.h + qopenglframebufferobject.cpp qopenglframebufferobject.h qopenglframebufferobject_p.h qopenglgradientcache.cpp qopenglgradientcache_p.h qopenglpaintdevice.cpp qopenglpaintdevice.h qopenglpaintdevice_p.h qopenglpaintengine.cpp qopenglpaintengine_p.h qopenglpixeltransferoptions.cpp qopenglpixeltransferoptions.h qopenglshadercache_p.h + qopenglshaderprogram.cpp qopenglshaderprogram.h qopengltexture.cpp qopengltexture.h qopengltexture_p.h + qopengltextureblitter.cpp qopengltextureblitter.h qopengltexturecache.cpp qopengltexturecache_p.h qopengltextureglyphcache.cpp qopengltextureglyphcache_p.h qopengltexturehelper.cpp qopengltexturehelper_p.h qopengltextureuploader.cpp qopengltextureuploader_p.h + qopenglversionfunctions.cpp qopenglversionfunctions.h qopenglversionfunctions_p.h + qopenglversionfunctionsfactory.cpp qopenglversionfunctionsfactory.h + qopenglversionprofile.cpp qopenglversionprofile.h + qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h qopenglwindow.cpp qopenglwindow.h qtopenglglobal.h DEFINES @@ -40,19 +48,39 @@ qt_add_module(OpenGL ## Scopes: ##################################################################### -qt_extend_target(OpenGL CONDITION QT_FEATURE_widgets +qt_extend_target(OpenGL CONDITION QT_FEATURE_opengles2 SOURCES - qopenglwidget.cpp qopenglwidget.h - LIBRARIES - Qt::WidgetsPrivate - PUBLIC_LIBRARIES - Qt::Widgets - PRIVATE_MODULE_INTERFACE - Qt::WidgetsPrivate + opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h ) qt_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2 SOURCES + qopenglfunctions_1_0.cpp qopenglfunctions_1_0.h + qopenglfunctions_1_1.cpp qopenglfunctions_1_1.h + qopenglfunctions_1_2.cpp qopenglfunctions_1_2.h + qopenglfunctions_1_3.cpp qopenglfunctions_1_3.h + qopenglfunctions_1_4.cpp qopenglfunctions_1_4.h + qopenglfunctions_1_5.cpp qopenglfunctions_1_5.h + qopenglfunctions_2_0.cpp qopenglfunctions_2_0.h + qopenglfunctions_2_1.cpp qopenglfunctions_2_1.h + qopenglfunctions_3_0.cpp qopenglfunctions_3_0.h + qopenglfunctions_3_1.cpp qopenglfunctions_3_1.h + qopenglfunctions_3_2_compatibility.cpp qopenglfunctions_3_2_compatibility.h + qopenglfunctions_3_2_core.cpp qopenglfunctions_3_2_core.h + qopenglfunctions_3_3_compatibility.cpp qopenglfunctions_3_3_compatibility.h + qopenglfunctions_3_3_core.cpp qopenglfunctions_3_3_core.h + qopenglfunctions_4_0_compatibility.cpp qopenglfunctions_4_0_compatibility.h + qopenglfunctions_4_0_core.cpp qopenglfunctions_4_0_core.h + qopenglfunctions_4_1_compatibility.cpp qopenglfunctions_4_1_compatibility.h + qopenglfunctions_4_1_core.cpp qopenglfunctions_4_1_core.h + qopenglfunctions_4_2_compatibility.cpp qopenglfunctions_4_2_compatibility.h + qopenglfunctions_4_2_core.cpp qopenglfunctions_4_2_core.h + qopenglfunctions_4_3_compatibility.cpp qopenglfunctions_4_3_compatibility.h + qopenglfunctions_4_3_core.cpp qopenglfunctions_4_3_core.h + qopenglfunctions_4_4_compatibility.cpp qopenglfunctions_4_4_compatibility.h + qopenglfunctions_4_4_core.cpp qopenglfunctions_4_4_core.h + qopenglfunctions_4_5_compatibility.cpp qopenglfunctions_4_5_compatibility.h + qopenglfunctions_4_5_core.cpp qopenglfunctions_4_5_core.h qopenglqueryhelper_p.h qopengltimerquery.cpp qopengltimerquery.h ) diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 18378a7564..c0acee56e5 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -25,6 +25,9 @@ qt_add_module(OpenGL qopengltextureglyphcache.cpp qopengltextureglyphcache_p.h qopengltexturehelper.cpp qopengltexturehelper_p.h qopengltextureuploader.cpp qopengltextureuploader_p.h + qopenglversionfunctions.cpp qopenglversionfunctions.h qopenglversionfunctions_p.h + qopenglversionfunctionsfactory.cpp qopenglversionfunctionsfactory.h + qopenglversionprofile.cpp qopenglversionprofile.h qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h qopenglwindow.cpp qopenglwindow.h qtopenglglobal.h @@ -45,8 +48,39 @@ qt_add_module(OpenGL ## Scopes: ##################################################################### +qt_extend_target(OpenGL CONDITION QT_FEATURE_opengles2 + SOURCES + qopenglfunctions_es2.cpp qopenglfunctions_es2.h +) + qt_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2 SOURCES + qopenglfunctions_1_0.cpp qopenglfunctions_1_0.h + qopenglfunctions_1_1.cpp qopenglfunctions_1_1.h + qopenglfunctions_1_2.cpp qopenglfunctions_1_2.h + qopenglfunctions_1_3.cpp qopenglfunctions_1_3.h + qopenglfunctions_1_4.cpp qopenglfunctions_1_4.h + qopenglfunctions_1_5.cpp qopenglfunctions_1_5.h + qopenglfunctions_2_0.cpp qopenglfunctions_2_0.h + qopenglfunctions_2_1.cpp qopenglfunctions_2_1.h + qopenglfunctions_3_0.cpp qopenglfunctions_3_0.h + qopenglfunctions_3_1.cpp qopenglfunctions_3_1.h + qopenglfunctions_3_2_compatibility.cpp qopenglfunctions_3_2_compatibility.h + qopenglfunctions_3_2_core.cpp qopenglfunctions_3_2_core.h + qopenglfunctions_3_3_compatibility.cpp qopenglfunctions_3_3_compatibility.h + qopenglfunctions_3_3_core.cpp qopenglfunctions_3_3_core.h + qopenglfunctions_4_0_compatibility.cpp qopenglfunctions_4_0_compatibility.h + qopenglfunctions_4_0_core.cpp qopenglfunctions_4_0_core.h + qopenglfunctions_4_1_compatibility.cpp qopenglfunctions_4_1_compatibility.h + qopenglfunctions_4_1_core.cpp qopenglfunctions_4_1_core.h + qopenglfunctions_4_2_compatibility.cpp qopenglfunctions_4_2_compatibility.h + qopenglfunctions_4_2_core.cpp qopenglfunctions_4_2_core.h + qopenglfunctions_4_3_compatibility.cpp qopenglfunctions_4_3_compatibility.h + qopenglfunctions_4_3_core.cpp qopenglfunctions_4_3_core.h + qopenglfunctions_4_4_compatibility.cpp qopenglfunctions_4_4_compatibility.h + qopenglfunctions_4_4_core.cpp qopenglfunctions_4_4_core.h + qopenglfunctions_4_5_compatibility.cpp qopenglfunctions_4_5_compatibility.h + qopenglfunctions_4_5_core.cpp qopenglfunctions_4_5_core.h qopenglqueryhelper_p.h qopengltimerquery.cpp qopengltimerquery.h ) diff --git a/src/opengl/doc/src/dontdocument.qdoc b/src/opengl/doc/src/dontdocument.qdoc new file mode 100644 index 0000000000..72e997d933 --- /dev/null +++ b/src/opengl/doc/src/dontdocument.qdoc @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \dontdocument (QOpenGLVersionStatus + QOpenGLVersionFunctionsBackend + QOpenGLVersionFunctionsStorage + QOpenGLFunctions_1_0_CoreBackend + QOpenGLFunctions_1_1_CoreBackend + QOpenGLFunctions_1_2_CoreBackend + QOpenGLFunctions_1_3_CoreBackend + QOpenGLFunctions_1_4_CoreBackend + QOpenGLFunctions_1_5_CoreBackend + QOpenGLFunctions_2_0_CoreBackend + QOpenGLFunctions_2_1_CoreBackend + QOpenGLFunctions_3_0_CoreBackend + QOpenGLFunctions_3_1_CoreBackend + QOpenGLFunctions_3_2_CoreBackend + QOpenGLFunctions_3_3_CoreBackend + QOpenGLFunctions_4_0_CoreBackend + QOpenGLFunctions_4_1_CoreBackend + QOpenGLFunctions_4_2_CoreBackend + QOpenGLFunctions_4_3_CoreBackend + QOpenGLFunctions_4_4_CoreBackend + QOpenGLFunctions_4_5_CoreBackend + QOpenGLFunctions_1_0_DeprecatedBackend + QOpenGLFunctions_1_1_DeprecatedBackend + QOpenGLFunctions_1_2_DeprecatedBackend + QOpenGLFunctions_1_3_DeprecatedBackend + QOpenGLFunctions_1_4_DeprecatedBackend + QOpenGLFunctions_2_0_DeprecatedBackend + QOpenGLFunctions_3_0_DeprecatedBackend + QOpenGLFunctions_3_3_DeprecatedBackend + QOpenGLFunctions_4_5_DeprecatedBackend) +*/ diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index bf4ba63053..777bca40ec 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -31,6 +31,10 @@ HEADERS += \ qopengltexturecache_p.h \ qopengltextureglyphcache_p.h \ qopengltextureuploader_p.h \ + qopenglversionfunctions.h \ + qopenglversionfunctions_p.h \ + qopenglversionfunctionsfactory.h \ + qopenglversionprofile.h \ qopenglvertexarrayobject.h \ qopenglwindow.h \ qtopenglglobal.h @@ -52,16 +56,77 @@ SOURCES += \ qopengltexturecache.cpp \ qopengltextureglyphcache.cpp \ qopengltextureuploader.cpp \ + qopenglversionfunctions.cpp \ + qopenglversionfunctionsfactory.cpp \ + qopenglversionprofile.cpp \ qopenglvertexarrayobject.cpp \ qopenglwindow.cpp \ qopengldebug.cpp !qtConfig(opengles2) { HEADERS += \ + qopenglfunctions_1_0.h \ + qopenglfunctions_1_1.h \ + qopenglfunctions_1_2.h \ + qopenglfunctions_1_3.h \ + qopenglfunctions_1_4.h \ + qopenglfunctions_1_5.h \ + qopenglfunctions_2_0.h \ + qopenglfunctions_2_1.h \ + qopenglfunctions_3_0.h \ + qopenglfunctions_3_1.h \ + qopenglfunctions_3_2_core.h \ + qopenglfunctions_3_3_core.h \ + qopenglfunctions_4_0_core.h \ + qopenglfunctions_4_1_core.h \ + qopenglfunctions_4_2_core.h \ + qopenglfunctions_4_3_core.h \ + qopenglfunctions_4_4_core.h \ + qopenglfunctions_4_5_core.h \ + qopenglfunctions_3_2_compatibility.h \ + qopenglfunctions_3_3_compatibility.h \ + qopenglfunctions_4_0_compatibility.h \ + qopenglfunctions_4_1_compatibility.h \ + qopenglfunctions_4_2_compatibility.h \ + qopenglfunctions_4_3_compatibility.h \ + qopenglfunctions_4_4_compatibility.h \ + qopenglfunctions_4_5_compatibility.h \ qopenglqueryhelper_p.h \ qopengltimerquery.h - SOURCES += qopengltimerquery.cpp + SOURCES += \ + qopenglfunctions_1_0.cpp \ + qopenglfunctions_1_1.cpp \ + qopenglfunctions_1_2.cpp \ + qopenglfunctions_1_3.cpp \ + qopenglfunctions_1_4.cpp \ + qopenglfunctions_1_5.cpp \ + qopenglfunctions_2_0.cpp \ + qopenglfunctions_2_1.cpp \ + qopenglfunctions_3_0.cpp \ + qopenglfunctions_3_1.cpp \ + qopenglfunctions_3_2_core.cpp \ + qopenglfunctions_3_3_core.cpp \ + qopenglfunctions_4_0_core.cpp \ + qopenglfunctions_4_1_core.cpp \ + qopenglfunctions_4_2_core.cpp \ + qopenglfunctions_4_3_core.cpp \ + qopenglfunctions_4_4_core.cpp \ + qopenglfunctions_4_5_core.cpp \ + qopenglfunctions_3_2_compatibility.cpp \ + qopenglfunctions_3_3_compatibility.cpp \ + qopenglfunctions_4_0_compatibility.cpp \ + qopenglfunctions_4_1_compatibility.cpp \ + qopenglfunctions_4_2_compatibility.cpp \ + qopenglfunctions_4_3_compatibility.cpp \ + qopenglfunctions_4_4_compatibility.cpp \ + qopenglfunctions_4_5_compatibility.cpp \ + qopengltimerquery.cpp +} + +qtConfig(opengles2) { + HEADERS += qopenglfunctions_es2.h + SOURCES += qopenglfunctions_es2.cpp } load(qt_module) diff --git a/src/gui/opengl/qopenglfunctions_1_0.cpp b/src/opengl/qopenglfunctions_1_0.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_1_0.cpp rename to src/opengl/qopenglfunctions_1_0.cpp index f9d93ce210..f440764df8 100644 --- a/src/gui/opengl/qopenglfunctions_1_0.cpp +++ b/src/opengl/qopenglfunctions_1_0.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_1_0 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_1_0 class provides all functions for OpenGL 1.0 specification. diff --git a/src/gui/opengl/qopenglfunctions_1_0.h b/src/opengl/qopenglfunctions_1_0.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_1_0.h rename to src/opengl/qopenglfunctions_1_0.h index cddb7251ed..cd94512614 100644 --- a/src/gui/opengl/qopenglfunctions_1_0.h +++ b/src/opengl/qopenglfunctions_1_0.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_1_0_H #define QOPENGLVERSIONFUNCTIONS_1_0_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_1_0 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_1_0 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_1_0(); @@ -378,7 +379,7 @@ public: void glNewList(GLuint list, GLenum mode); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_1_1.cpp b/src/opengl/qopenglfunctions_1_1.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_1_1.cpp rename to src/opengl/qopenglfunctions_1_1.cpp index b0f7538d48..7860123757 100644 --- a/src/gui/opengl/qopenglfunctions_1_1.cpp +++ b/src/opengl/qopenglfunctions_1_1.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_1_1 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_1_1 class provides all functions for OpenGL 1.1 specification. diff --git a/src/gui/opengl/qopenglfunctions_1_1.h b/src/opengl/qopenglfunctions_1_1.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_1_1.h rename to src/opengl/qopenglfunctions_1_1.h index 8a9f16ec4c..f24150fae7 100644 --- a/src/gui/opengl/qopenglfunctions_1_1.h +++ b/src/opengl/qopenglfunctions_1_1.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_1_1_H #define QOPENGLVERSIONFUNCTIONS_1_1_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_1_1 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_1_1 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_1_1(); @@ -412,7 +413,7 @@ public: void glArrayElement(GLint i); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_1_2.cpp b/src/opengl/qopenglfunctions_1_2.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_1_2.cpp rename to src/opengl/qopenglfunctions_1_2.cpp index 5f137b0237..5993210674 100644 --- a/src/gui/opengl/qopenglfunctions_1_2.cpp +++ b/src/opengl/qopenglfunctions_1_2.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_1_2 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_1_2 class provides all functions for OpenGL 1.2 specification. diff --git a/src/gui/opengl/qopenglfunctions_1_2.h b/src/opengl/qopenglfunctions_1_2.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_1_2.h rename to src/opengl/qopenglfunctions_1_2.h index 7daca0923d..623b2b89d5 100644 --- a/src/gui/opengl/qopenglfunctions_1_2.h +++ b/src/opengl/qopenglfunctions_1_2.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,18 @@ #ifndef QOPENGLVERSIONFUNCTIONS_1_2_H #define QOPENGLVERSIONFUNCTIONS_1_2_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_1_2 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_1_2 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_1_2(); @@ -454,7 +456,7 @@ public: void glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_1_3.cpp b/src/opengl/qopenglfunctions_1_3.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_1_3.cpp rename to src/opengl/qopenglfunctions_1_3.cpp index 0b5ff2fee5..41ef4d4cf3 100644 --- a/src/gui/opengl/qopenglfunctions_1_3.cpp +++ b/src/opengl/qopenglfunctions_1_3.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_1_3 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_1_3 class provides all functions for OpenGL 1.3 specification. diff --git a/src/gui/opengl/qopenglfunctions_1_3.h b/src/opengl/qopenglfunctions_1_3.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_1_3.h rename to src/opengl/qopenglfunctions_1_3.h index b527b57946..6c7ef74323 100644 --- a/src/gui/opengl/qopenglfunctions_1_3.h +++ b/src/opengl/qopenglfunctions_1_3.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_1_3_H #define QOPENGLVERSIONFUNCTIONS_1_3_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_1_3 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_1_3 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_1_3(); @@ -504,7 +505,7 @@ public: void glClientActiveTexture(GLenum texture); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_1_4.cpp b/src/opengl/qopenglfunctions_1_4.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_1_4.cpp rename to src/opengl/qopenglfunctions_1_4.cpp index 9419c1aa85..92a331d775 100644 --- a/src/gui/opengl/qopenglfunctions_1_4.cpp +++ b/src/opengl/qopenglfunctions_1_4.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_1_4 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_1_4 class provides all functions for OpenGL 1.4 specification. diff --git a/src/gui/opengl/qopenglfunctions_1_4.h b/src/opengl/qopenglfunctions_1_4.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_1_4.h rename to src/opengl/qopenglfunctions_1_4.h index 1f3f5a9c0a..d59b283c17 100644 --- a/src/gui/opengl/qopenglfunctions_1_4.h +++ b/src/opengl/qopenglfunctions_1_4.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_1_4_H #define QOPENGLVERSIONFUNCTIONS_1_4_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_1_4 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_1_4 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_1_4(); @@ -553,7 +554,7 @@ public: void glFogCoordf(GLfloat coord); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_1_5.cpp b/src/opengl/qopenglfunctions_1_5.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_1_5.cpp rename to src/opengl/qopenglfunctions_1_5.cpp index 3fa7668a36..d304679409 100644 --- a/src/gui/opengl/qopenglfunctions_1_5.cpp +++ b/src/opengl/qopenglfunctions_1_5.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_1_5 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_1_5 class provides all functions for OpenGL 1.5 specification. diff --git a/src/gui/opengl/qopenglfunctions_1_5.h b/src/opengl/qopenglfunctions_1_5.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_1_5.h rename to src/opengl/qopenglfunctions_1_5.h index d2f5311211..9600632e9d 100644 --- a/src/gui/opengl/qopenglfunctions_1_5.h +++ b/src/opengl/qopenglfunctions_1_5.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_1_5_H #define QOPENGLVERSIONFUNCTIONS_1_5_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_1_5 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_1_5 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_1_5(); @@ -576,7 +577,7 @@ public: // OpenGL 1.5 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_2_0.cpp b/src/opengl/qopenglfunctions_2_0.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_2_0.cpp rename to src/opengl/qopenglfunctions_2_0.cpp index 29eb055a1d..63bfe641f2 100644 --- a/src/gui/opengl/qopenglfunctions_2_0.cpp +++ b/src/opengl/qopenglfunctions_2_0.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_2_0 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_2_0 class provides all functions for OpenGL 2.0 specification. diff --git a/src/gui/opengl/qopenglfunctions_2_0.h b/src/opengl/qopenglfunctions_2_0.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_2_0.h rename to src/opengl/qopenglfunctions_2_0.h index 556597a9b3..7b5e580d3d 100644 --- a/src/gui/opengl/qopenglfunctions_2_0.h +++ b/src/opengl/qopenglfunctions_2_0.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_2_0_H #define QOPENGLVERSIONFUNCTIONS_2_0_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_2_0 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_2_0 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_2_0(); @@ -673,7 +674,7 @@ public: void glVertexAttrib1d(GLuint index, GLdouble x); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_2_1.cpp b/src/opengl/qopenglfunctions_2_1.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_2_1.cpp rename to src/opengl/qopenglfunctions_2_1.cpp index 8a7170dd7d..1eb8d2a95c 100644 --- a/src/gui/opengl/qopenglfunctions_2_1.cpp +++ b/src/opengl/qopenglfunctions_2_1.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_2_1 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_2_1 class provides all functions for OpenGL 2.1 specification. diff --git a/src/gui/opengl/qopenglfunctions_2_1.h b/src/opengl/qopenglfunctions_2_1.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_2_1.h rename to src/opengl/qopenglfunctions_2_1.h index f053222c71..323ba1e03d 100644 --- a/src/gui/opengl/qopenglfunctions_2_1.h +++ b/src/opengl/qopenglfunctions_2_1.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_2_1_H #define QOPENGLVERSIONFUNCTIONS_2_1_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_2_1 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_2_1 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_2_1(); @@ -683,7 +684,7 @@ public: // OpenGL 2.1 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_3_0.cpp b/src/opengl/qopenglfunctions_3_0.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_0.cpp rename to src/opengl/qopenglfunctions_3_0.cpp index 7d0e900659..9d933b50d5 100644 --- a/src/gui/opengl/qopenglfunctions_3_0.cpp +++ b/src/opengl/qopenglfunctions_3_0.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_3_0 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_3_0 class provides all functions for OpenGL 3.0 specification. diff --git a/src/gui/opengl/qopenglfunctions_3_0.h b/src/opengl/qopenglfunctions_3_0.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_0.h rename to src/opengl/qopenglfunctions_3_0.h index c592050c24..ffc9121472 100644 --- a/src/gui/opengl/qopenglfunctions_3_0.h +++ b/src/opengl/qopenglfunctions_3_0.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_3_0_H #define QOPENGLVERSIONFUNCTIONS_3_0_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_3_0 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_3_0 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_3_0(); @@ -771,7 +772,7 @@ public: void glVertexAttribI1i(GLuint index, GLint x); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_3_1.cpp b/src/opengl/qopenglfunctions_3_1.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_3_1.cpp rename to src/opengl/qopenglfunctions_3_1.cpp index c25b124af8..353ddf35ab 100644 --- a/src/gui/opengl/qopenglfunctions_3_1.cpp +++ b/src/opengl/qopenglfunctions_3_1.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_3_1 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_3_1 class provides all functions for OpenGL 3.1 specification. diff --git a/src/gui/opengl/qopenglfunctions_3_1.h b/src/opengl/qopenglfunctions_3_1.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_1.h rename to src/opengl/qopenglfunctions_3_1.h index 3a8d3891f3..8bc4f69e32 100644 --- a/src/gui/opengl/qopenglfunctions_3_1.h +++ b/src/opengl/qopenglfunctions_3_1.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_3_1_H #define QOPENGLVERSIONFUNCTIONS_3_1_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_3_1 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_3_1 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_3_1(); @@ -332,7 +333,7 @@ public: void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp b/src/opengl/qopenglfunctions_3_2_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp rename to src/opengl/qopenglfunctions_3_2_compatibility.cpp index 3e4fd96dc2..92c7b6e3ba 100644 --- a/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp +++ b/src/opengl/qopenglfunctions_3_2_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_3_2_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_3_2_Compatibility class provides all functions for OpenGL 3.2 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_3_2_compatibility.h b/src/opengl/qopenglfunctions_3_2_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_2_compatibility.h rename to src/opengl/qopenglfunctions_3_2_compatibility.h index 391e725953..f4ce56f27d 100644 --- a/src/gui/opengl/qopenglfunctions_3_2_compatibility.h +++ b/src/opengl/qopenglfunctions_3_2_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_3_2_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_3_2_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_3_2_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_3_2_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_3_2_Compatibility(); @@ -810,7 +811,7 @@ public: // OpenGL 3.2 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_3_2_core.cpp b/src/opengl/qopenglfunctions_3_2_core.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_3_2_core.cpp rename to src/opengl/qopenglfunctions_3_2_core.cpp index ea89fc9e48..5f7d32fb61 100644 --- a/src/gui/opengl/qopenglfunctions_3_2_core.cpp +++ b/src/opengl/qopenglfunctions_3_2_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_3_2_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_3_2_Core class provides all functions for OpenGL 3.2 core profile. diff --git a/src/gui/opengl/qopenglfunctions_3_2_core.h b/src/opengl/qopenglfunctions_3_2_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_2_core.h rename to src/opengl/qopenglfunctions_3_2_core.h index 1eafb6f441..4fad8f5e59 100644 --- a/src/gui/opengl/qopenglfunctions_3_2_core.h +++ b/src/opengl/qopenglfunctions_3_2_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_3_2_CORE_H #define QOPENGLVERSIONFUNCTIONS_3_2_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_3_2_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_3_2_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_3_2_Core(); @@ -353,7 +354,7 @@ public: void glGetInteger64i_v(GLenum target, GLuint index, GLint64 *data); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp b/src/opengl/qopenglfunctions_3_3_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp rename to src/opengl/qopenglfunctions_3_3_compatibility.cpp index a26d7d99b1..9b9617c1e7 100644 --- a/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp +++ b/src/opengl/qopenglfunctions_3_3_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_3_3_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_3_3_Compatibility class provides all functions for OpenGL 3.3 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_3_3_compatibility.h b/src/opengl/qopenglfunctions_3_3_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_3_compatibility.h rename to src/opengl/qopenglfunctions_3_3_compatibility.h index 185dd5aab4..971f4a58f4 100644 --- a/src/gui/opengl/qopenglfunctions_3_3_compatibility.h +++ b/src/opengl/qopenglfunctions_3_3_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_3_3_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_3_3_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_3_3_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_3_3_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_3_3_Compatibility(); @@ -872,7 +873,7 @@ public: // OpenGL 3.3 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_3_3_core.cpp b/src/opengl/qopenglfunctions_3_3_core.cpp similarity index 98% rename from src/gui/opengl/qopenglfunctions_3_3_core.cpp rename to src/opengl/qopenglfunctions_3_3_core.cpp index 277ad1eb14..78a2e8b568 100644 --- a/src/gui/opengl/qopenglfunctions_3_3_core.cpp +++ b/src/opengl/qopenglfunctions_3_3_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_3_3_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_3_3_Core class provides all functions for OpenGL 3.3 core profile. diff --git a/src/gui/opengl/qopenglfunctions_3_3_core.h b/src/opengl/qopenglfunctions_3_3_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_3_3_core.h rename to src/opengl/qopenglfunctions_3_3_core.h index 47d54d717e..6f80adfe20 100644 --- a/src/gui/opengl/qopenglfunctions_3_3_core.h +++ b/src/opengl/qopenglfunctions_3_3_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_3_3_CORE_H #define QOPENGLVERSIONFUNCTIONS_3_3_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_3_3_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_3_3_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_3_3_Core(); @@ -413,7 +414,7 @@ public: void glVertexAttribDivisor(GLuint index, GLuint divisor); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp b/src/opengl/qopenglfunctions_4_0_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp rename to src/opengl/qopenglfunctions_4_0_compatibility.cpp index 655f1e6fd4..e94a0bf5ab 100644 --- a/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp +++ b/src/opengl/qopenglfunctions_4_0_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_0_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_0_Compatibility class provides all functions for OpenGL 4.0 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_4_0_compatibility.h b/src/opengl/qopenglfunctions_4_0_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_0_compatibility.h rename to src/opengl/qopenglfunctions_4_0_compatibility.h index c0e42443d3..c8900ab599 100644 --- a/src/gui/opengl/qopenglfunctions_4_0_compatibility.h +++ b/src/opengl/qopenglfunctions_4_0_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_0_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_4_0_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_0_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_0_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_0_Compatibility(); @@ -922,7 +923,7 @@ public: // OpenGL 4.0 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_0_core.cpp b/src/opengl/qopenglfunctions_4_0_core.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_0_core.cpp rename to src/opengl/qopenglfunctions_4_0_core.cpp index 60453d147c..a5fc44f31d 100644 --- a/src/gui/opengl/qopenglfunctions_4_0_core.cpp +++ b/src/opengl/qopenglfunctions_4_0_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_0_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_0_Core class provides all functions for OpenGL 4.0 core profile. diff --git a/src/gui/opengl/qopenglfunctions_4_0_core.h b/src/opengl/qopenglfunctions_4_0_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_0_core.h rename to src/opengl/qopenglfunctions_4_0_core.h index 6cb55e86f7..aac7880592 100644 --- a/src/gui/opengl/qopenglfunctions_4_0_core.h +++ b/src/opengl/qopenglfunctions_4_0_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_0_CORE_H #define QOPENGLVERSIONFUNCTIONS_4_0_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_0_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_0_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_0_Core(); @@ -461,7 +462,7 @@ public: void glMinSampleShading(GLfloat value); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp b/src/opengl/qopenglfunctions_4_1_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp rename to src/opengl/qopenglfunctions_4_1_compatibility.cpp index bdea8b5ba9..6198412ebc 100644 --- a/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp +++ b/src/opengl/qopenglfunctions_4_1_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_1_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_1_Compatibility class provides all functions for OpenGL 4.1 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_4_1_compatibility.h b/src/opengl/qopenglfunctions_4_1_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_1_compatibility.h rename to src/opengl/qopenglfunctions_4_1_compatibility.h index bee169b50c..e54f103151 100644 --- a/src/gui/opengl/qopenglfunctions_4_1_compatibility.h +++ b/src/opengl/qopenglfunctions_4_1_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_1_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_4_1_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_1_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_1_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_1_Compatibility(); @@ -1014,7 +1015,7 @@ public: // OpenGL 4.1 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.cpp b/src/opengl/qopenglfunctions_4_1_core.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_1_core.cpp rename to src/opengl/qopenglfunctions_4_1_core.cpp index b21742d9c1..81eedaa7bb 100644 --- a/src/gui/opengl/qopenglfunctions_4_1_core.cpp +++ b/src/opengl/qopenglfunctions_4_1_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_1_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_1_Core class provides all functions for OpenGL 4.1 core profile. diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.h b/src/opengl/qopenglfunctions_4_1_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_1_core.h rename to src/opengl/qopenglfunctions_4_1_core.h index 3a4fd0743b..6a18d42479 100644 --- a/src/gui/opengl/qopenglfunctions_4_1_core.h +++ b/src/opengl/qopenglfunctions_4_1_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,16 +50,17 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_1_CORE_H #define QOPENGLVERSIONFUNCTIONS_4_1_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_1_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_1_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_1_Core(); @@ -551,7 +552,7 @@ public: void glReleaseShaderCompiler(); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp b/src/opengl/qopenglfunctions_4_2_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp rename to src/opengl/qopenglfunctions_4_2_compatibility.cpp index 41ab9ae762..f04a30854b 100644 --- a/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp +++ b/src/opengl/qopenglfunctions_4_2_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_2_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_2_Compatibility class provides all functions for OpenGL 4.2 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_4_2_compatibility.h b/src/opengl/qopenglfunctions_4_2_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_2_compatibility.h rename to src/opengl/qopenglfunctions_4_2_compatibility.h index a48d581c2d..08dd30864b 100644 --- a/src/gui/opengl/qopenglfunctions_4_2_compatibility.h +++ b/src/opengl/qopenglfunctions_4_2_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_2_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_4_2_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include // MemoryBarrier is a macro on some architectures on Windows @@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_2_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_2_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_2_Compatibility(); @@ -1036,7 +1037,7 @@ public: // OpenGL 4.2 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_2_core.cpp b/src/opengl/qopenglfunctions_4_2_core.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_2_core.cpp rename to src/opengl/qopenglfunctions_4_2_core.cpp index 38dbe1b596..15d7eba25a 100644 --- a/src/gui/opengl/qopenglfunctions_4_2_core.cpp +++ b/src/opengl/qopenglfunctions_4_2_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_2_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_2_Core class provides all functions for OpenGL 4.2 core profile. diff --git a/src/gui/opengl/qopenglfunctions_4_2_core.h b/src/opengl/qopenglfunctions_4_2_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_2_core.h rename to src/opengl/qopenglfunctions_4_2_core.h index 5ca98e9808..5eff9f449c 100644 --- a/src/gui/opengl/qopenglfunctions_4_2_core.h +++ b/src/opengl/qopenglfunctions_4_2_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_2_CORE_H #define QOPENGLVERSIONFUNCTIONS_4_2_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include // MemoryBarrier is a macro on some architectures on Windows @@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_2_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_2_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_2_Core(); @@ -571,7 +572,7 @@ public: void glDrawArraysInstancedBaseInstance(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp b/src/opengl/qopenglfunctions_4_3_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp rename to src/opengl/qopenglfunctions_4_3_compatibility.cpp index 1b23d08ee2..d17a4adb10 100644 --- a/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp +++ b/src/opengl/qopenglfunctions_4_3_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_3_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_3_Compatibility class provides all functions for OpenGL 4.3 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_4_3_compatibility.h b/src/opengl/qopenglfunctions_4_3_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_3_compatibility.h rename to src/opengl/qopenglfunctions_4_3_compatibility.h index d969f5b3b4..dc8eb32842 100644 --- a/src/gui/opengl/qopenglfunctions_4_3_compatibility.h +++ b/src/opengl/qopenglfunctions_4_3_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_3_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_4_3_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include // MemoryBarrier is a macro on some architectures on Windows @@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_3_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_3_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_3_Compatibility(); @@ -1073,7 +1074,7 @@ public: // OpenGL 4.3 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_3_core.cpp b/src/opengl/qopenglfunctions_4_3_core.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_3_core.cpp rename to src/opengl/qopenglfunctions_4_3_core.cpp index 8a867471b8..72c09db076 100644 --- a/src/gui/opengl/qopenglfunctions_4_3_core.cpp +++ b/src/opengl/qopenglfunctions_4_3_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_3_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_4_3_Core class provides all functions for OpenGL 4.3 core profile. diff --git a/src/gui/opengl/qopenglfunctions_4_3_core.h b/src/opengl/qopenglfunctions_4_3_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_3_core.h rename to src/opengl/qopenglfunctions_4_3_core.h index 13675caf62..4bbcb4fc46 100644 --- a/src/gui/opengl/qopenglfunctions_4_3_core.h +++ b/src/opengl/qopenglfunctions_4_3_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_3_CORE_H #define QOPENGLVERSIONFUNCTIONS_4_3_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include // MemoryBarrier is a macro on some architectures on Windows @@ -66,7 +67,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_3_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_3_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_3_Core(); @@ -607,7 +608,7 @@ public: void glClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp b/src/opengl/qopenglfunctions_4_4_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp rename to src/opengl/qopenglfunctions_4_4_compatibility.cpp index 4fc4b50100..38348869db 100644 --- a/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp +++ b/src/opengl/qopenglfunctions_4_4_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_4_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.5 \wrapper \brief The QOpenGLFunctions_4_4_Compatibility class provides all functions for OpenGL 4.4 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_4_4_compatibility.h b/src/opengl/qopenglfunctions_4_4_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_4_compatibility.h rename to src/opengl/qopenglfunctions_4_4_compatibility.h index 0acab349a1..6e5772ba4c 100644 --- a/src/gui/opengl/qopenglfunctions_4_4_compatibility.h +++ b/src/opengl/qopenglfunctions_4_4_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_4_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_4_4_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include QT_BEGIN_NAMESPACE @@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE #undef MemoryBarrier #endif -class Q_GUI_EXPORT QOpenGLFunctions_4_4_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_4_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_4_Compatibility(); @@ -1096,7 +1097,7 @@ public: // OpenGL 4.4 deprecated functions private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_4_core.cpp b/src/opengl/qopenglfunctions_4_4_core.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_4_core.cpp rename to src/opengl/qopenglfunctions_4_4_core.cpp index 6169c7f455..e0a78e1527 100644 --- a/src/gui/opengl/qopenglfunctions_4_4_core.cpp +++ b/src/opengl/qopenglfunctions_4_4_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_4_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.5 \wrapper \brief The QOpenGLFunctions_4_4_Core class provides all functions for OpenGL 4.4 core profile. diff --git a/src/gui/opengl/qopenglfunctions_4_4_core.h b/src/opengl/qopenglfunctions_4_4_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_4_core.h rename to src/opengl/qopenglfunctions_4_4_core.h index 1ad6f40214..85229bff60 100644 --- a/src/gui/opengl/qopenglfunctions_4_4_core.h +++ b/src/opengl/qopenglfunctions_4_4_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_4_CORE_H #define QOPENGLVERSIONFUNCTIONS_4_4_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include // MemoryBarrier is a macro on some architectures on Windows @@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_4_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_4_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_4_Core(); @@ -650,7 +651,7 @@ public: void glBufferStorage(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp b/src/opengl/qopenglfunctions_4_5_compatibility.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp rename to src/opengl/qopenglfunctions_4_5_compatibility.cpp index 02af443498..253b305452 100644 --- a/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp +++ b/src/opengl/qopenglfunctions_4_5_compatibility.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_5_Compatibility - \inmodule QtGui + \inmodule QtOpenGL \since 5.5 \wrapper \brief The QOpenGLFunctions_4_5_Compatibility class provides all functions for OpenGL 4.5 compatibility profile. diff --git a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h b/src/opengl/qopenglfunctions_4_5_compatibility.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_5_compatibility.h rename to src/opengl/qopenglfunctions_4_5_compatibility.h index 9d9d14548b..766fe9105e 100644 --- a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h +++ b/src/opengl/qopenglfunctions_4_5_compatibility.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_5_COMPATIBILITY_H #define QOPENGLVERSIONFUNCTIONS_4_5_COMPATIBILITY_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include // MemoryBarrier is a macro on some architectures on Windows @@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_5_Compatibility : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_5_Compatibility : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_5_Compatibility(); @@ -1218,7 +1219,7 @@ public: void glGetnMapdv(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_4_5_core.cpp b/src/opengl/qopenglfunctions_4_5_core.cpp similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_5_core.cpp rename to src/opengl/qopenglfunctions_4_5_core.cpp index 9c0369e5f2..b680629e91 100644 --- a/src/gui/opengl/qopenglfunctions_4_5_core.cpp +++ b/src/opengl/qopenglfunctions_4_5_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_4_5_Core - \inmodule QtGui + \inmodule QtOpenGL \since 5.5 \wrapper \brief The QOpenGLFunctions_4_5_Core class provides all functions for OpenGL 4.5 core profile. diff --git a/src/gui/opengl/qopenglfunctions_4_5_core.h b/src/opengl/qopenglfunctions_4_5_core.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_4_5_core.h rename to src/opengl/qopenglfunctions_4_5_core.h index bf872c628b..3fe64d2d25 100644 --- a/src/gui/opengl/qopenglfunctions_4_5_core.h +++ b/src/opengl/qopenglfunctions_4_5_core.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,11 +50,12 @@ #ifndef QOPENGLVERSIONFUNCTIONS_4_5_CORE_H #define QOPENGLVERSIONFUNCTIONS_4_5_CORE_H -#include +#include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include +#include +#include #include // MemoryBarrier is a macro on some architectures on Windows @@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QOpenGLFunctions_4_5_Core : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_4_5_Core : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_4_5_Core(); @@ -758,7 +759,7 @@ public: void glClipControl(GLenum origin, GLenum depth); private: - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; static bool isContextCompatible(QOpenGLContext *context); static QOpenGLVersionProfile versionProfile(); diff --git a/src/gui/opengl/qopenglfunctions_es2.cpp b/src/opengl/qopenglfunctions_es2.cpp similarity index 97% rename from src/gui/opengl/qopenglfunctions_es2.cpp rename to src/opengl/qopenglfunctions_es2.cpp index dd2b3af80b..39d86e647f 100644 --- a/src/gui/opengl/qopenglfunctions_es2.cpp +++ b/src/opengl/qopenglfunctions_es2.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLFunctions_ES2 - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \wrapper \brief The QOpenGLFunctions_ES2 class provides all functions for OpenGL ES 2. diff --git a/src/gui/opengl/qopenglfunctions_es2.h b/src/opengl/qopenglfunctions_es2.h similarity index 99% rename from src/gui/opengl/qopenglfunctions_es2.h rename to src/opengl/qopenglfunctions_es2.h index 851eb5951b..e3c4ad5c2c 100644 --- a/src/gui/opengl/qopenglfunctions_es2.h +++ b/src/opengl/qopenglfunctions_es2.h @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -40,18 +40,19 @@ #ifndef QOPENGLVERSIONFUNCTIONS_ES2_H #define QOPENGLVERSIONFUNCTIONS_ES2_H -#include +#include #if defined(QT_OPENGL_ES_2) || defined(Q_QDOC) -#include +#include +#include #include QT_BEGIN_NAMESPACE class QOpenGLFunctions_ES2Private; -class Q_GUI_EXPORT QOpenGLFunctions_ES2 : public QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QOpenGLFunctions_ES2 : public QAbstractOpenGLFunctions { public: QOpenGLFunctions_ES2(); diff --git a/src/opengl/qopenglshaderprogram.cpp b/src/opengl/qopenglshaderprogram.cpp index c5e61859ee..72ddea3a9e 100644 --- a/src/opengl/qopenglshaderprogram.cpp +++ b/src/opengl/qopenglshaderprogram.cpp @@ -40,6 +40,7 @@ #include "qopenglshaderprogram.h" #include "qopenglextrafunctions.h" #include "private/qopenglcontext_p.h" +#include #include #include #include @@ -52,7 +53,7 @@ #include #if !defined(QT_OPENGL_ES_2) -#include +#include #endif #include @@ -896,7 +897,7 @@ bool QOpenGLShaderProgram::init() #ifndef QT_OPENGL_ES_2 if (!context->isOpenGLES() && context->format().version() >= qMakePair(4, 0)) { - d->tessellationFuncs = context->versionFunctions(); + d->tessellationFuncs = QOpenGLVersionFunctionsFactory::get(context); d->tessellationFuncs->initializeOpenGLFunctions(); } #endif diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/opengl/qopenglversionfunctions.cpp similarity index 90% rename from src/gui/opengl/qopenglversionfunctions.cpp rename to src/opengl/qopenglversionfunctions.cpp index 5a108335a9..016683a3f2 100644 --- a/src/gui/opengl/qopenglversionfunctions.cpp +++ b/src/opengl/qopenglversionfunctions.cpp @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -48,11 +48,40 @@ ****************************************************************************/ #include "qopenglversionfunctions.h" +#include "qopenglversionfunctions_p.h" #include "qopenglcontext.h" #include "qdebug.h" QT_BEGIN_NAMESPACE +QOpenGLContextVersionData::~QOpenGLContextVersionData() +{ + for (auto *f : qAsConst(externalFunctions)) { + auto *fp = QAbstractOpenGLFunctionsPrivate::get(f); + fp->owningContext = nullptr; + fp->initialized = false; + } + externalFunctions.clear(); + qDeleteAll(functions); + functions.clear(); +} + +QOpenGLContextVersionData *QOpenGLContextVersionData::forContext(QOpenGLContext *context) +{ + auto *data = contextData.value(context); + if (!data) { + data = new QOpenGLContextVersionData; + // The data will live as long as the context. It could potentially be an opaque pointer + // member of QOpenGLContextPrivate, but this avoids polluting QOpenGLContext with version + // functions specifics + QObject::connect(context, &QObject::destroyed, context, [data](){ delete data; }, Qt::DirectConnection); + contextData[context] = data; + } + return data; +} + +QMap QOpenGLContextVersionData::contextData; + #define QT_OPENGL_COUNT_FUNCTIONS(ret, name, args) +1 #define QT_OPENGL_FUNCTION_NAMES(ret, name, args) \ "gl"#name"\0" @@ -124,25 +153,24 @@ QOpenGLVersionFunctionsBackend *QOpenGLVersionFunctionsStorage::backend(QOpenGLC QOpenGLVersionFunctionsBackend *QAbstractOpenGLFunctionsPrivate::functionsBackend(QOpenGLContext *context, QOpenGLVersionFunctionsBackend::Version v) { Q_ASSERT(context); - QOpenGLVersionFunctionsStorage *storage = context->functionsBackendStorage(); - return storage->backend(context, v); + return QOpenGLContextVersionData::forContext(context)->functionsStorage.backend(context, v); } void QAbstractOpenGLFunctionsPrivate::insertExternalFunctions(QOpenGLContext *context, QAbstractOpenGLFunctions *f) { Q_ASSERT(context); - context->insertExternalFunctions(f); + QOpenGLContextVersionData::forContext(context)->externalFunctions.insert(f); } void QAbstractOpenGLFunctionsPrivate::removeExternalFunctions(QOpenGLContext *context, QAbstractOpenGLFunctions *f) { Q_ASSERT(context); - context->removeExternalFunctions(f); + QOpenGLContextVersionData::forContext(context)->externalFunctions.remove(f); } /*! \class QAbstractOpenGLFunctions - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \brief The QAbstractOpenGLFunctions class is the base class of a family of classes that expose all functions for each OpenGL version and diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/opengl/qopenglversionfunctions.h similarity index 99% rename from src/gui/opengl/qopenglversionfunctions.h rename to src/opengl/qopenglversionfunctions.h index f31db081bf..47e7e37d3a 100644 --- a/src/gui/opengl/qopenglversionfunctions.h +++ b/src/opengl/qopenglversionfunctions.h @@ -4,7 +4,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -50,7 +50,7 @@ #ifndef QOPENGLVERSIONFUNCTIONS_H #define QOPENGLVERSIONFUNCTIONS_H -#include +#include #ifndef QT_NO_OPENGL @@ -213,7 +213,7 @@ public: bool initialized; }; -class Q_GUI_EXPORT QAbstractOpenGLFunctions +class Q_OPENGL_EXPORT QAbstractOpenGLFunctions { public: virtual ~QAbstractOpenGLFunctions(); @@ -232,7 +232,7 @@ protected: void setOwningContext(const QOpenGLContext *context); QOpenGLContext *owningContext() const; - friend class QOpenGLContext; + friend class QOpenGLVersionFunctionsFactory; }; inline QAbstractOpenGLFunctionsPrivate *QAbstractOpenGLFunctionsPrivate::get(QAbstractOpenGLFunctions *q) diff --git a/src/gui/opengl/qopenglversionfunctionsfactory_p.h b/src/opengl/qopenglversionfunctions_p.h similarity index 77% rename from src/gui/opengl/qopenglversionfunctionsfactory_p.h rename to src/opengl/qopenglversionfunctions_p.h index 469a9cc624..1458edf322 100644 --- a/src/gui/opengl/qopenglversionfunctionsfactory_p.h +++ b/src/opengl/qopenglversionfunctions_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -46,8 +46,8 @@ ** ****************************************************************************/ -#ifndef QOPENGLVERSIONFUNCTIONFACTORY_P_H -#define QOPENGLVERSIONFUNCTIONFACTORY_P_H +#ifndef QOPENGLVERSIONFUNCTION_H +#define QOPENGLVERSIONFUNCTION_H // // W A R N I N G @@ -60,24 +60,28 @@ // We mean it. // -#include +#include "qopenglversionfunctions.h" -#ifndef QT_NO_OPENGL - -#include +#include +#include +#include QT_BEGIN_NAMESPACE class QAbstractOpenGLFunctions; -class QOpenGLVersionFunctionsFactory -{ +class QOpenGLContextVersionData { public: - static QAbstractOpenGLFunctions *create(const QOpenGLVersionProfile &versionProfile); + QHash functions; + QOpenGLVersionFunctionsStorage functionsStorage; + QSet externalFunctions; + // TODO: who calls delete? + ~QOpenGLContextVersionData(); + static QOpenGLContextVersionData *forContext(QOpenGLContext *context); +private: + static QMap contextData; }; QT_END_NAMESPACE -#endif // QT_NO_OPENGL - #endif diff --git a/src/gui/opengl/qopenglversionfunctionsfactory.cpp b/src/opengl/qopenglversionfunctionsfactory.cpp similarity index 55% rename from src/gui/opengl/qopenglversionfunctionsfactory.cpp rename to src/opengl/qopenglversionfunctionsfactory.cpp index ca7daedf34..de7fe6c07f 100644 --- a/src/gui/opengl/qopenglversionfunctionsfactory.cpp +++ b/src/opengl/qopenglversionfunctionsfactory.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -46,7 +46,8 @@ ** ****************************************************************************/ -#include "qopenglversionfunctionsfactory_p.h" +#include "qopenglversionfunctionsfactory.h" +#include "qopenglversionfunctions_p.h" #if !defined(QT_OPENGL_ES_2) #include "qopenglfunctions_4_5_core.h" @@ -81,7 +82,7 @@ QT_BEGIN_NAMESPACE -QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVersionProfile &versionProfile) +static QAbstractOpenGLFunctions *createFunctions(const QOpenGLVersionProfile &versionProfile) { #if !defined(QT_OPENGL_ES_2) const int major = versionProfile.version().first; @@ -160,4 +161,120 @@ QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVe #endif } +/*! + \fn static T *QOpenGLVersionFunctionsFactory::get(QOpenGLContext *context) + + \overload get() + + Returns a pointer to an object that provides access to all functions for + the version and profile of this context. There is no need to call + QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as the \a context + is current. It is also possible to call this function when the \a context is not + current, but in that case it is the caller's responsibility to ensure proper + initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() + afterwards. + + Usually one would use the template version of this function to automatically + have the result cast to the correct type. + + \code + auto funcs = QOpenGLVersionFunctionsFactory::get(context); + if (!funcs) { + qFatal("Could not obtain required OpenGL context version"); + } + \endcode + + It is possible to request a functions object for a different version and profile + than that for which the context was created. To do this either use the template + version of this function specifying the desired functions object type as the + template parameter or by passing in a QOpenGLVersionProfile object as an argument + to the non-template function. + + Note that requests for function objects of other versions or profiles can fail and + in doing so will return \nullptr. Situations in which creation of the functions + object can fail are if the request cannot be satisfied due to asking for functions + that are not in the version or profile of this context. For example: + + \list + \li Requesting a 3.3 core profile functions object would succeed. + \li Requesting a 3.3 compatibility profile functions object would fail. We would fail + to resolve the deprecated functions. + \li Requesting a 4.3 core profile functions object would fail. We would fail to resolve + the new core functions introduced in versions 4.0-4.3. + \li Requesting a 3.1 functions object would succeed. There is nothing in 3.1 that is not + also in 3.3 core. + \endlist + + Note that if creating a functions object via this method that the QOpenGLContext + retains ownership of the object. This is to allow the object to be cached and shared. +*/ + +/*! + Returns a pointer to an object that provides access to all functions for the + \a versionProfile of the \a context. There is no need to call + QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as the \a context + is current. It is also possible to call this function when the \a context is not + current, but in that case it is the caller's responsibility to ensure proper + initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() + afterwards. + + Usually one would use the template version of this function to automatically + have the result cast to the correct type. +*/ +QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::get(const QOpenGLVersionProfile &versionProfile, QOpenGLContext *context) +{ + if (!context) + context = QOpenGLContext::currentContext(); + + if (!context) { + qWarning("versionFunctions: No OpenGL context"); + return nullptr; + } + +#ifndef QT_OPENGL_ES_2 + if (context->isOpenGLES()) { + qWarning("versionFunctions: Not supported on OpenGL ES"); + return nullptr; + } +#endif // QT_OPENGL_ES_2 + + const QSurfaceFormat f = context->format(); + + // Ensure we have a valid version and profile. Default to context's if none specified + QOpenGLVersionProfile vp = versionProfile; + if (!vp.isValid()) + vp = QOpenGLVersionProfile(f); + + // Check that context is compatible with requested version + const QPair v = qMakePair(f.majorVersion(), f.minorVersion()); + if (v < vp.version()) + return nullptr; + + // If this context only offers core profile functions then we can't create + // function objects for legacy or compatibility profile requests + if (((vp.hasProfiles() && vp.profile() != QSurfaceFormat::CoreProfile) || vp.isLegacyVersion()) + && f.profile() == QSurfaceFormat::CoreProfile) + return nullptr; + + // Create object if suitable one not cached + QAbstractOpenGLFunctions* funcs = nullptr; + // TODO: replace with something else + auto *data = QOpenGLContextVersionData::forContext(context); + auto it = data->functions.constFind(vp); + if (it == data->functions.constEnd()) { + funcs = createFunctions(vp); + if (funcs) { + funcs->setOwningContext(context); + data->functions.insert(vp, funcs); + } + } else { + funcs = it.value(); + } + + if (funcs && QOpenGLContext::currentContext() == context) + funcs->initializeOpenGLFunctions(); + + return funcs; +} + QT_END_NAMESPACE diff --git a/src/opengl/qopenglversionfunctionsfactory.h b/src/opengl/qopenglversionfunctionsfactory.h new file mode 100644 index 0000000000..0445c2e03d --- /dev/null +++ b/src/opengl/qopenglversionfunctionsfactory.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** +** This file was generated by glgen version 0.1 +** Command line was: glgen +** +** glgen is Copyright (C) 2012 Klaralvdalens Datakonsult AB (KDAB) +** +** This is an auto-generated file. +** Do not edit! All changes made to it will be lost. +** +****************************************************************************/ + +#ifndef QOPENGLVERSIONFUNCTIONFACTORY_H +#define QOPENGLVERSIONFUNCTIONFACTORY_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QAbstractOpenGLFunctions; +class QOpenGLContext; + +class Q_OPENGL_EXPORT QOpenGLVersionFunctionsFactory +{ +public: + static QAbstractOpenGLFunctions *get(const QOpenGLVersionProfile &versionProfile = QOpenGLVersionProfile(), QOpenGLContext *context = nullptr); + template + static TYPE *get(QOpenGLContext *context = nullptr) + { + QOpenGLVersionProfile v = TYPE::versionProfile(); + return static_cast(get(v, context)); + } +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/gui/opengl/qopenglversionprofile.cpp b/src/opengl/qopenglversionprofile.cpp similarity index 98% rename from src/gui/opengl/qopenglversionprofile.cpp rename to src/opengl/qopenglversionprofile.cpp index 4e728f9405..afda77857e 100644 --- a/src/gui/opengl/qopenglversionprofile.cpp +++ b/src/opengl/qopenglversionprofile.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -59,7 +59,7 @@ public: /*! \class QOpenGLVersionProfile - \inmodule QtGui + \inmodule QtOpenGL \since 5.1 \brief The QOpenGLVersionProfile class represents the version and if applicable the profile of an OpenGL context. diff --git a/src/gui/opengl/qopenglversionprofile.h b/src/opengl/qopenglversionprofile.h similarity index 93% rename from src/gui/opengl/qopenglversionprofile.h rename to src/opengl/qopenglversionprofile.h index 7315f1a2cb..fdc531692a 100644 --- a/src/gui/opengl/qopenglversionprofile.h +++ b/src/opengl/qopenglversionprofile.h @@ -3,7 +3,7 @@ ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -40,7 +40,7 @@ #ifndef QOPENGLVERSIONPROFILE_H #define QOPENGLVERSIONPROFILE_H -#include +#include #include @@ -50,14 +50,12 @@ #endif #include -#ifndef QT_NO_OPENGL - QT_BEGIN_NAMESPACE class QOpenGLVersionProfilePrivate; class QDebug; -class Q_GUI_EXPORT QOpenGLVersionProfile +class Q_OPENGL_EXPORT QOpenGLVersionProfile { public: QOpenGLVersionProfile(); @@ -100,11 +98,9 @@ inline bool operator!=(const QOpenGLVersionProfile &lhs, const QOpenGLVersionPro } #ifndef QT_NO_DEBUG_STREAM -Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QOpenGLVersionProfile &vp); +Q_OPENGL_EXPORT QDebug operator<<(QDebug debug, const QOpenGLVersionProfile &vp); #endif // !QT_NO_DEBUG_STREAM QT_END_NAMESPACE -#endif // QT_NO_OPENGL - #endif // QOPENGLVERSIONPROFILE_H diff --git a/src/opengl/qopenglvertexarrayobject.cpp b/src/opengl/qopenglvertexarrayobject.cpp index a6ac282d4c..e4bd24ef58 100644 --- a/src/opengl/qopenglvertexarrayobject.cpp +++ b/src/opengl/qopenglvertexarrayobject.cpp @@ -45,8 +45,9 @@ #include #include -#include -#include +#include +#include +#include #include #include @@ -172,11 +173,11 @@ bool QOpenGLVertexArrayObjectPrivate::create() QSurfaceFormat format = ctx->format(); #ifndef QT_OPENGL_ES_2 if (format.version() >= qMakePair(3,2)) { - vaoFuncs.core_3_2 = ctx->versionFunctions(); + vaoFuncs.core_3_2 = QOpenGLVersionFunctionsFactory::get(ctx); vaoFuncsType = Core_3_2; vaoFuncs.core_3_2->glGenVertexArrays(1, &vao); } else if (format.majorVersion() >= 3) { - vaoFuncs.core_3_0 = ctx->versionFunctions(); + vaoFuncs.core_3_0 = QOpenGLVersionFunctionsFactory::get(ctx); vaoFuncsType = Core_3_0; vaoFuncs.core_3_0->glGenVertexArrays(1, &vao); } else diff --git a/src/opengl/qtopenglglobal.h b/src/opengl/qtopenglglobal.h index 0e821f87b8..861fb16d59 100644 --- a/src/opengl/qtopenglglobal.h +++ b/src/opengl/qtopenglglobal.h @@ -41,6 +41,7 @@ #define QTOPENGLGLOBAL_H #include +#include QT_BEGIN_NAMESPACE diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index ad0dfb5c08..ca12461efa 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -32,9 +32,10 @@ #include #include #include +#include +#include #include #include -#include #include #include #include @@ -635,7 +636,7 @@ static bool supportsInternalFboFormat(QOpenGLContext *ctx, int glFormat) #ifndef QT_OPENGL_ES_2 if (!ctx->isOpenGLES() && ctx->format().majorVersion() >= 4) { GLint value = -1; - QOpenGLFunctions_4_2_Core* vFuncs = ctx->versionFunctions(); + auto *vFuncs = QOpenGLVersionFunctionsFactory::get(ctx); if (vFuncs && vFuncs->initializeOpenGLFunctions()) { vFuncs->glGetInternalformativ(GL_TEXTURE_2D, glFormat, GL_FRAMEBUFFER_RENDERABLE, 1, &value); if (value != GL_FULL_SUPPORT)