QSurface 類是 Qt 中可渲染錶麵的抽象。 更多...
| 頭: |
#include <QSurface>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
|
| qmake: |
QT += gui
|
| 繼承者: |
| enum | SurfaceClass { Window, Offscreen } |
| enum | SurfaceType { RasterSurface, OpenGLSurface, RasterGLSurface, OpenVGSurface, VulkanSurface, …, Direct3DSurface } |
| virtual | ~QSurface () |
| virtual QSurfaceFormat | format () const = 0 |
| virtual QSize | size () const = 0 |
| bool | supportsOpenGL () const |
| QSurface::SurfaceClass | surfaceClass () const |
| virtual QPlatformSurface * | surfaceHandle () const = 0 |
| virtual QSurface::SurfaceType | surfaceType () const = 0 |
| QSurface (QSurface::SurfaceClass type ) |
錶麵尺寸可訪問采用 size () 函數。錶麵的渲染特定屬性可訪問透過 format () 函數。
SurfaceClass 枚舉描述錶麵的實際子類。
| 常量 | 值 | 描述 |
|---|---|---|
QSurface::Window
|
0
|
錶麵是實例化的 QWindow . |
QSurface::Offscreen
|
1
|
錶麵是實例化的 QOffscreenSurface . |
SurfaceType 枚舉描述錶麵是什麼類型。
| 常量 | 值 | 描述 |
|---|---|---|
QSurface::RasterSurface
|
0
|
The surface is composed of pixels and can be rendered to using a software rasterizer like Qt's raster paint engine. |
QSurface::OpenGLSurface
|
1
|
錶麵是 OpenGL 兼容錶麵且可以用於結閤 QOpenGLContext . |
QSurface::RasterGLSurface
|
2
|
The surface can be rendered to using a software rasterizer, and also supports OpenGL. This surface type is intended for internal Qt use, and requires the use of private API. |
QSurface::OpenVGSurface
|
3
|
The surface is an OpenVG compatible surface and can be used in conjunction with OpenVG contexts. |
QSurface::VulkanSurface
|
4
|
The surface is a Vulkan compatible surface and can be used in conjunction with the Vulkan graphics API. |
QSurface::MetalSurface
|
5
|
The surface is a Metal compatible surface and can be used in conjunction with Apple's Metal graphics API. This surface type is only supported on macOS and iOS. |
QSurface::Direct3DSurface
|
6
|
The surface is a Direct 3D 11 and 12 compatible surface and can be used in conjunction with the DXGI and Direct3D APIs. This surface type is only supported on Windows. |
[explicit protected]
QSurface::
QSurface
(
QSurface::SurfaceClass
type
)
創建錶麵,采用給定 type .
[virtual noexcept]
QSurface::
~QSurface
()
銷毀此錶麵。
[pure virtual]
QSurfaceFormat
QSurface::
format
() const
返迴錶麵的格式。
[pure virtual]
QSize
QSurface::
size
() const
返迴錶麵大小 (以像素為單位)。
返迴 true 若錶麵兼容 OpenGL 且可以用於結閤 QOpenGLContext ;否則返迴 false。
返迴此錶麵的錶麵類。
[pure virtual]
QPlatformSurface
*QSurface::
surfaceHandle
() const
返迴特定平颱的錶麵實現句柄。
[pure virtual]
QSurface::SurfaceType
QSurface::
surfaceType
() const
返迴錶麵的類型。