QQuickOpenGLUtils Namespace
QQuickOpenGLUtils 名称空间包含Qt Quick 与 OpenGL 后端一起使用时的实用程序。更多
头文件: | #include <QQuickOpenGLUtils> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick) target_link_libraries(mytarget PRIVATE Qt6::Quick) |
qmake: | QT += quick |
自 | Qt 6.0 |
功能
(since 6.0) void | resetOpenGLState() |
函数文档
[since 6.0]
void QQuickOpenGLUtils::resetOpenGLState()
调用此函数可重置当前 OpenGL 上下文的默认状态。
场景图使用 OpenGL 上下文,既依赖于它的状态,也会破坏它的状态。在混合使用原始 OpenGL 命令和场景图渲染时,此函数提供了一种方便的方法,可将 OpenGL 上下文状态重置为默认值。
此函数不会触及固定函数流水线中的状态。
警告 此函数只会重置与作为 OpenGL 场景图一部分的内部更改相关的 OpenGL 上下文。它不会重置任何外部已更改的内容,例如在应用程序代码内部完成的直接 OpenGL 调用,如果这些相同的调用未在内部使用(例如各种 OpenGL 3.x 或 4.x 特定状态)。
此函数在 Qt 6.0 中引入。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.