summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-01-22 17:01:30 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-04-16 07:14:51 +0200
commit73f3f501f331444b3f188b21db7265f723e4f383 (patch)
tree06eb8f50e1cbb71579210c678089e169cacb4977 /src
parentca635c659c9d3d7418779a48b70b471abe25c577 (diff)
Move versioned OpenGL functions from QtGui to QtOpenGL
The context—which lives in QtGui—now knows nothing about versioned functions. This changes the public API for getting version functions for a context. [ChangeLog][QtGui][OpenGL] QOpenGLContext::versionFunctions() has been removed. QOpenGLVersionFunctionsFactory::get() from the QtOpenGL module should be used instead. Previously one would call context->versionFunctions<QOpenGLFunctions_4_0_Core>(); Which now becomes QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_0_Core>(context); The rest of the API should be identical. Since glgen no longer compiles, and the links to its input (gl.spec and gl.tm) are dead, I've edited the previously generated files manually. If glgen is fixed, it should be quite easy to make it generate the new way. Task-number: QTBUG-74409 Change-Id: I800527e0af16a79005b276eeb74417770193c62f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/.prev_CMakeLists.txt44
-rw-r--r--src/gui/CMakeLists.txt44
-rw-r--r--src/gui/doc/src/dontdocument.qdoc30
-rw-r--r--src/gui/kernel/qopenglcontext.cpp151
-rw-r--r--src/gui/kernel/qopenglcontext.h16
-rw-r--r--src/gui/kernel/qopenglcontext_p.h4
-rw-r--r--src/gui/opengl/opengl.pri69
-rw-r--r--src/opengl/.prev_CMakeLists.txt44
-rw-r--r--src/opengl/CMakeLists.txt34
-rw-r--r--src/opengl/doc/src/dontdocument.qdoc59
-rw-r--r--src/opengl/opengl.pro67
-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.cpp5
-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.h74
-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.cpp9
-rw-r--r--src/opengl/qtopenglglobal.h1
75 files changed, 680 insertions, 590 deletions
diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt
index 7754f19d49..d1464e2966 100644
--- a/src/gui/.prev_CMakeLists.txt
+++ b/src/gui/.prev_CMakeLists.txt
@@ -260,9 +260,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_opengl
opengl/qopenglextrafunctions.h
opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h
opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h
- opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h
- opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h
- opengl/qopenglversionprofile.cpp opengl/qopenglversionprofile.h
rhi/qrhigles2.cpp rhi/qrhigles2_p.h
rhi/qrhigles2_p_p.h
)
@@ -569,41 +566,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_undogroup
util/qundogroup.cpp util/qundogroup.h
)
-qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2
- SOURCES
- opengl/qopenglfunctions_1_0.cpp opengl/qopenglfunctions_1_0.h
- opengl/qopenglfunctions_1_1.cpp opengl/qopenglfunctions_1_1.h
- opengl/qopenglfunctions_1_2.cpp opengl/qopenglfunctions_1_2.h
- opengl/qopenglfunctions_1_3.cpp opengl/qopenglfunctions_1_3.h
- opengl/qopenglfunctions_1_4.cpp opengl/qopenglfunctions_1_4.h
- opengl/qopenglfunctions_1_5.cpp opengl/qopenglfunctions_1_5.h
- opengl/qopenglfunctions_2_0.cpp opengl/qopenglfunctions_2_0.h
- opengl/qopenglfunctions_2_1.cpp opengl/qopenglfunctions_2_1.h
- opengl/qopenglfunctions_3_0.cpp opengl/qopenglfunctions_3_0.h
- opengl/qopenglfunctions_3_1.cpp opengl/qopenglfunctions_3_1.h
- opengl/qopenglfunctions_3_2_compatibility.cpp opengl/qopenglfunctions_3_2_compatibility.h
- opengl/qopenglfunctions_3_2_core.cpp opengl/qopenglfunctions_3_2_core.h
- opengl/qopenglfunctions_3_3_compatibility.cpp opengl/qopenglfunctions_3_3_compatibility.h
- opengl/qopenglfunctions_3_3_core.cpp opengl/qopenglfunctions_3_3_core.h
- opengl/qopenglfunctions_4_0_compatibility.cpp opengl/qopenglfunctions_4_0_compatibility.h
- opengl/qopenglfunctions_4_0_core.cpp opengl/qopenglfunctions_4_0_core.h
- opengl/qopenglfunctions_4_1_compatibility.cpp opengl/qopenglfunctions_4_1_compatibility.h
- opengl/qopenglfunctions_4_1_core.cpp opengl/qopenglfunctions_4_1_core.h
- opengl/qopenglfunctions_4_2_compatibility.cpp opengl/qopenglfunctions_4_2_compatibility.h
- opengl/qopenglfunctions_4_2_core.cpp opengl/qopenglfunctions_4_2_core.h
- opengl/qopenglfunctions_4_3_compatibility.cpp opengl/qopenglfunctions_4_3_compatibility.h
- opengl/qopenglfunctions_4_3_core.cpp opengl/qopenglfunctions_4_3_core.h
- opengl/qopenglfunctions_4_4_compatibility.cpp opengl/qopenglfunctions_4_4_compatibility.h
- opengl/qopenglfunctions_4_4_core.cpp opengl/qopenglfunctions_4_4_core.h
- opengl/qopenglfunctions_4_5_compatibility.cpp opengl/qopenglfunctions_4_5_compatibility.h
- opengl/qopenglfunctions_4_5_core.cpp opengl/qopenglfunctions_4_5_core.h
-)
-
-qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2
- SOURCES
- opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h
-)
-
qt_extend_target(Gui CONDITION QT_FEATURE_vulkan
SOURCES
rhi/qrhivulkan.cpp rhi/qrhivulkan_p.h
@@ -616,7 +578,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan
Vulkan::Vulkan_nolink
)
-#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen:
+#### Keys ignored in scope 82:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen:
# QMAKE_EXTRA_COMPILERS = "qvkgen_h" "qvkgen_ph" "qvkgen_pimpl"
# QMAKE_QVKGEN_INPUT = "vulkan/vk.xml"
# QMAKE_QVKGEN_LICENSE_HEADER = "$$QT_SOURCE_TREE/header.LGPL"
@@ -632,10 +594,10 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan
# qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT"
# qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp"
-#### Keys ignored in scope 85:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan:
+#### Keys ignored in scope 83:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan:
# qvkgen_h.variable_out = "HEADERS"
-#### Keys ignored in scope 86:.:vulkan:vulkan/vulkan.pri:else:
+#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:else:
# qvkgen_h.CONFIG = "target_predeps" "no_link"
qt_extend_target(Gui CONDITION WASM
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index eaf24bc658..1d67aa5bc0 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -353,9 +353,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_opengl
opengl/qopenglextrafunctions.h
opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h
opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h
- opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h
- opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h
- opengl/qopenglversionprofile.cpp opengl/qopenglversionprofile.h
rhi/qrhigles2.cpp rhi/qrhigles2_p.h
rhi/qrhigles2_p_p.h
)
@@ -681,41 +678,6 @@ qt_extend_target(Gui CONDITION QT_FEATURE_undogroup
util/qundogroup.cpp util/qundogroup.h
)
-qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2
- SOURCES
- opengl/qopenglfunctions_1_0.cpp opengl/qopenglfunctions_1_0.h
- opengl/qopenglfunctions_1_1.cpp opengl/qopenglfunctions_1_1.h
- opengl/qopenglfunctions_1_2.cpp opengl/qopenglfunctions_1_2.h
- opengl/qopenglfunctions_1_3.cpp opengl/qopenglfunctions_1_3.h
- opengl/qopenglfunctions_1_4.cpp opengl/qopenglfunctions_1_4.h
- opengl/qopenglfunctions_1_5.cpp opengl/qopenglfunctions_1_5.h
- opengl/qopenglfunctions_2_0.cpp opengl/qopenglfunctions_2_0.h
- opengl/qopenglfunctions_2_1.cpp opengl/qopenglfunctions_2_1.h
- opengl/qopenglfunctions_3_0.cpp opengl/qopenglfunctions_3_0.h
- opengl/qopenglfunctions_3_1.cpp opengl/qopenglfunctions_3_1.h
- opengl/qopenglfunctions_3_2_compatibility.cpp opengl/qopenglfunctions_3_2_compatibility.h
- opengl/qopenglfunctions_3_2_core.cpp opengl/qopenglfunctions_3_2_core.h
- opengl/qopenglfunctions_3_3_compatibility.cpp opengl/qopenglfunctions_3_3_compatibility.h
- opengl/qopenglfunctions_3_3_core.cpp opengl/qopenglfunctions_3_3_core.h
- opengl/qopenglfunctions_4_0_compatibility.cpp opengl/qopenglfunctions_4_0_compatibility.h
- opengl/qopenglfunctions_4_0_core.cpp opengl/qopenglfunctions_4_0_core.h
- opengl/qopenglfunctions_4_1_compatibility.cpp opengl/qopenglfunctions_4_1_compatibility.h
- opengl/qopenglfunctions_4_1_core.cpp opengl/qopenglfunctions_4_1_core.h
- opengl/qopenglfunctions_4_2_compatibility.cpp opengl/qopenglfunctions_4_2_compatibility.h
- opengl/qopenglfunctions_4_2_core.cpp opengl/qopenglfunctions_4_2_core.h
- opengl/qopenglfunctions_4_3_compatibility.cpp opengl/qopenglfunctions_4_3_compatibility.h
- opengl/qopenglfunctions_4_3_core.cpp opengl/qopenglfunctions_4_3_core.h
- opengl/qopenglfunctions_4_4_compatibility.cpp opengl/qopenglfunctions_4_4_compatibility.h
- opengl/qopenglfunctions_4_4_core.cpp opengl/qopenglfunctions_4_4_core.h
- opengl/qopenglfunctions_4_5_compatibility.cpp opengl/qopenglfunctions_4_5_compatibility.h
- opengl/qopenglfunctions_4_5_core.cpp opengl/qopenglfunctions_4_5_core.h
-)
-
-qt_extend_target(Gui CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2
- SOURCES
- opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h
-)
-
qt_extend_target(Gui CONDITION QT_FEATURE_vulkan
SOURCES
rhi/qrhivulkan.cpp rhi/qrhivulkan_p.h
@@ -728,7 +690,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan
Vulkan::Vulkan_nolink
)
-#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen:
+#### Keys ignored in scope 82:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen:
# special case begin
# We must always generate syncqt-injected header files,
# because we added a custom command earlier for those for framework builds.
@@ -784,10 +746,10 @@ add_custom_command(
# qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT"
# qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp"
-#### Keys ignored in scope 85:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan:
+#### Keys ignored in scope 83:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan:
# qvkgen_h.variable_out = "HEADERS"
-#### Keys ignored in scope 86:.:vulkan:vulkan/vulkan.pri:else:
+#### Keys ignored in scope 84:.:vulkan:vulkan/vulkan.pri:else:
# qvkgen_h.CONFIG = "target_predeps" "no_link"
qt_extend_target(Gui CONDITION WASM
diff --git a/src/gui/doc/src/dontdocument.qdoc b/src/gui/doc/src/dontdocument.qdoc
index 6b50daba88..6711644359 100644
--- a/src/gui/doc/src/dontdocument.qdoc
+++ b/src/gui/doc/src/dontdocument.qdoc
@@ -28,36 +28,6 @@
/*!
\dontdocument (QTypeInfo QScreenOrientationChangeEvent QApplicationStateChangeEvent
QMetaTypeId QAbstractUndoItem
- QOpenGLVersionStatus
- QOpenGLVersionFunctionsBackend
- QOpenGLVersionFunctionsStorage
- QOpenGLFunctions_1_0_CoreBackend
- QOpenGLFunctions_1_1_CoreBackend
- QOpenGLFunctions_1_2_CoreBackend
- QOpenGLFunctions_1_3_CoreBackend
- QOpenGLFunctions_1_4_CoreBackend
- QOpenGLFunctions_1_5_CoreBackend
- QOpenGLFunctions_2_0_CoreBackend
- QOpenGLFunctions_2_1_CoreBackend
- QOpenGLFunctions_3_0_CoreBackend
- QOpenGLFunctions_3_1_CoreBackend
- QOpenGLFunctions_3_2_CoreBackend
- QOpenGLFunctions_3_3_CoreBackend
- QOpenGLFunctions_4_0_CoreBackend
- QOpenGLFunctions_4_1_CoreBackend
- QOpenGLFunctions_4_2_CoreBackend
- QOpenGLFunctions_4_3_CoreBackend
- QOpenGLFunctions_4_4_CoreBackend
- QOpenGLFunctions_4_5_CoreBackend
- QOpenGLFunctions_1_0_DeprecatedBackend
- QOpenGLFunctions_1_1_DeprecatedBackend
- QOpenGLFunctions_1_2_DeprecatedBackend
- QOpenGLFunctions_1_3_DeprecatedBackend
- QOpenGLFunctions_1_4_DeprecatedBackend
- QOpenGLFunctions_2_0_DeprecatedBackend
- QOpenGLFunctions_3_0_DeprecatedBackend
- QOpenGLFunctions_3_3_DeprecatedBackend
- QOpenGLFunctions_4_5_DeprecatedBackend
QTextFrameLayoutData QPlatformDropQtResponse QPlatformDragQtResponse
QPlatformOffscreenSurface QColorDialogOptions QFontDialogOptions
QFileDialogOptions QMessageDialogOptions QMessageDialogOptions::CustomButton
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index b0474ceb3d..a004d9e10d 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -54,15 +54,9 @@
#include <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 b26a3e2ede..a0d8a3edba 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 d769f03fd3..c017bf9a34 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -222,10 +222,6 @@ public:
//QWidgetPrivate::deleteTLSysExtra()
}
- mutable QHash<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 2ca3809b4b..85fdb609cd 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -4,83 +4,14 @@ qtConfig(opengl): CONFIG += opengl
qtConfig(opengles2): CONFIG += opengles2
qtConfig(opengl) {
-
HEADERS += opengl/qopengl.h \
opengl/qopengl_p.h \
opengl/qopenglfunctions.h \
opengl/qopenglextensions_p.h \
- opengl/qopenglversionfunctions.h \
- opengl/qopenglversionfunctionsfactory_p.h \
- opengl/qopenglversionprofile.h \
opengl/qopenglextrafunctions.h \
opengl/qopenglprogrambinarycache_p.h
SOURCES += opengl/qopengl.cpp \
opengl/qopenglfunctions.cpp \
- opengl/qopenglversionfunctions.cpp \
- opengl/qopenglversionfunctionsfactory.cpp \
- opengl/qopenglversionprofile.cpp \
opengl/qopenglprogrambinarycache.cpp
-
- !qtConfig(opengles2) {
- HEADERS += opengl/qopenglfunctions_1_0.h \
- opengl/qopenglfunctions_1_1.h \
- opengl/qopenglfunctions_1_2.h \
- opengl/qopenglfunctions_1_3.h \
- opengl/qopenglfunctions_1_4.h \
- opengl/qopenglfunctions_1_5.h \
- opengl/qopenglfunctions_2_0.h \
- opengl/qopenglfunctions_2_1.h \
- opengl/qopenglfunctions_3_0.h \
- opengl/qopenglfunctions_3_1.h \
- opengl/qopenglfunctions_3_2_core.h \
- opengl/qopenglfunctions_3_3_core.h \
- opengl/qopenglfunctions_4_0_core.h \
- opengl/qopenglfunctions_4_1_core.h \
- opengl/qopenglfunctions_4_2_core.h \
- opengl/qopenglfunctions_4_3_core.h \
- opengl/qopenglfunctions_4_4_core.h \
- opengl/qopenglfunctions_4_5_core.h \
- opengl/qopenglfunctions_3_2_compatibility.h \
- opengl/qopenglfunctions_3_3_compatibility.h \
- opengl/qopenglfunctions_4_0_compatibility.h \
- opengl/qopenglfunctions_4_1_compatibility.h \
- opengl/qopenglfunctions_4_2_compatibility.h \
- opengl/qopenglfunctions_4_3_compatibility.h \
- opengl/qopenglfunctions_4_4_compatibility.h \
- opengl/qopenglfunctions_4_5_compatibility.h
-
- SOURCES += opengl/qopenglfunctions_1_0.cpp \
- opengl/qopenglfunctions_1_1.cpp \
- opengl/qopenglfunctions_1_2.cpp \
- opengl/qopenglfunctions_1_3.cpp \
- opengl/qopenglfunctions_1_4.cpp \
- opengl/qopenglfunctions_1_5.cpp \
- opengl/qopenglfunctions_2_0.cpp \
- opengl/qopenglfunctions_2_1.cpp \
- opengl/qopenglfunctions_3_0.cpp \
- opengl/qopenglfunctions_3_1.cpp \
- opengl/qopenglfunctions_3_2_core.cpp \
- opengl/qopenglfunctions_3_3_core.cpp \
- opengl/qopenglfunctions_4_0_core.cpp \
- opengl/qopenglfunctions_4_1_core.cpp \
- opengl/qopenglfunctions_4_2_core.cpp \
- opengl/qopenglfunctions_4_3_core.cpp \
- opengl/qopenglfunctions_4_4_core.cpp \
- opengl/qopenglfunctions_4_5_core.cpp \
- opengl/qopenglfunctions_3_2_compatibility.cpp \
- opengl/qopenglfunctions_3_3_compatibility.cpp \
- opengl/qopenglfunctions_4_0_compatibility.cpp \
- opengl/qopenglfunctions_4_1_compatibility.cpp \
- opengl/qopenglfunctions_4_2_compatibility.cpp \
- opengl/qopenglfunctions_4_3_compatibility.cpp \
- opengl/qopenglfunctions_4_4_compatibility.cpp \
- opengl/qopenglfunctions_4_5_compatibility.cpp
- }
-
- qtConfig(opengles2) {
- HEADERS += opengl/qopenglfunctions_es2.h
-
- SOURCES += opengl/qopenglfunctions_es2.cpp
- }
}
diff --git a/src/opengl/.prev_CMakeLists.txt b/src/opengl/.prev_CMakeLists.txt
index eb125273bc..569fe18fc4 100644
--- a/src/opengl/.prev_CMakeLists.txt
+++ b/src/opengl/.prev_CMakeLists.txt
@@ -7,20 +7,28 @@
qt_add_module(OpenGL
SOURCES
qopengl2pexvertexarray.cpp qopengl2pexvertexarray_p.h
+ qopenglbuffer.cpp qopenglbuffer.h
qopenglcustomshaderstage.cpp qopenglcustomshaderstage_p.h
qopengldebug.cpp qopengldebug.h
qopenglengineshadermanager.cpp qopenglengineshadermanager_p.h
qopenglengineshadersource_p.h
+ qopenglframebufferobject.cpp qopenglframebufferobject.h qopenglframebufferobject_p.h
qopenglgradientcache.cpp qopenglgradientcache_p.h
qopenglpaintdevice.cpp qopenglpaintdevice.h qopenglpaintdevice_p.h
qopenglpaintengine.cpp qopenglpaintengine_p.h
qopenglpixeltransferoptions.cpp qopenglpixeltransferoptions.h
qopenglshadercache_p.h
+ qopenglshaderprogram.cpp qopenglshaderprogram.h
qopengltexture.cpp qopengltexture.h qopengltexture_p.h
+ qopengltextureblitter.cpp qopengltextureblitter.h
qopengltexturecache.cpp qopengltexturecache_p.h
qopengltextureglyphcache.cpp qopengltextureglyphcache_p.h
qopengltexturehelper.cpp qopengltexturehelper_p.h
qopengltextureuploader.cpp qopengltextureuploader_p.h
+ qopenglversionfunctions.cpp qopenglversionfunctions.h qopenglversionfunctions_p.h
+ qopenglversionfunctionsfactory.cpp qopenglversionfunctionsfactory.h
+ qopenglversionprofile.cpp qopenglversionprofile.h
+ qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h
qopenglwindow.cpp qopenglwindow.h
qtopenglglobal.h
DEFINES
@@ -40,19 +48,39 @@ qt_add_module(OpenGL
## Scopes:
#####################################################################
-qt_extend_target(OpenGL CONDITION QT_FEATURE_widgets
+qt_extend_target(OpenGL CONDITION QT_FEATURE_opengles2
SOURCES
- qopenglwidget.cpp qopenglwidget.h
- LIBRARIES
- Qt::WidgetsPrivate
- PUBLIC_LIBRARIES
- Qt::Widgets
- PRIVATE_MODULE_INTERFACE
- Qt::WidgetsPrivate
+ opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h
)
qt_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
SOURCES
+ qopenglfunctions_1_0.cpp qopenglfunctions_1_0.h
+ qopenglfunctions_1_1.cpp qopenglfunctions_1_1.h
+ qopenglfunctions_1_2.cpp qopenglfunctions_1_2.h
+ qopenglfunctions_1_3.cpp qopenglfunctions_1_3.h
+ qopenglfunctions_1_4.cpp qopenglfunctions_1_4.h
+ qopenglfunctions_1_5.cpp qopenglfunctions_1_5.h
+ qopenglfunctions_2_0.cpp qopenglfunctions_2_0.h
+ qopenglfunctions_2_1.cpp qopenglfunctions_2_1.h
+ qopenglfunctions_3_0.cpp qopenglfunctions_3_0.h
+ qopenglfunctions_3_1.cpp qopenglfunctions_3_1.h
+ qopenglfunctions_3_2_compatibility.cpp qopenglfunctions_3_2_compatibility.h
+ qopenglfunctions_3_2_core.cpp qopenglfunctions_3_2_core.h
+ qopenglfunctions_3_3_compatibility.cpp qopenglfunctions_3_3_compatibility.h
+ qopenglfunctions_3_3_core.cpp qopenglfunctions_3_3_core.h
+ qopenglfunctions_4_0_compatibility.cpp qopenglfunctions_4_0_compatibility.h
+ qopenglfunctions_4_0_core.cpp qopenglfunctions_4_0_core.h
+ qopenglfunctions_4_1_compatibility.cpp qopenglfunctions_4_1_compatibility.h
+ qopenglfunctions_4_1_core.cpp qopenglfunctions_4_1_core.h
+ qopenglfunctions_4_2_compatibility.cpp qopenglfunctions_4_2_compatibility.h
+ qopenglfunctions_4_2_core.cpp qopenglfunctions_4_2_core.h
+ qopenglfunctions_4_3_compatibility.cpp qopenglfunctions_4_3_compatibility.h
+ qopenglfunctions_4_3_core.cpp qopenglfunctions_4_3_core.h
+ qopenglfunctions_4_4_compatibility.cpp qopenglfunctions_4_4_compatibility.h
+ qopenglfunctions_4_4_core.cpp qopenglfunctions_4_4_core.h
+ qopenglfunctions_4_5_compatibility.cpp qopenglfunctions_4_5_compatibility.h
+ qopenglfunctions_4_5_core.cpp qopenglfunctions_4_5_core.h
qopenglqueryhelper_p.h
qopengltimerquery.cpp qopengltimerquery.h
)
diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt
index 18378a7564..c0acee56e5 100644
--- a/src/opengl/CMakeLists.txt
+++ b/src/opengl/CMakeLists.txt
@@ -25,6 +25,9 @@ qt_add_module(OpenGL
qopengltextureglyphcache.cpp qopengltextureglyphcache_p.h
qopengltexturehelper.cpp qopengltexturehelper_p.h
qopengltextureuploader.cpp qopengltextureuploader_p.h
+ qopenglversionfunctions.cpp qopenglversionfunctions.h qopenglversionfunctions_p.h
+ qopenglversionfunctionsfactory.cpp qopenglversionfunctionsfactory.h
+ qopenglversionprofile.cpp qopenglversionprofile.h
qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h
qopenglwindow.cpp qopenglwindow.h
qtopenglglobal.h
@@ -45,8 +48,39 @@ qt_add_module(OpenGL
## Scopes:
#####################################################################
+qt_extend_target(OpenGL CONDITION QT_FEATURE_opengles2
+ SOURCES
+ qopenglfunctions_es2.cpp qopenglfunctions_es2.h
+)
+
qt_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
SOURCES
+ qopenglfunctions_1_0.cpp qopenglfunctions_1_0.h
+ qopenglfunctions_1_1.cpp qopenglfunctions_1_1.h
+ qopenglfunctions_1_2.cpp qopenglfunctions_1_2.h
+ qopenglfunctions_1_3.cpp qopenglfunctions_1_3.h
+ qopenglfunctions_1_4.cpp qopenglfunctions_1_4.h
+ qopenglfunctions_1_5.cpp qopenglfunctions_1_5.h
+ qopenglfunctions_2_0.cpp qopenglfunctions_2_0.h
+ qopenglfunctions_2_1.cpp qopenglfunctions_2_1.h
+ qopenglfunctions_3_0.cpp qopenglfunctions_3_0.h
+ qopenglfunctions_3_1.cpp qopenglfunctions_3_1.h
+ qopenglfunctions_3_2_compatibility.cpp qopenglfunctions_3_2_compatibility.h
+ qopenglfunctions_3_2_core.cpp qopenglfunctions_3_2_core.h
+ qopenglfunctions_3_3_compatibility.cpp qopenglfunctions_3_3_compatibility.h
+ qopenglfunctions_3_3_core.cpp qopenglfunctions_3_3_core.h
+ qopenglfunctions_4_0_compatibility.cpp qopenglfunctions_4_0_compatibility.h
+ qopenglfunctions_4_0_core.cpp qopenglfunctions_4_0_core.h
+ qopenglfunctions_4_1_compatibility.cpp qopenglfunctions_4_1_compatibility.h
+ qopenglfunctions_4_1_core.cpp qopenglfunctions_4_1_core.h
+ qopenglfunctions_4_2_compatibility.cpp qopenglfunctions_4_2_compatibility.h
+ qopenglfunctions_4_2_core.cpp qopenglfunctions_4_2_core.h
+ qopenglfunctions_4_3_compatibility.cpp qopenglfunctions_4_3_compatibility.h
+ qopenglfunctions_4_3_core.cpp qopenglfunctions_4_3_core.h
+ qopenglfunctions_4_4_compatibility.cpp qopenglfunctions_4_4_compatibility.h
+ qopenglfunctions_4_4_core.cpp qopenglfunctions_4_4_core.h
+ qopenglfunctions_4_5_compatibility.cpp qopenglfunctions_4_5_compatibility.h
+ qopenglfunctions_4_5_core.cpp qopenglfunctions_4_5_core.h
qopenglqueryhelper_p.h
qopengltimerquery.cpp qopengltimerquery.h
)
diff --git a/src/opengl/doc/src/dontdocument.qdoc b/src/opengl/doc/src/dontdocument.qdoc
new file mode 100644
index 0000000000..72e997d933
--- /dev/null
+++ b/src/opengl/doc/src/dontdocument.qdoc
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \dontdocument (QOpenGLVersionStatus
+ QOpenGLVersionFunctionsBackend
+ QOpenGLVersionFunctionsStorage
+ QOpenGLFunctions_1_0_CoreBackend
+ QOpenGLFunctions_1_1_CoreBackend
+ QOpenGLFunctions_1_2_CoreBackend
+ QOpenGLFunctions_1_3_CoreBackend
+ QOpenGLFunctions_1_4_CoreBackend
+ QOpenGLFunctions_1_5_CoreBackend
+ QOpenGLFunctions_2_0_CoreBackend
+ QOpenGLFunctions_2_1_CoreBackend
+ QOpenGLFunctions_3_0_CoreBackend
+ QOpenGLFunctions_3_1_CoreBackend
+ QOpenGLFunctions_3_2_CoreBackend
+ QOpenGLFunctions_3_3_CoreBackend
+ QOpenGLFunctions_4_0_CoreBackend
+ QOpenGLFunctions_4_1_CoreBackend
+ QOpenGLFunctions_4_2_CoreBackend
+ QOpenGLFunctions_4_3_CoreBackend
+ QOpenGLFunctions_4_4_CoreBackend
+ QOpenGLFunctions_4_5_CoreBackend
+ QOpenGLFunctions_1_0_DeprecatedBackend
+ QOpenGLFunctions_1_1_DeprecatedBackend
+ QOpenGLFunctions_1_2_DeprecatedBackend
+ QOpenGLFunctions_1_3_DeprecatedBackend
+ QOpenGLFunctions_1_4_DeprecatedBackend
+ QOpenGLFunctions_2_0_DeprecatedBackend
+ QOpenGLFunctions_3_0_DeprecatedBackend
+ QOpenGLFunctions_3_3_DeprecatedBackend
+ QOpenGLFunctions_4_5_DeprecatedBackend)
+*/
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index bf4ba63053..777bca40ec 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -31,6 +31,10 @@ HEADERS += \
qopengltexturecache_p.h \
qopengltextureglyphcache_p.h \
qopengltextureuploader_p.h \
+ qopenglversionfunctions.h \
+ qopenglversionfunctions_p.h \
+ qopenglversionfunctionsfactory.h \
+ qopenglversionprofile.h \
qopenglvertexarrayobject.h \
qopenglwindow.h \
qtopenglglobal.h
@@ -52,16 +56,77 @@ SOURCES += \
qopengltexturecache.cpp \
qopengltextureglyphcache.cpp \
qopengltextureuploader.cpp \
+ qopenglversionfunctions.cpp \
+ qopenglversionfunctionsfactory.cpp \
+ qopenglversionprofile.cpp \
qopenglvertexarrayobject.cpp \
qopenglwindow.cpp \
qopengldebug.cpp
!qtConfig(opengles2) {
HEADERS += \
+ qopenglfunctions_1_0.h \
+ qopenglfunctions_1_1.h \
+ qopenglfunctions_1_2.h \
+ qopenglfunctions_1_3.h \
+ qopenglfunctions_1_4.h \
+ qopenglfunctions_1_5.h \
+ qopenglfunctions_2_0.h \
+ qopenglfunctions_2_1.h \
+ qopenglfunctions_3_0.h \
+ qopenglfunctions_3_1.h \
+ qopenglfunctions_3_2_core.h \
+ qopenglfunctions_3_3_core.h \
+ qopenglfunctions_4_0_core.h \
+ qopenglfunctions_4_1_core.h \
+ qopenglfunctions_4_2_core.h \
+ qopenglfunctions_4_3_core.h \
+ qopenglfunctions_4_4_core.h \
+ qopenglfunctions_4_5_core.h \
+ qopenglfunctions_3_2_compatibility.h \
+ qopenglfunctions_3_3_compatibility.h \
+ qopenglfunctions_4_0_compatibility.h \
+ qopenglfunctions_4_1_compatibility.h \
+ qopenglfunctions_4_2_compatibility.h \
+ qopenglfunctions_4_3_compatibility.h \
+ qopenglfunctions_4_4_compatibility.h \
+ qopenglfunctions_4_5_compatibility.h \
qopenglqueryhelper_p.h \
qopengltimerquery.h
- SOURCES += qopengltimerquery.cpp
+ SOURCES += \
+ qopenglfunctions_1_0.cpp \
+ qopenglfunctions_1_1.cpp \
+ qopenglfunctions_1_2.cpp \
+ qopenglfunctions_1_3.cpp \
+ qopenglfunctions_1_4.cpp \
+ qopenglfunctions_1_5.cpp \
+ qopenglfunctions_2_0.cpp \
+ qopenglfunctions_2_1.cpp \
+ qopenglfunctions_3_0.cpp \
+ qopenglfunctions_3_1.cpp \
+ qopenglfunctions_3_2_core.cpp \
+ qopenglfunctions_3_3_core.cpp \
+ qopenglfunctions_4_0_core.cpp \
+ qopenglfunctions_4_1_core.cpp \
+ qopenglfunctions_4_2_core.cpp \
+ qopenglfunctions_4_3_core.cpp \
+ qopenglfunctions_4_4_core.cpp \
+ qopenglfunctions_4_5_core.cpp \
+ qopenglfunctions_3_2_compatibility.cpp \
+ qopenglfunctions_3_3_compatibility.cpp \
+ qopenglfunctions_4_0_compatibility.cpp \
+ qopenglfunctions_4_1_compatibility.cpp \
+ qopenglfunctions_4_2_compatibility.cpp \
+ qopenglfunctions_4_3_compatibility.cpp \
+ qopenglfunctions_4_4_compatibility.cpp \
+ qopenglfunctions_4_5_compatibility.cpp \
+ qopengltimerquery.cpp
+}
+
+qtConfig(opengles2) {
+ HEADERS += qopenglfunctions_es2.h
+ SOURCES += qopenglfunctions_es2.cpp
}
load(qt_module)
diff --git a/src/gui/opengl/qopenglfunctions_1_0.cpp b/src/opengl/qopenglfunctions_1_0.cpp
index f9d93ce210..f440764df8 100644
--- a/src/gui/opengl/qopenglfunctions_1_0.cpp
+++ b/src/opengl/qopenglfunctions_1_0.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_0
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_1_0 class provides all functions for OpenGL 1.0 specification.
diff --git a/src/gui/opengl/qopenglfunctions_1_0.h b/src/opengl/qopenglfunctions_1_0.h
index cddb7251ed..cd94512614 100644
--- a/src/gui/opengl/qopenglfunctions_1_0.h
+++ b/src/opengl/qopenglfunctions_1_0.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_1_0_H
#define QOPENGLVERSIONFUNCTIONS_1_0_H
-#include <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 b0f7538d48..7860123757 100644
--- a/src/gui/opengl/qopenglfunctions_1_1.cpp
+++ b/src/opengl/qopenglfunctions_1_1.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_1
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_1_1 class provides all functions for OpenGL 1.1 specification.
diff --git a/src/gui/opengl/qopenglfunctions_1_1.h b/src/opengl/qopenglfunctions_1_1.h
index 8a9f16ec4c..f24150fae7 100644
--- a/src/gui/opengl/qopenglfunctions_1_1.h
+++ b/src/opengl/qopenglfunctions_1_1.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_1_1_H
#define QOPENGLVERSIONFUNCTIONS_1_1_H
-#include <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 5f137b0237..5993210674 100644
--- a/src/gui/opengl/qopenglfunctions_1_2.cpp
+++ b/src/opengl/qopenglfunctions_1_2.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_2
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_1_2 class provides all functions for OpenGL 1.2 specification.
diff --git a/src/gui/opengl/qopenglfunctions_1_2.h b/src/opengl/qopenglfunctions_1_2.h
index 7daca0923d..623b2b89d5 100644
--- a/src/gui/opengl/qopenglfunctions_1_2.h
+++ b/src/opengl/qopenglfunctions_1_2.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,18 @@
#ifndef QOPENGLVERSIONFUNCTIONS_1_2_H
#define QOPENGLVERSIONFUNCTIONS_1_2_H
-#include <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 0b5ff2fee5..41ef4d4cf3 100644
--- a/src/gui/opengl/qopenglfunctions_1_3.cpp
+++ b/src/opengl/qopenglfunctions_1_3.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_3
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_1_3 class provides all functions for OpenGL 1.3 specification.
diff --git a/src/gui/opengl/qopenglfunctions_1_3.h b/src/opengl/qopenglfunctions_1_3.h
index b527b57946..6c7ef74323 100644
--- a/src/gui/opengl/qopenglfunctions_1_3.h
+++ b/src/opengl/qopenglfunctions_1_3.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_1_3_H
#define QOPENGLVERSIONFUNCTIONS_1_3_H
-#include <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 9419c1aa85..92a331d775 100644
--- a/src/gui/opengl/qopenglfunctions_1_4.cpp
+++ b/src/opengl/qopenglfunctions_1_4.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_4
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_1_4 class provides all functions for OpenGL 1.4 specification.
diff --git a/src/gui/opengl/qopenglfunctions_1_4.h b/src/opengl/qopenglfunctions_1_4.h
index 1f3f5a9c0a..d59b283c17 100644
--- a/src/gui/opengl/qopenglfunctions_1_4.h
+++ b/src/opengl/qopenglfunctions_1_4.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_1_4_H
#define QOPENGLVERSIONFUNCTIONS_1_4_H
-#include <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 3fa7668a36..d304679409 100644
--- a/src/gui/opengl/qopenglfunctions_1_5.cpp
+++ b/src/opengl/qopenglfunctions_1_5.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_1_5
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_1_5 class provides all functions for OpenGL 1.5 specification.
diff --git a/src/gui/opengl/qopenglfunctions_1_5.h b/src/opengl/qopenglfunctions_1_5.h
index d2f5311211..9600632e9d 100644
--- a/src/gui/opengl/qopenglfunctions_1_5.h
+++ b/src/opengl/qopenglfunctions_1_5.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_1_5_H
#define QOPENGLVERSIONFUNCTIONS_1_5_H
-#include <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 29eb055a1d..63bfe641f2 100644
--- a/src/gui/opengl/qopenglfunctions_2_0.cpp
+++ b/src/opengl/qopenglfunctions_2_0.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_2_0
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_2_0 class provides all functions for OpenGL 2.0 specification.
diff --git a/src/gui/opengl/qopenglfunctions_2_0.h b/src/opengl/qopenglfunctions_2_0.h
index 556597a9b3..7b5e580d3d 100644
--- a/src/gui/opengl/qopenglfunctions_2_0.h
+++ b/src/opengl/qopenglfunctions_2_0.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_2_0_H
#define QOPENGLVERSIONFUNCTIONS_2_0_H
-#include <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 8a7170dd7d..1eb8d2a95c 100644
--- a/src/gui/opengl/qopenglfunctions_2_1.cpp
+++ b/src/opengl/qopenglfunctions_2_1.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_2_1
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_2_1 class provides all functions for OpenGL 2.1 specification.
diff --git a/src/gui/opengl/qopenglfunctions_2_1.h b/src/opengl/qopenglfunctions_2_1.h
index f053222c71..323ba1e03d 100644
--- a/src/gui/opengl/qopenglfunctions_2_1.h
+++ b/src/opengl/qopenglfunctions_2_1.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_2_1_H
#define QOPENGLVERSIONFUNCTIONS_2_1_H
-#include <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 7d0e900659..9d933b50d5 100644
--- a/src/gui/opengl/qopenglfunctions_3_0.cpp
+++ b/src/opengl/qopenglfunctions_3_0.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_0
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_3_0 class provides all functions for OpenGL 3.0 specification.
diff --git a/src/gui/opengl/qopenglfunctions_3_0.h b/src/opengl/qopenglfunctions_3_0.h
index c592050c24..ffc9121472 100644
--- a/src/gui/opengl/qopenglfunctions_3_0.h
+++ b/src/opengl/qopenglfunctions_3_0.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_3_0_H
#define QOPENGLVERSIONFUNCTIONS_3_0_H
-#include <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 c25b124af8..353ddf35ab 100644
--- a/src/gui/opengl/qopenglfunctions_3_1.cpp
+++ b/src/opengl/qopenglfunctions_3_1.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_1
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_3_1 class provides all functions for OpenGL 3.1 specification.
diff --git a/src/gui/opengl/qopenglfunctions_3_1.h b/src/opengl/qopenglfunctions_3_1.h
index 3a8d3891f3..8bc4f69e32 100644
--- a/src/gui/opengl/qopenglfunctions_3_1.h
+++ b/src/opengl/qopenglfunctions_3_1.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_3_1_H
#define QOPENGLVERSIONFUNCTIONS_3_1_H
-#include <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 3e4fd96dc2..92c7b6e3ba 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_3_2_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_2_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_3_2_Compatibility class provides all functions for OpenGL 3.2 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_3_2_compatibility.h b/src/opengl/qopenglfunctions_3_2_compatibility.h
index 391e725953..f4ce56f27d 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_compatibility.h
+++ b/src/opengl/qopenglfunctions_3_2_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_3_2_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_3_2_COMPATIBILITY_H
-#include <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 ea89fc9e48..5f7d32fb61 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_core.cpp
+++ b/src/opengl/qopenglfunctions_3_2_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_2_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_3_2_Core class provides all functions for OpenGL 3.2 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_3_2_core.h b/src/opengl/qopenglfunctions_3_2_core.h
index 1eafb6f441..4fad8f5e59 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_core.h
+++ b/src/opengl/qopenglfunctions_3_2_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_3_2_CORE_H
#define QOPENGLVERSIONFUNCTIONS_3_2_CORE_H
-#include <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 a26d7d99b1..9b9617c1e7 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_3_3_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_3_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_3_3_Compatibility class provides all functions for OpenGL 3.3 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_3_3_compatibility.h b/src/opengl/qopenglfunctions_3_3_compatibility.h
index 185dd5aab4..971f4a58f4 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_compatibility.h
+++ b/src/opengl/qopenglfunctions_3_3_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_3_3_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_3_3_COMPATIBILITY_H
-#include <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 277ad1eb14..78a2e8b568 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_core.cpp
+++ b/src/opengl/qopenglfunctions_3_3_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_3_3_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_3_3_Core class provides all functions for OpenGL 3.3 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_3_3_core.h b/src/opengl/qopenglfunctions_3_3_core.h
index 47d54d717e..6f80adfe20 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_core.h
+++ b/src/opengl/qopenglfunctions_3_3_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_3_3_CORE_H
#define QOPENGLVERSIONFUNCTIONS_3_3_CORE_H
-#include <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 655f1e6fd4..e94a0bf5ab 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_0_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_0_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_0_Compatibility class provides all functions for OpenGL 4.0 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_0_compatibility.h b/src/opengl/qopenglfunctions_4_0_compatibility.h
index c0e42443d3..c8900ab599 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_0_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_0_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_4_0_COMPATIBILITY_H
-#include <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 60453d147c..a5fc44f31d 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_core.cpp
+++ b/src/opengl/qopenglfunctions_4_0_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_0_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_0_Core class provides all functions for OpenGL 4.0 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_0_core.h b/src/opengl/qopenglfunctions_4_0_core.h
index 6cb55e86f7..aac7880592 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_core.h
+++ b/src/opengl/qopenglfunctions_4_0_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_0_CORE_H
#define QOPENGLVERSIONFUNCTIONS_4_0_CORE_H
-#include <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 bdea8b5ba9..6198412ebc 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_1_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_1_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_1_Compatibility class provides all functions for OpenGL 4.1 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_1_compatibility.h b/src/opengl/qopenglfunctions_4_1_compatibility.h
index bee169b50c..e54f103151 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_1_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_1_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_4_1_COMPATIBILITY_H
-#include <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 b21742d9c1..81eedaa7bb 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_core.cpp
+++ b/src/opengl/qopenglfunctions_4_1_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_1_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_1_Core class provides all functions for OpenGL 4.1 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.h b/src/opengl/qopenglfunctions_4_1_core.h
index 3a4fd0743b..6a18d42479 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_core.h
+++ b/src/opengl/qopenglfunctions_4_1_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,16 +50,17 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_1_CORE_H
#define QOPENGLVERSIONFUNCTIONS_4_1_CORE_H
-#include <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 41ab9ae762..f04a30854b 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_2_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_2_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_2_Compatibility class provides all functions for OpenGL 4.2 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_2_compatibility.h b/src/opengl/qopenglfunctions_4_2_compatibility.h
index a48d581c2d..08dd30864b 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_2_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_2_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_4_2_COMPATIBILITY_H
-#include <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 38dbe1b596..15d7eba25a 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_core.cpp
+++ b/src/opengl/qopenglfunctions_4_2_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_2_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_2_Core class provides all functions for OpenGL 4.2 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_2_core.h b/src/opengl/qopenglfunctions_4_2_core.h
index 5ca98e9808..5eff9f449c 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_core.h
+++ b/src/opengl/qopenglfunctions_4_2_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_2_CORE_H
#define QOPENGLVERSIONFUNCTIONS_4_2_CORE_H
-#include <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 1b23d08ee2..d17a4adb10 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_3_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_3_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_3_Compatibility class provides all functions for OpenGL 4.3 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_3_compatibility.h b/src/opengl/qopenglfunctions_4_3_compatibility.h
index d969f5b3b4..dc8eb32842 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_3_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_3_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_4_3_COMPATIBILITY_H
-#include <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 8a867471b8..72c09db076 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_core.cpp
+++ b/src/opengl/qopenglfunctions_4_3_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_3_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_4_3_Core class provides all functions for OpenGL 4.3 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_3_core.h b/src/opengl/qopenglfunctions_4_3_core.h
index 13675caf62..4bbcb4fc46 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_core.h
+++ b/src/opengl/qopenglfunctions_4_3_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_3_CORE_H
#define QOPENGLVERSIONFUNCTIONS_4_3_CORE_H
-#include <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 4fc4b50100..38348869db 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_4_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_4_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.5
\wrapper
\brief The QOpenGLFunctions_4_4_Compatibility class provides all functions for OpenGL 4.4 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_4_compatibility.h b/src/opengl/qopenglfunctions_4_4_compatibility.h
index 0acab349a1..6e5772ba4c 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_4_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_4_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_4_4_COMPATIBILITY_H
-#include <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 6169c7f455..e0a78e1527 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_core.cpp
+++ b/src/opengl/qopenglfunctions_4_4_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_4_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.5
\wrapper
\brief The QOpenGLFunctions_4_4_Core class provides all functions for OpenGL 4.4 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_4_core.h b/src/opengl/qopenglfunctions_4_4_core.h
index 1ad6f40214..85229bff60 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_core.h
+++ b/src/opengl/qopenglfunctions_4_4_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_4_CORE_H
#define QOPENGLVERSIONFUNCTIONS_4_4_CORE_H
-#include <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 02af443498..253b305452 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_5_compatibility.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_5_Compatibility
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.5
\wrapper
\brief The QOpenGLFunctions_4_5_Compatibility class provides all functions for OpenGL 4.5 compatibility profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h b/src/opengl/qopenglfunctions_4_5_compatibility.h
index 9d9d14548b..766fe9105e 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_5_compatibility.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_5_COMPATIBILITY_H
#define QOPENGLVERSIONFUNCTIONS_4_5_COMPATIBILITY_H
-#include <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 9c0369e5f2..b680629e91 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_core.cpp
+++ b/src/opengl/qopenglfunctions_4_5_core.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_4_5_Core
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.5
\wrapper
\brief The QOpenGLFunctions_4_5_Core class provides all functions for OpenGL 4.5 core profile.
diff --git a/src/gui/opengl/qopenglfunctions_4_5_core.h b/src/opengl/qopenglfunctions_4_5_core.h
index bf872c628b..3fe64d2d25 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_core.h
+++ b/src/opengl/qopenglfunctions_4_5_core.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,11 +50,12 @@
#ifndef QOPENGLVERSIONFUNCTIONS_4_5_CORE_H
#define QOPENGLVERSIONFUNCTIONS_4_5_CORE_H
-#include <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 dd2b3af80b..39d86e647f 100644
--- a/src/gui/opengl/qopenglfunctions_es2.cpp
+++ b/src/opengl/qopenglfunctions_es2.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLFunctions_ES2
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\wrapper
\brief The QOpenGLFunctions_ES2 class provides all functions for OpenGL ES 2.
diff --git a/src/gui/opengl/qopenglfunctions_es2.h b/src/opengl/qopenglfunctions_es2.h
index 851eb5951b..e3c4ad5c2c 100644
--- a/src/gui/opengl/qopenglfunctions_es2.h
+++ b/src/opengl/qopenglfunctions_es2.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -40,18 +40,19 @@
#ifndef QOPENGLVERSIONFUNCTIONS_ES2_H
#define QOPENGLVERSIONFUNCTIONS_ES2_H
-#include <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 c5e61859ee..72ddea3a9e 100644
--- a/src/opengl/qopenglshaderprogram.cpp
+++ b/src/opengl/qopenglshaderprogram.cpp
@@ -40,6 +40,7 @@
#include "qopenglshaderprogram.h"
#include "qopenglextrafunctions.h"
#include "private/qopenglcontext_p.h"
+#include <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 5a108335a9..016683a3f2 100644
--- a/src/gui/opengl/qopenglversionfunctions.cpp
+++ b/src/opengl/qopenglversionfunctions.cpp
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -48,11 +48,40 @@
****************************************************************************/
#include "qopenglversionfunctions.h"
+#include "qopenglversionfunctions_p.h"
#include "qopenglcontext.h"
#include "qdebug.h"
QT_BEGIN_NAMESPACE
+QOpenGLContextVersionData::~QOpenGLContextVersionData()
+{
+ for (auto *f : qAsConst(externalFunctions)) {
+ auto *fp = QAbstractOpenGLFunctionsPrivate::get(f);
+ fp->owningContext = nullptr;
+ fp->initialized = false;
+ }
+ externalFunctions.clear();
+ qDeleteAll(functions);
+ functions.clear();
+}
+
+QOpenGLContextVersionData *QOpenGLContextVersionData::forContext(QOpenGLContext *context)
+{
+ auto *data = contextData.value(context);
+ if (!data) {
+ data = new QOpenGLContextVersionData;
+ // The data will live as long as the context. It could potentially be an opaque pointer
+ // member of QOpenGLContextPrivate, but this avoids polluting QOpenGLContext with version
+ // functions specifics
+ QObject::connect(context, &QObject::destroyed, context, [data](){ delete data; }, Qt::DirectConnection);
+ contextData[context] = data;
+ }
+ return data;
+}
+
+QMap<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 f31db081bf..47e7e37d3a 100644
--- a/src/gui/opengl/qopenglversionfunctions.h
+++ b/src/opengl/qopenglversionfunctions.h
@@ -4,7 +4,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -50,7 +50,7 @@
#ifndef QOPENGLVERSIONFUNCTIONS_H
#define QOPENGLVERSIONFUNCTIONS_H
-#include <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 469a9cc624..1458edf322 100644
--- a/src/gui/opengl/qopenglversionfunctionsfactory_p.h
+++ b/src/opengl/qopenglversionfunctions_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -46,8 +46,8 @@
**
****************************************************************************/
-#ifndef QOPENGLVERSIONFUNCTIONFACTORY_P_H
-#define QOPENGLVERSIONFUNCTIONFACTORY_P_H
+#ifndef QOPENGLVERSIONFUNCTION_H
+#define QOPENGLVERSIONFUNCTION_H
//
// W A R N I N G
@@ -60,24 +60,28 @@
// We mean it.
//
-#include <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 ca7daedf34..de7fe6c07f 100644
--- a/src/gui/opengl/qopenglversionfunctionsfactory.cpp
+++ b/src/opengl/qopenglversionfunctionsfactory.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -46,7 +46,8 @@
**
****************************************************************************/
-#include "qopenglversionfunctionsfactory_p.h"
+#include "qopenglversionfunctionsfactory.h"
+#include "qopenglversionfunctions_p.h"
#if !defined(QT_OPENGL_ES_2)
#include "qopenglfunctions_4_5_core.h"
@@ -81,7 +82,7 @@
QT_BEGIN_NAMESPACE
-QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVersionProfile &versionProfile)
+static QAbstractOpenGLFunctions *createFunctions(const QOpenGLVersionProfile &versionProfile)
{
#if !defined(QT_OPENGL_ES_2)
const int major = versionProfile.version().first;
@@ -160,4 +161,120 @@ QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVe
#endif
}
+/*!
+ \fn static T *QOpenGLVersionFunctionsFactory::get(QOpenGLContext *context)
+
+ \overload get()
+
+ Returns a pointer to an object that provides access to all functions for
+ the version and profile of this context. There is no need to call
+ QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as the \a context
+ is current. It is also possible to call this function when the \a context is not
+ current, but in that case it is the caller's responsibility to ensure proper
+ initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions()
+ afterwards.
+
+ Usually one would use the template version of this function to automatically
+ have the result cast to the correct type.
+
+ \code
+ auto funcs = QOpenGLVersionFunctionsFactory::get<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 0000000000..0445c2e03d
--- /dev/null
+++ b/src/opengl/qopenglversionfunctionsfactory.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtOpenGL module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2012 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#ifndef QOPENGLVERSIONFUNCTIONFACTORY_H
+#define QOPENGLVERSIONFUNCTIONFACTORY_H
+
+#include <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 4e728f9405..afda77857e 100644
--- a/src/gui/opengl/qopenglversionprofile.cpp
+++ b/src/opengl/qopenglversionprofile.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -59,7 +59,7 @@ public:
/*!
\class QOpenGLVersionProfile
- \inmodule QtGui
+ \inmodule QtOpenGL
\since 5.1
\brief The QOpenGLVersionProfile class represents the version and if applicable
the profile of an OpenGL context.
diff --git a/src/gui/opengl/qopenglversionprofile.h b/src/opengl/qopenglversionprofile.h
index 7315f1a2cb..fdc531692a 100644
--- a/src/gui/opengl/qopenglversionprofile.h
+++ b/src/opengl/qopenglversionprofile.h
@@ -3,7 +3,7 @@
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -40,7 +40,7 @@
#ifndef QOPENGLVERSIONPROFILE_H
#define QOPENGLVERSIONPROFILE_H
-#include <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 a6ac282d4c..e4bd24ef58 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 0e821f87b8..861fb16d59 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