Qt OpenGL

警告: This module should not be used anymore for new code. Please use the corresponding OpenGL classes in Qt GUI .

OpenGL is a standard API for rendering 3D graphics. OpenGL only deals with 3D rendering and provides little or no support for GUI programming issues. The user interface for an OpenGL application must be created with another toolkit, such as Cocoa on the macOS platform, Microsoft Foundation Classes (MFC) under Windows, or Qt on both platforms.

The Qt OpenGL module makes it easy to use OpenGL in Qt applications. It provides an OpenGL widget class that can be used just like any other Qt widget, except that it opens an OpenGL display buffer where you can use the OpenGL API to render the contents.

要包括模塊類定義,使用以下指令:

#include <QtOpenGL>
					

要鏈接到模塊,添加此行到 qmake .pro 文件:

QT += opengl
					

The Qt OpenGL module is implemented as a platform-independent Qt/C++ wrapper around the platform-dependent GLX (version 1.3 or later), WGL, or AGL C APIs. Although the basic functionality provided is very similar to Mark Kilgard's GLUT library, applications using the Qt OpenGL module can take advantage of the whole Qt API for non-OpenGL-specific GUI functionality.

The Qt OpenGL C++ 類 頁麵給齣此模塊中可用類的概述。

許可和商標

Qt OpenGL 模塊在商業許可下是可用的來自 Qt 公司 。此外,它在自由軟件許可下也是可用的。從 Qt 5.4 起,這些自由軟件許可是 GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。

OpenGL ® 是 Silicon (矽榖) 圖形公司在美國及其它國傢的商標。