diff options
| -rw-r--r-- | src/gui/.prev_CMakeLists.txt | 44 | ||||
| -rw-r--r-- | src/gui/CMakeLists.txt | 44 | ||||
| -rw-r--r-- | src/gui/doc/src/dontdocument.qdoc | 30 | ||||
| -rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 151 | ||||
| -rw-r--r-- | src/gui/kernel/qopenglcontext.h | 16 | ||||
| -rw-r--r-- | src/gui/kernel/qopenglcontext_p.h | 4 | ||||
| -rw-r--r-- | src/gui/opengl/opengl.pri | 69 | ||||
| -rw-r--r-- | src/opengl/.prev_CMakeLists.txt | 44 | ||||
| -rw-r--r-- | src/opengl/CMakeLists.txt | 34 | ||||
| -rw-r--r-- | src/opengl/doc/src/dontdocument.qdoc | 59 | ||||
| -rw-r--r-- | src/opengl/opengl.pro | 67 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_0.cpp (renamed from src/gui/opengl/qopenglfunctions_1_0.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_0.h (renamed from src/gui/opengl/qopenglfunctions_1_0.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_1.cpp (renamed from src/gui/opengl/qopenglfunctions_1_1.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_1.h (renamed from src/gui/opengl/qopenglfunctions_1_1.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_2.cpp (renamed from src/gui/opengl/qopenglfunctions_1_2.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_2.h (renamed from src/gui/opengl/qopenglfunctions_1_2.h) | 12 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_3.cpp (renamed from src/gui/opengl/qopenglfunctions_1_3.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_3.h (renamed from src/gui/opengl/qopenglfunctions_1_3.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_4.cpp (renamed from src/gui/opengl/qopenglfunctions_1_4.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_4.h (renamed from src/gui/opengl/qopenglfunctions_1_4.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_5.cpp (renamed from src/gui/opengl/qopenglfunctions_1_5.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_1_5.h (renamed from src/gui/opengl/qopenglfunctions_1_5.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_2_0.cpp (renamed from src/gui/opengl/qopenglfunctions_2_0.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_2_0.h (renamed from src/gui/opengl/qopenglfunctions_2_0.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_2_1.cpp (renamed from src/gui/opengl/qopenglfunctions_2_1.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_2_1.h (renamed from src/gui/opengl/qopenglfunctions_2_1.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_0.cpp (renamed from src/gui/opengl/qopenglfunctions_3_0.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_0.h (renamed from src/gui/opengl/qopenglfunctions_3_0.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_1.cpp (renamed from src/gui/opengl/qopenglfunctions_3_1.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_1.h (renamed from src/gui/opengl/qopenglfunctions_3_1.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_2_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_2_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_3_2_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_2_core.cpp (renamed from src/gui/opengl/qopenglfunctions_3_2_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_2_core.h (renamed from src/gui/opengl/qopenglfunctions_3_2_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_3_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_3_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_3_3_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_3_core.cpp (renamed from src/gui/opengl/qopenglfunctions_3_3_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_3_3_core.h (renamed from src/gui/opengl/qopenglfunctions_3_3_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_0_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_0_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_4_0_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_0_core.cpp (renamed from src/gui/opengl/qopenglfunctions_4_0_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_0_core.h (renamed from src/gui/opengl/qopenglfunctions_4_0_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_1_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_1_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_4_1_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_1_core.cpp (renamed from src/gui/opengl/qopenglfunctions_4_1_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_1_core.h (renamed from src/gui/opengl/qopenglfunctions_4_1_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_2_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_2_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_4_2_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_2_core.cpp (renamed from src/gui/opengl/qopenglfunctions_4_2_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_2_core.h (renamed from src/gui/opengl/qopenglfunctions_4_2_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_3_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_3_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_4_3_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_3_core.cpp (renamed from src/gui/opengl/qopenglfunctions_4_3_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_3_core.h (renamed from src/gui/opengl/qopenglfunctions_4_3_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_4_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_4_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_4_4_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_4_core.cpp (renamed from src/gui/opengl/qopenglfunctions_4_4_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_4_core.h (renamed from src/gui/opengl/qopenglfunctions_4_4_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_5_compatibility.cpp (renamed from src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_5_compatibility.h (renamed from src/gui/opengl/qopenglfunctions_4_5_compatibility.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_5_core.cpp (renamed from src/gui/opengl/qopenglfunctions_4_5_core.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_4_5_core.h (renamed from src/gui/opengl/qopenglfunctions_4_5_core.h) | 11 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_es2.cpp (renamed from src/gui/opengl/qopenglfunctions_es2.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglfunctions_es2.h (renamed from src/gui/opengl/qopenglfunctions_es2.h) | 9 | ||||
| -rw-r--r-- | src/opengl/qopenglshaderprogram.cpp | 5 | ||||
| -rw-r--r-- | src/opengl/qopenglversionfunctions.cpp (renamed from src/gui/opengl/qopenglversionfunctions.cpp) | 40 | ||||
| -rw-r--r-- | src/opengl/qopenglversionfunctions.h (renamed from src/gui/opengl/qopenglversionfunctions.h) | 8 | ||||
| -rw-r--r-- | src/opengl/qopenglversionfunctions_p.h (renamed from src/gui/opengl/qopenglversionfunctionsfactory_p.h) | 28 | ||||
| -rw-r--r-- | src/opengl/qopenglversionfunctionsfactory.cpp (renamed from src/gui/opengl/qopenglversionfunctionsfactory.cpp) | 123 | ||||
| -rw-r--r-- | src/opengl/qopenglversionfunctionsfactory.h | 74 | ||||
| -rw-r--r-- | src/opengl/qopenglversionprofile.cpp (renamed from src/gui/opengl/qopenglversionprofile.cpp) | 4 | ||||
| -rw-r--r-- | src/opengl/qopenglversionprofile.h (renamed from src/gui/opengl/qopenglversionprofile.h) | 12 | ||||
| -rw-r--r-- | src/opengl/qopenglvertexarrayobject.cpp | 9 | ||||
| -rw-r--r-- | src/opengl/qtopenglglobal.h | 1 | ||||
| -rw-r--r-- | tests/auto/gui/qopengl/tst_qopengl.cpp | 5 | 
76 files changed, 683 insertions, 592 deletions
diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt index 7754f19d49e..d1464e29669 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 eaf24bc658d..1d67aa5bc0f 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 6b50daba884..67116443596 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 b0474ceb3d8..a004d9e10de 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -54,15 +54,9 @@  #include <qpa/qplatformnativeinterface.h>  #include <private/qopenglextensions_p.h> -#include <private/qopenglversionfunctionsfactory_p.h>  #include <QDebug> -#ifndef QT_OPENGL_ES_2 -#include <QOpenGLFunctions_1_0> -#include <QOpenGLFunctions_3_2_Core> -#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; @@ -589,115 +574,6 @@ QOpenGLExtraFunctions *QOpenGLContext::extraFunctions() const  }  /*! -    \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<QOpenGLFunctions_3_3_Core>(); -        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<int, int> 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.      The context or a sharing context must be current. @@ -1146,33 +1022,6 @@ QOpenGLContext *QOpenGLContext::globalShareContext()  /*!      \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 -*/  QOpenGLTextureHelper* QOpenGLContext::textureFunctions() const  {      Q_D(const QOpenGLContext); diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index b26a3e2ede7..a0d8a3edbac 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -58,9 +58,6 @@  #endif  #include <QtGui/qopengl.h> -#include <QtGui/qopenglversionfunctions.h> -// TODO: ideally get rid of this include -#include <QtGui/qopenglversionprofile.h>  #include <QtCore/qvariant.h> @@ -141,15 +138,6 @@ public:      QOpenGLFunctions *functions() const;      QOpenGLExtraFunctions *extraFunctions() const; -    QAbstractOpenGLFunctions *versionFunctions(const QOpenGLVersionProfile &versionProfile = QOpenGLVersionProfile()) const; - -    template<class TYPE> -    TYPE *versionFunctions() const -    { -        QOpenGLVersionProfile v = TYPE::versionProfile(); -        return static_cast<TYPE*>(versionFunctions(v)); -    } -      QSet<QByteArray> 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<void()> destroyCallback); diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index d769f03fd3b..c017bf9a345 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -222,10 +222,6 @@ public:          //QWidgetPrivate::deleteTLSysExtra()      } -    mutable QHash<QOpenGLVersionProfile, QAbstractOpenGLFunctions *> versionFunctions; -    mutable QOpenGLVersionFunctionsStorage versionFunctionsStorage; -    mutable QSet<QAbstractOpenGLFunctions *> externalVersionFunctions; -      QSurfaceFormat requestedFormat;      QPlatformOpenGLContext *platformGLContext;      QOpenGLContext *shareContext; diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri index 2ca3809b4bc..85fdb609cd0 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 eb125273bc9..569fe18fc43 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 18378a75641..c0acee56e50 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 00000000000..72e997d9331 --- /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 bf4ba63053b..777bca40ec2 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 index f9d93ce2105..f440764df83 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 index cddb7251ed3..cd945126145 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index b0f7538d48f..78601237572 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 index 8a9f16ec4c3..f24150fae76 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 5f137b0237b..5993210674f 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 index 7daca0923dd..623b2b89d5c 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile>  #include <QtGui/qopenglcontext.h>  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 index 0b5ff2fee5f..41ef4d4cf35 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 index b527b579463..6c7ef74323a 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 9419c1aa85b..92a331d7759 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 index 1f3f5a9c0a0..d59b283c170 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 3fa7668a368..d304679409c 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 index d2f5311211e..9600632e9d0 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 29eb055a1d6..63bfe641f26 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 index 556597a9b3c..7b5e580d3dd 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 8a7170dd7d7..1eb8d2a95cb 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 index f053222c710..323ba1e03d7 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 7d0e9006594..9d933b50d59 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 index c592050c249..ffc9121472f 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index c25b124af8b..353ddf35ab5 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 index 3a8d3891f3f..8bc4f69e328 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 3e4fd96dc2f..92c7b6e3ba1 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 index 391e7259532..f4ce56f27d7 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index ea89fc9e48c..5f7d32fb611 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 index 1eafb6f4411..4fad8f5e591 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index a26d7d99b11..9b9617c1e70 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 index 185dd5aab48..971f4a58f4b 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 277ad1eb14a..78a2e8b5684 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 index 47d54d717eb..6f80adfe20b 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 655f1e6fd43..e94a0bf5abd 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 index c0e42443d36..c8900ab5992 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 60453d147ce..a5fc44f31dc 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 index 6cb55e86f75..aac7880592b 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index bdea8b5ba9a..6198412ebcf 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 index bee169b50c2..e54f103151a 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index b21742d9c1c..81eedaa7bb3 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 index 3a4fd0743bc..6a18d42479e 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 41ab9ae7627..f04a30854b0 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 index a48d581c2de..08dd30864bd 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  // 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 index 38dbe1b5965..15d7eba25ad 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 index 5ca98e98089..5eff9f449ca 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  // 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 index 1b23d08ee2e..d17a4adb106 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 index d969f5b3b45..dc8eb32842a 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  // 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 index 8a867471b8d..72c09db0769 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 index 13675caf62b..4bbcb4fc462 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  // 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 index 4fc4b501000..38348869db2 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 index 0acab349a14..6e5772ba4ce 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 index 6169c7f4552..e0a78e1527e 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 index 1ad6f402146..85229bff60a 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  // 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 index 02af443498e..253b3054520 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 index 9d9d14548bf..766fe9105ec 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  // 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 index 9c0369e5f23..b680629e913 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 index bf872c628b3..3fe64d2d259 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  // 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 index dd2b3af80ba..39d86e647f4 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 index 851eb5951b6..e3c4ad5c2c0 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #if defined(QT_OPENGL_ES_2) || defined(Q_QDOC) -#include <QtGui/QOpenGLVersionFunctions> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtOpenGL/QOpenGLVersionFunctions>  #include <QtGui/qopenglcontext.h>  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 c5e61859ee1..72ddea3a9eb 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 <QtOpenGL/QOpenGLVersionFunctionsFactory>  #include <QtCore/private/qobject_p.h>  #include <QtCore/qdebug.h>  #include <QtCore/qfile.h> @@ -52,7 +53,7 @@  #include <QtGui/QSurfaceFormat>  #if !defined(QT_OPENGL_ES_2) -#include <QtGui/qopenglfunctions_4_0_core.h> +#include <QtOpenGL/qopenglfunctions_4_0_core.h>  #endif  #include <algorithm> @@ -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<QOpenGLFunctions_4_0_Core>(); +        d->tessellationFuncs = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_0_Core>(context);          d->tessellationFuncs->initializeOpenGLFunctions();      }  #endif diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/opengl/qopenglversionfunctions.cpp index 5a108335a93..016683a3f24 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<QOpenGLContext *, QOpenGLContextVersionData *> 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 index f31db081bf4..47e7e37d3a5 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #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 index 469a9cc6242..1458edf322e 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 <QtGui/private/qtguiglobal_p.h> +#include "qopenglversionfunctions.h" -#ifndef QT_NO_OPENGL - -#include <QtGui/qopenglcontext.h> +#include <QtOpenGL/qtopenglglobal.h> +#include <QtOpenGL/QOpenGLVersionProfile> +#include <QtCore/QSet>  QT_BEGIN_NAMESPACE  class QAbstractOpenGLFunctions; -class QOpenGLVersionFunctionsFactory -{ +class QOpenGLContextVersionData {  public: -    static QAbstractOpenGLFunctions *create(const QOpenGLVersionProfile &versionProfile); +    QHash<QOpenGLVersionProfile, QAbstractOpenGLFunctions *> functions; +    QOpenGLVersionFunctionsStorage functionsStorage; +    QSet<QAbstractOpenGLFunctions *> externalFunctions; +    // TODO: who calls delete? +    ~QOpenGLContextVersionData(); +    static QOpenGLContextVersionData *forContext(QOpenGLContext *context); +private: +    static QMap<QOpenGLContext *, QOpenGLContextVersionData *> contextData;  };  QT_END_NAMESPACE -#endif // QT_NO_OPENGL -  #endif diff --git a/src/gui/opengl/qopenglversionfunctionsfactory.cpp b/src/opengl/qopenglversionfunctionsfactory.cpp index ca7daedf34f..de7fe6c07ff 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<QOpenGLFunctions_3_3_Core>(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<int, int> 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 00000000000..0445c2e03d0 --- /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 <QtOpenGL/qtopenglglobal.h> +#include <QtOpenGL/qopenglversionprofile.h> + +QT_BEGIN_NAMESPACE + +class QAbstractOpenGLFunctions; +class QOpenGLContext; + +class Q_OPENGL_EXPORT QOpenGLVersionFunctionsFactory +{ +public: +    static QAbstractOpenGLFunctions *get(const QOpenGLVersionProfile &versionProfile = QOpenGLVersionProfile(), QOpenGLContext *context = nullptr); +    template<class TYPE> +    static TYPE *get(QOpenGLContext *context = nullptr) +    { +        QOpenGLVersionProfile v = TYPE::versionProfile(); +        return static_cast<TYPE*>(get(v, context)); +    } +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/gui/opengl/qopenglversionprofile.cpp b/src/opengl/qopenglversionprofile.cpp index 4e728f94052..afda77857e4 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 index 7315f1a2cb0..fdc531692a7 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 <QtGui/qtguiglobal.h> +#include <QtOpenGL/qtopenglglobal.h>  #include <QtGui/QSurfaceFormat> @@ -50,14 +50,12 @@  #endif  #include <QtCore/qhashfunctions.h> -#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 a6ac282d4c0..e4bd24ef581 100644 --- a/src/opengl/qopenglvertexarrayobject.cpp +++ b/src/opengl/qopenglvertexarrayobject.cpp @@ -45,8 +45,9 @@  #include <QtGui/qoffscreensurface.h>  #include <QtGui/qguiapplication.h> -#include <QtGui/qopenglfunctions_3_0.h> -#include <QtGui/qopenglfunctions_3_2_core.h> +#include <QtOpenGL/QOpenGLVersionFunctionsFactory> +#include <QtOpenGL/qopenglfunctions_3_0.h> +#include <QtOpenGL/qopenglfunctions_3_2_core.h>  #include <private/qopenglextensions_p.h>  #include <private/qopenglvertexarrayobject_p.h> @@ -172,11 +173,11 @@ bool QOpenGLVertexArrayObjectPrivate::create()          QSurfaceFormat format = ctx->format();  #ifndef QT_OPENGL_ES_2          if (format.version() >= qMakePair<int, int>(3,2)) { -            vaoFuncs.core_3_2 = ctx->versionFunctions<QOpenGLFunctions_3_2_Core>(); +            vaoFuncs.core_3_2 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_2_Core>(ctx);              vaoFuncsType = Core_3_2;              vaoFuncs.core_3_2->glGenVertexArrays(1, &vao);          } else if (format.majorVersion() >= 3) { -            vaoFuncs.core_3_0 = ctx->versionFunctions<QOpenGLFunctions_3_0>(); +            vaoFuncs.core_3_0 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_0>(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 0e821f87b81..861fb16d590 100644 --- a/src/opengl/qtopenglglobal.h +++ b/src/opengl/qtopenglglobal.h @@ -41,6 +41,7 @@  #define QTOPENGLGLOBAL_H  #include <QtCore/qglobal.h> +#include <QtGui/qtguiglobal.h>  QT_BEGIN_NAMESPACE diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index ad0dfb5c08d..ca12461efaa 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -32,9 +32,10 @@  #include <QtOpenGL/qopengltextureblitter.h>  #include <QtOpenGL/QOpenGLVertexArrayObject>  #include <QtOpenGL/QOpenGLBuffer> +#include <QtOpenGL/QOpenGLFunctions_4_2_Core> +#include <QtOpenGL/QOpenGLVersionFunctionsFactory>  #include <QtGui/private/qopenglcontext_p.h>  #include <QtGui/QOpenGLFunctions> -#include <QtGui/QOpenGLFunctions_4_2_Core>  #include <QtGui/QPainter>  #include <QtGui/QPainterPath>  #include <QtGui/QScreen> @@ -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<QOpenGLFunctions_4_2_Core>(); +        auto *vFuncs = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_2_Core>(ctx);          if (vFuncs && vFuncs->initializeOpenGLFunctions()) {              vFuncs->glGetInternalformativ(GL_TEXTURE_2D, glFormat, GL_FRAMEBUFFER_RENDERABLE, 1, &value);              if (value != GL_FULL_SUPPORT)  | 
