diff options
19 files changed, 29 insertions, 32 deletions
diff --git a/examples/opengl/contextinfo/CMakeLists.txt b/examples/opengl/contextinfo/CMakeLists.txt index d174946ad6..124dfd4b52 100644 --- a/examples/opengl/contextinfo/CMakeLists.txt +++ b/examples/opengl/contextinfo/CMakeLists.txt @@ -14,6 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples/opengl/contextinfo") find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 COMPONENTS OpenGL) add_qt_gui_executable(contextinfo main.cpp @@ -23,6 +24,7 @@ add_qt_gui_executable(contextinfo target_link_libraries(contextinfo PUBLIC Qt::Core Qt::Gui + Qt::OpenGL Qt::Widgets ) diff --git a/examples/opengl/contextinfo/contextinfo.pro b/examples/opengl/contextinfo/contextinfo.pro index 3d948dd282..ae8f4067b6 100644 --- a/examples/opengl/contextinfo/contextinfo.pro +++ b/examples/opengl/contextinfo/contextinfo.pro @@ -1,5 +1,5 @@ TEMPLATE = app -QT += widgets +QT += widgets opengl requires(qtConfig(filedialog)) SOURCES += main.cpp \ diff --git a/examples/opengl/contextinfo/renderwindow.cpp b/examples/opengl/contextinfo/renderwindow.cpp index ea9a7a24cb..b778fd1d89 100644 --- a/examples/opengl/contextinfo/renderwindow.cpp +++ b/examples/opengl/contextinfo/renderwindow.cpp @@ -52,7 +52,7 @@ #include <QTimer> #include <QMatrix4x4> #include <QOpenGLContext> -#include <QOpenGLShaderProgram> +#include <QtOpenGL/QOpenGLShaderProgram> #include <QOpenGLFunctions> RenderWindow::RenderWindow(const QSurfaceFormat &format) diff --git a/examples/opengl/hellowindow/CMakeLists.txt b/examples/opengl/hellowindow/CMakeLists.txt index 58bd3fc362..876c282fbe 100644 --- a/examples/opengl/hellowindow/CMakeLists.txt +++ b/examples/opengl/hellowindow/CMakeLists.txt @@ -13,6 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples/opengl/hellowindow") find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) add_qt_gui_executable(hellowindow hellowindow.cpp hellowindow.h @@ -23,6 +24,7 @@ target_link_libraries(hellowindow PUBLIC Qt::CorePrivate Qt::Gui Qt::GuiPrivate + Qt::OpenGL ) install(TARGETS hellowindow diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h index e6d7970cfc..938c6409a4 100644 --- a/examples/opengl/hellowindow/hellowindow.h +++ b/examples/opengl/hellowindow/hellowindow.h @@ -52,7 +52,7 @@ #include <QColor> #include <QMutex> -#include <QOpenGLShaderProgram> +#include <QtOpenGL/QOpenGLShaderProgram> #include <QOpenGLBuffer> #include <QSharedPointer> #include <QTimer> diff --git a/examples/opengl/hellowindow/hellowindow.pro b/examples/opengl/hellowindow/hellowindow.pro index cc220fd344..27c274a378 100644 --- a/examples/opengl/hellowindow/hellowindow.pro +++ b/examples/opengl/hellowindow/hellowindow.pro @@ -1,4 +1,4 @@ -QT += gui-private core-private +QT += gui-private core-private opengl HEADERS += hellowindow.h SOURCES += hellowindow.cpp main.cpp diff --git a/examples/opengl/paintedwindow/paintedwindow.h b/examples/opengl/paintedwindow/paintedwindow.h index 0dace49a33..972d8d10bd 100644 --- a/examples/opengl/paintedwindow/paintedwindow.h +++ b/examples/opengl/paintedwindow/paintedwindow.h @@ -51,7 +51,7 @@ #include <QWindow> #include <QtGui/qopengl.h> -#include <QtGui/qopenglshaderprogram.h> +#include <QtOpenGL/qopenglshaderprogram.h> #include <QtOpenGL/qopenglframebufferobject.h> #include <QPropertyAnimation> diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt index 1f950e27c0..84c3749947 100644 --- a/src/gui/.prev_CMakeLists.txt +++ b/src/gui/.prev_CMakeLists.txt @@ -260,7 +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/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 5b812628ea..bd8c59e198 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -342,7 +342,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/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri index 00ac48fa75..c606e9ec02 100644 --- a/src/gui/opengl/opengl.pri +++ b/src/gui/opengl/opengl.pri @@ -9,7 +9,6 @@ qtConfig(opengl) { opengl/qopengl_p.h \ opengl/qopenglfunctions.h \ opengl/qopenglbuffer.h \ - opengl/qopenglshaderprogram.h \ opengl/qopenglextensions_p.h \ opengl/qopenglversionfunctions.h \ opengl/qopenglversionfunctionsfactory_p.h \ @@ -20,7 +19,6 @@ qtConfig(opengl) { SOURCES += opengl/qopengl.cpp \ opengl/qopenglfunctions.cpp \ opengl/qopenglbuffer.cpp \ - opengl/qopenglshaderprogram.cpp \ opengl/qopenglversionfunctions.cpp \ opengl/qopenglversionfunctionsfactory.cpp \ opengl/qopenglvertexarrayobject.cpp \ diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp index 72bdacf43f..89c44e72c0 100644 --- a/src/gui/opengl/qopenglprogrambinarycache.cpp +++ b/src/gui/opengl/qopenglprogrambinarycache.cpp @@ -45,7 +45,6 @@ #include <QDir> #include <QSaveFile> #include <QCoreApplication> -#include <QLoggingCategory> #include <QCryptographicHash> #ifdef Q_OS_UNIX diff --git a/src/gui/opengl/qopenglprogrambinarycache_p.h b/src/gui/opengl/qopenglprogrambinarycache_p.h index f1cf24cd87..873e9d7c00 100644 --- a/src/gui/opengl/qopenglprogrambinarycache_p.h +++ b/src/gui/opengl/qopenglprogrambinarycache_p.h @@ -54,6 +54,7 @@ #include <QtGui/qtguiglobal.h> #include <QtCore/qcache.h> #include <QtCore/qmutex.h> +#include <QtCore/QLoggingCategory> #include <QtGui/private/qopenglcontext_p.h> #include <QtGui/private/qshader_p.h> @@ -63,10 +64,12 @@ QT_BEGIN_NAMESPACE // therefore stay independent from QOpenGLShader(Program). Must rely only on // QOpenGLContext/Functions. -class QOpenGLProgramBinaryCache +Q_GUI_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcOpenGLProgramDiskCache) + +class Q_GUI_EXPORT QOpenGLProgramBinaryCache { public: - struct ShaderDesc { + struct Q_GUI_EXPORT ShaderDesc { ShaderDesc() { } ShaderDesc(QShader::Stage stage, const QByteArray &source = QByteArray()) : stage(stage), source(source) @@ -74,7 +77,7 @@ public: QShader::Stage stage; QByteArray source; }; - struct ProgramDesc { + struct Q_GUI_EXPORT ProgramDesc { QVector<ShaderDesc> shaders; QByteArray cacheKey() const; }; @@ -114,7 +117,7 @@ private: // per-context basis, not just once per process. QOpenGLSharedResource enables this, // although it's once-per-sharing-context-group, not per-context. Still, this should // be good enough in practice. -class QOpenGLProgramBinarySupportCheck : public QOpenGLSharedResource +class Q_GUI_EXPORT QOpenGLProgramBinarySupportCheck : public QOpenGLSharedResource { public: QOpenGLProgramBinarySupportCheck(QOpenGLContext *context); diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index 62f808ce81..3b6c022399 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -289,8 +289,6 @@ QT_BEGIN_NAMESPACE #define GL_MAP_READ_BIT 0x0001 #endif -Q_DECLARE_LOGGING_CATEGORY(lcOpenGLProgramDiskCache) - /*! Constructs a new QRhiGles2InitParams. diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 5ddb50b664..17366f7cf0 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -17,6 +17,7 @@ qt_add_module(OpenGL 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 diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index ef81f3aec9..950a72cc03 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -22,6 +22,7 @@ HEADERS += \ qopenglpaintengine_p.h \ qopenglpixeltransferoptions.h \ qopenglshadercache_p.h \ + qopenglshaderprogram.h \ qopengltexture.h \ qopengltexture_p.h \ qopengltexturehelper_p.h \ @@ -41,6 +42,7 @@ SOURCES += \ qopenglpaintdevice.cpp \ qopenglpaintengine.cpp \ qopenglpixeltransferoptions.cpp \ + qopenglshaderprogram.cpp \ qopengltexture.cpp \ qopengltexturehelper.cpp \ qopengltextureblitter.cpp \ diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/opengl/qopenglshaderprogram.cpp index 7e89d9c8d4..c5e61859ee 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/opengl/qopenglshaderprogram.cpp @@ -3,7 +3,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 @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qopenglshaderprogram.h" -#include "qopenglprogrambinarycache_p.h" #include "qopenglextrafunctions.h" #include "private/qopenglcontext_p.h" #include <QtCore/private/qobject_p.h> @@ -47,6 +46,7 @@ #include <QtCore/qvarlengtharray.h> #include <QtCore/qvector.h> #include <QtCore/qloggingcategory.h> +#include <QtGui/private/qopenglprogrambinarycache_p.h> #include <QtGui/qtransform.h> #include <QtGui/QColor> #include <QtGui/QSurfaceFormat> @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE \brief The QOpenGLShaderProgram class allows OpenGL shader programs to be linked and used. \since 5.0 \ingroup painting-3D - \inmodule QtGui + \inmodule QtOpenGL \section1 Introduction @@ -150,7 +150,7 @@ QT_BEGIN_NAMESPACE \brief The QOpenGLShader class allows OpenGL shaders to be compiled. \since 5.0 \ingroup painting-3D - \inmodule QtGui + \inmodule QtOpenGL This class supports shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES). @@ -177,8 +177,6 @@ QT_BEGIN_NAMESPACE (requires OpenGL >= 4.3 or OpenGL ES >= 3.1). */ -Q_DECLARE_LOGGING_CATEGORY(lcOpenGLProgramDiskCache) - // For GLES 3.1/3.2 #ifndef GL_GEOMETRY_SHADER #define GL_GEOMETRY_SHADER 0x8DD9 diff --git a/src/gui/opengl/qopenglshaderprogram.h b/src/opengl/qopenglshaderprogram.h index c79101fd4d..87da4fc072 100644 --- a/src/gui/opengl/qopenglshaderprogram.h +++ b/src/opengl/qopenglshaderprogram.h @@ -3,7 +3,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 @@ -40,9 +40,7 @@ #ifndef QOPENGLSHADERPROGRAM_H #define QOPENGLSHADERPROGRAM_H -#include <QtGui/qtguiglobal.h> - -#ifndef QT_NO_OPENGL +#include <QtOpenGL/qtopenglglobal.h> #include <QtGui/qopengl.h> #include <QtGui/qvector2d.h> @@ -57,7 +55,7 @@ class QOpenGLContext; class QOpenGLShaderProgram; class QOpenGLShaderPrivate; -class Q_GUI_EXPORT QOpenGLShader : public QObject +class Q_OPENGL_EXPORT QOpenGLShader : public QObject { Q_OBJECT public: @@ -103,7 +101,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLShader::ShaderType) class QOpenGLShaderProgramPrivate; -class Q_GUI_EXPORT QOpenGLShaderProgram : public QObject +class Q_OPENGL_EXPORT QOpenGLShaderProgram : public QObject { Q_OBJECT public: @@ -313,6 +311,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_OPENGL - #endif diff --git a/src/opengl/qopengltextureblitter.cpp b/src/opengl/qopengltextureblitter.cpp index ba2eaf7754..6f0ee863d7 100644 --- a/src/opengl/qopengltextureblitter.cpp +++ b/src/opengl/qopengltextureblitter.cpp @@ -39,8 +39,8 @@ #include "qopengltextureblitter.h" +#include <QtOpenGL/QOpenGLShaderProgram> #include <QtGui/QOpenGLBuffer> -#include <QtGui/QOpenGLShaderProgram> #include <QtGui/QOpenGLVertexArrayObject> #include <QtGui/QOpenGLContext> #include <QtGui/QOpenGLFunctions> diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h index 8768f9dd8c..7a6044aca0 100644 --- a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h @@ -54,9 +54,9 @@ #include "qeglfsglobal_p.h" #include <qpa/qplatformcursor.h> #include <qpa/qplatformscreen.h> +#include <QtOpenGL/QOpenGLShaderProgram> #include <QtGui/QMatrix4x4> #include <QtGui/QOpenGLFunctions> -#include <QtGui/QOpenGLShaderProgram> #include <QtGui/private/qinputdevicemanager_p.h> #include <QtCore/qvector.h> |