|
38 | 38 | APIs in each release. But some changes were inevitable in an effort to
|
39 | 39 | make Qt a better framework.
|
40 | 40 |
|
41 |
| - In this topic we summarize those changes in Qt OpenGL, and provide |
| 41 | + In this topic we summarize those changes in \l{Qt OpenGL}, and provide |
42 | 42 | guidance to handle them.
|
43 | 43 |
|
44 |
| - \section1 ADD STUFF HERE |
| 44 | + \section1 Deprecated classes removed |
45 | 45 |
|
| 46 | + The \l{Qt OpenGL} module was deprecated for the life time of Qt 5, and the |
| 47 | + classes it contained have been removed in Qt 6. |
| 48 | + |
| 49 | + This refers specifically to the classes prefixed by \c{QGL}. |
| 50 | + |
| 51 | + \section1 QOpenGL classes migrated |
| 52 | + |
| 53 | + In Qt 5, a replacement set of OpenGL-support classes were added to Qt Gui. |
| 54 | + This was in order to support OpenGL as the cross-platform graphics API that |
| 55 | + served as foundation for graphics in Qt. |
| 56 | + |
| 57 | + In Qt 6, these have been migrated to the \l{Qt OpenGL} module. They are still |
| 58 | + usable and fully supported for applications depending on OpenGL directly. |
| 59 | + However, they are no longer considered foundational, since Qt has been extended |
| 60 | + to support other graphics APIs in its foundation, such as Direct3D, Metal and |
| 61 | + Vulkan. |
| 62 | + |
| 63 | + Existing application code will largely continue working, but should now |
| 64 | + include \l{Qt OpenGL} in project files, as well as include the headers if |
| 65 | + these were previously included indirectly through Qt Gui. |
| 66 | + |
| 67 | + \note A notable exception is \l QOpenGLContext, which still resides in |
| 68 | + Qt Gui. |
| 69 | + |
| 70 | + \section1 QOpenGLWidgets |
| 71 | + |
| 72 | + Another exception is the \l QOpenGLWidget class. This has been moved to a new |
| 73 | + module named \c{Qt OpenGL Widgets} and should be included from there. |
| 74 | + |
| 75 | + \section1 Selecting the OpenGL backend for RHI |
| 76 | + |
| 77 | + In addition to adjusting project files and including headers, the application |
| 78 | + should also manually set the rendering backend to OpenGL in order to use |
| 79 | + this functionality when working with Qt Quick. By default, Qt will use the most |
| 80 | + appropriate graphics API on the target platform. See the |
| 81 | + \l{Rendering via the Qt Rendering Hardware Interface}{RHI rendering documentation} |
| 82 | + for more details. |
| 83 | + |
| 84 | + \section1 Removal of ANGLE |
| 85 | + |
| 86 | + On Windows, ANGLE, a third-party OpenGL ES to Direct 3D translator, is no |
| 87 | + longer included in Qt 6. This means \c Qt::AA_UseOpenGLES and the |
| 88 | + environment variable \c{QT_OPENGL=angle} no longer has any effect. In |
| 89 | + dynamic OpenGL builds there is no automatic fallback to ANGLE in case |
| 90 | + OpenGL-proper fails to initialize. For QWindow or QWidget based applications |
| 91 | + using OpenGL directly, for example via QOpenGLWidget, this means that |
| 92 | + OpenGL-proper is the only option at runtime. However, the use of a pure |
| 93 | + software OpenGL implementation, such as Mesa llvmpipe that is shipped with |
| 94 | + the pre-built Qt packages, is still available. |
| 95 | + |
| 96 | + For Qt Quick and Qt Quick 3D applications, Qt 6 introduces support for |
| 97 | + Direct 3D 11, Vulkan, and Metal, in addition to OpenGL. On Windows, Qt 6 |
| 98 | + defaults to Direct 3D, therefore the effect of the removal of ANGLE is |
| 99 | + lessened by the addition of support to other graphics APIs. |
46 | 100 | */
|
0 commit comments