QtBase
v6.3.1
|
The QSurface class is an abstraction of renderable surfaces in Qt. More...
#include <qsurface.h>
Public Types | |
enum | SurfaceClass { Window , Offscreen } |
enum | SurfaceType { RasterSurface , OpenGLSurface , RasterGLSurface , OpenVGSurface , VulkanSurface , MetalSurface , Direct3DSurface } |
Public Member Functions | |
virtual | ~QSurface () |
SurfaceClass | surfaceClass () const |
virtual QSurfaceFormat | format () const =0 |
virtual QPlatformSurface * | surfaceHandle () const =0 |
virtual SurfaceType | surfaceType () const =0 |
bool | supportsOpenGL () const |
virtual QSize | size () const =0 |
Protected Member Functions | |
QSurface (SurfaceClass type) | |
Protected Attributes | |
SurfaceClass | m_type |
QSurfacePrivate * | m_reserved |
The QSurface class is an abstraction of renderable surfaces in Qt.
\inmodule QtGui
The size of the surface is accessible with the size() function. The rendering specific attributes of the surface are accessible through the format() function.
Definition at line 56 of file qsurface.h.
The SurfaceClass enum describes the actual subclass of the surface.
\value Window The surface is an instance of QWindow. \value Offscreen The surface is an instance of QOffscreenSurface.
Enumerator | |
---|---|
Window | |
Offscreen |
Definition at line 60 of file qsurface.h.
The SurfaceType enum describes what type of surface this is.
\value RasterSurface The surface is is composed of pixels and can be rendered to using a software rasterizer like Qt's raster paint engine. \value OpenGLSurface The surface is an OpenGL compatible surface and can be used in conjunction with QOpenGLContext. \value RasterGLSurface 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. \value OpenVGSurface The surface is an OpenVG compatible surface and can be used in conjunction with OpenVG contexts. \value VulkanSurface The surface is a Vulkan compatible surface and can be used in conjunction with the Vulkan graphics API. \value MetalSurface 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. \value Direct3DSurface 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.
Enumerator | |
---|---|
RasterSurface | |
OpenGLSurface | |
RasterGLSurface | |
OpenVGSurface | |
VulkanSurface | |
MetalSurface | |
Direct3DSurface |
Definition at line 66 of file qsurface.h.
|
virtual |
Destroys the surface.
Definition at line 147 of file qsurface.cpp.
|
explicitprotected |
Creates a surface with the given type.
Definition at line 139 of file qsurface.cpp.
|
pure virtual |
Returns the format of the surface.
Implemented in QOffscreenSurface.
|
pure virtual |
Returns the size of the surface in pixels.
Implemented in QOffscreenSurface.
bool QSurface::supportsOpenGL | ( | ) | const |
Returns true if the surface is OpenGL compatible and can be used in conjunction with QOpenGLContext; otherwise returns false.
Definition at line 108 of file qsurface.cpp.
QSurface::SurfaceClass QSurface::surfaceClass | ( | ) | const |
Returns the surface class of this surface.
Definition at line 159 of file qsurface.cpp.
|
pure virtual |
Returns a handle to the platform-specific implementation of the surface.
|
pure virtual |
Returns the type of the surface.
Implemented in QOffscreenSurface.
|
protected |
Definition at line 94 of file qsurface.h.
|
protected |
Definition at line 92 of file qsurface.h.