summaryrefslogtreecommitdiffstats
path: root/src/opengl/doc/snippets
Commit message (Collapse)AuthorAgeFilesLines
* Correct doc snippet licenseLucie Gérard2024-02-281-1/+1
| | | | | | | | | | | | | | All file under doc/snippet should be license as Documentation snippets and according to QUIP-18 [1] this is LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I76eedfb6b15c4091f726a5652e3530001d7cdaf7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-164-196/+8
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Compose render-to-texture widgets through QRhiLaszlo Agocs2022-03-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformTextureList holds a QRhiTexture instead of GLuint. A QPlatformBackingStore now optionally can own a QRhi and a QRhiSwapChain for the associated window. Non-GL rendering must use this QRhi everywhere, whereas GL (QOpenGLWidget) can choose to still rely on resource sharing between contexts. A widget tells that it wants QRhi and the desired configuration in a new virtual function in QWidgetPrivate returning a QPlatformBackingStoreRhiConfig. This is evaluated (among a top-level's all children) upon create() before creating the repaint manager and the QWidgetWindow. In QOpenGLWidget what do request is obvious: it will request an OpenGL-based QRhi. QQuickWidget (or a potential future QRhiWidget) will be more interesting: it needs to honor the standard Qt Quick env.vars. and QQuickWindow APIs (or, in whatever way the user configured the QRhiWidget), and so will set up the config struct accordingly. In addition, the rhiconfig and surface type is (re)evaluated when (re)parenting a widget to a new tlw. If needed, this will now trigger a destroy - create on the tlw. This should be be safe to do in setParent. When multiple child widgets report an enabled rhiconfig, the first one (the first child encountered) wins. So e.g. attempting to have a QOpenGLWidget and a Vulkan-based QQuickWidget in the same top-level window will fail one of the widgets (it likely won't render). RasterGLSurface is no longer used by widgets. Rather, the appropriate surface type is chosen. The rhi support in the backingstore is usable without widgets as well. To make rhiFlush() functional, one needs to call setRhiConfig() after creating the QBackingStore. (like QWidget does to top-level windows) Most of the QT_NO_OPENGL ifdefs are eliminated all over the place. Everything with QRhi is unconditional code at compile time, except the actual initialization. Having to plumb the widget tlw's shareContext (or, now, the QRhi) through QWindowPrivate is no longer needed. The old approach does not scale: to implement composeAndFlush (now rhiFlush) we need more than just a QRhi object, and this way we no longer pollute everything starting from the widget level (QWidget's topextra -> QWidgetWindow -> QWindowPrivate) just to send data around. The BackingStoreOpenGLSupport interface and the QtGui - QtOpenGL split is all gone. Instead, there is a QBackingStoreDefaultCompositor in QtGui which is what the default implementations of composeAndFlush and toTexture call. (overriding composeAndFlush and co. f.ex. in eglfs should continue working mostly as-is, apart from adapting to the texture list changes and getting the native OpenGL texture id out of the QRhiTexture) As QQuickWidget is way too complicated to just port as-is, an rhi manual test (rhiwidget) is introduced as a first step, in ordewr to exercise a simple, custom render-to-texture widget that does something using a (not necessarily OpenGL-backed) QRhi and acts as fully functional QWidget (modeled after QOpenGLWidget). This can also form the foundation of a potential future QRhiWidget. It is also possible to force the QRhi-based flushing always, regardless of the presence of render-to-texture widgets. To exercise this, set the env.var. QT_WIDGETS_RHI=1. This picks a platform-specific default, and can be overridden with QT_WIDGETS_RHI_BACKEND. (in sync with Qt Quick) This can eventually be extended to query the platform plugin as well to check if the platform plugin prefers to always do flushes with a 3D API. QOpenGLWidget should work like before from the user's perspective, while internally it has to do some things differently to play nice and prevent regressions with the new rendering architecture. To exercise this better, the qopenglwidget example gets a new tab-based view (that could perhaps replace the example's main window later on?). The openglwidget manual test is made compatible with Qt 6, and gets a counterpart in form of the dockedopenglwidget manual test, which is a modified version of the cube example that features dock widgets. This is relevant in particular because render-to-texture widgets within a QDockWidget has its own specific quirks, with logic taking this into account, hence testing is essential. For existing applications there are two important consequences with this patch in place: - Once the rhi-based composition is enabled, it stays active for the lifetime of the top-level window. - Dynamically creating and parenting the first render-to-texture widget to an already created tlw will destroy and recreate the tlw (and the underlying window). The visible effects of this depend on the platform. (e.g. the window may disappear and reappear on some, whereas with other windowing systems it is not noticeable at all - this is not really different from similar situtions with reparenting or when moving windows between screens, so should be acceptable in practice) - On iOS raster windows are flushed with Metal (and rhi) from now on (previously this was through OpenGL by making flush() call composeAndFlush(). Change-Id: Id05bd0f7a26fa845f8b7ad8eedda3b0e78ab7a4e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2021-12-091-1/+1
| | | | | | | | | | Using REQUIRED as a prefix instead of suffix works better with OPTIONAL_COMPONENTS, and is also the order in the CMake manual. Task-number: QTBUG-98867 Pick-to: 6.2 Change-Id: I1ab68408b95d8edf06272a3b9fceccd8d8e597fc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Revert "Remove the qmake project files" for snippetsNico Vertriest2021-02-121-0/+3
| | | | | | | | | | | This reverts a limited part of commit ad2da2d27a590333fc89a56fc58700a09c3017b3 that deleted .pro files for snippets compilation. Some .pro files which contain snippets used in the documentation itself should be restored. Task-number: QTBUG-90483 Change-Id: I1b03833c8ff17b5fca43a5b6c5417e8545b1711b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-3/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-11-301-1/+1
| | | | | | | | | | | | | | The Professional CMake book suggests always using explicit linkage with target_link_libraries, so let's use that. Whether to use PUBLIC or PRIVATE depends on the context. But let's be conservative and advise on using PRIVATE by default. Task-number: QTBUG-88935 Pick-to: 6.0 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Prefer versioned CMake library targetsv6.0.0-beta3Kai Koehne2020-11-011-1/+1
| | | | | | | | The non-versioned one's do miss some properties. It's therefore best to not advocate using them. Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Organize QtOpenGLWidgets documentationVolker Hilsheimer2020-10-294-0/+526
| | | | | | | | | | | Move snippets to the right place, and give the widgets class a place to live. QtOpenGLWidgets is just a library, not a separate module, but we need a module page that the class can refer to for correct build instructions. Change-Id: I6d955ad3c4cd1003a828cc1f256deb6e7fb50ec4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Document how to use CMake for Qt OpenGLKai Koehne2020-05-264-56/+7
| | | | | | Task-number: QTBUG-73058 Change-Id: I8ba85fbba533c882ef63c56c1b9f20becfb36ebc Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove deprecated QGL* classesJohan Klokkhammer Helsing2019-12-117-667/+0
| | | | | | | | | | | | | | | Removes QGL paths in sub-attaq and chip examples. The boxes example depended on QGL and has been removed. The corresponding module and test directories for the opengl module are now empty, but has been left there so we can move the QOpenGL* classes there. [ChangeLog][QtOpenGL] The deprecated QGL* classes have been removed. Fixes: QTBUG-74408 Change-Id: I52f56409af8f6901359462a7ba162103d051fe3d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QtOpenGL: Unify license headersKai Koehne2019-01-293-58/+91
| | | | | Change-Id: Ia25b8f9833bd3d941ef73dcc7c6590063fe65329 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-153-0/+208
| | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Add missing override and remove redundant virtual for snippetsAlexander Volkov2018-08-161-3/+3
| | | | | Change-Id: I2395fd01b93c4ea364225e0cf1a5f59908b691d0 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Unify license header usage.Jani Heikkinen2016-03-295-15/+65
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-155-15/+15
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-115-25/+25
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-185-5/+5
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-225-30/+30
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Don't add C-style copyright headers to qmake project filesMarius Storm-Olsen2012-05-101-40/+0
| | | | | | | | Leads to parse errors, and we don't really put copyrights into these files anyways. Change-Id: I4b423b3f4f5c4f1f5051d8e3613133c4f1df342a Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Modularize QtOpenGL documentation.Casper van Donderen2012-05-096-0/+472
This change moves the snippets to the modularized directories. Change-Id: Ifcf22fa3f234681f851d1e7eed5fe44e2e223ffd Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>