Qt OpenGL 范例

这些示例介绍了如何使用 Qt OpenGL模块。

Qt 支持与 OpenGL 实现集成,使开发人员有机会在显示传统用户界面的同时显示硬件加速的 3D 图形。

这些示例演示了在 Qt 应用程序中利用 OpenGL 的基本技术。

2D Painting Example

2D 绘图示例展示了如何将 QPainter 和 QOpenGLWidget 结合使用,在支持的硬件上显示加速的 2D 图形。

Cube OpenGL ES 2.0 example

显示如何通过用户输入手动旋转纹理 3D 立方体。

Hello GL2 Example

Hello GL2 示例演示了 Qt 提供的 OpenGL 相关类的基本使用方法。

Hello GLES3 Example

通过 QOpenGLExtraFunctions 演示 OpenGL ES 3.0 功能。

OpenGL Window Example

该示例演示了如何为使用 OpenGL 创建一个基于 QWindow 的最小应用程序。

QOpenGLWidget Stereoscopic Rendering Example

该示例演示了如何创建一个支持立体渲染的基于 QOpenGLWidget 的最小应用程序。

Textures Example

Textures 示例演示了如何在同时使用 Qt OpenGL 和 Qt 显示图形的应用程序中使用 Qt 的图像类作为纹理。

© 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.