![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtGui More...
#include <qsurface.h>
Public Types | |
enum | SurfaceClass { Window , Offscreen } |
The SurfaceClass enum describes the actual subclass of the surface. More... | |
enum | SurfaceType { RasterSurface , OpenGLSurface , RasterGLSurface , OpenVGSurface , VulkanSurface , MetalSurface , Direct3DSurface } |
The SurfaceType enum describes what type of surface this is. More... | |
Public Member Functions | |
virtual | ~QSurface () |
Destroys the surface. | |
SurfaceClass | surfaceClass () const |
Returns the surface class of this surface. | |
virtual QSurfaceFormat | format () const =0 |
Returns the format of the surface. | |
virtual QPlatformSurface * | surfaceHandle () const =0 |
Returns a handle to the platform-specific implementation of the surface. | |
virtual SurfaceType | surfaceType () const =0 |
Returns the type of the surface. | |
bool | supportsOpenGL () const |
Returns true if the surface is OpenGL compatible and can be used in conjunction with QOpenGLContext; otherwise returns false. | |
virtual QSize | size () const =0 |
Returns the size of the surface in pixels. | |
Protected Member Functions | |
QSurface (SurfaceClass type) | |
Creates a surface with the given type. | |
Protected Attributes | |
SurfaceClass | m_type |
QSurfacePrivate * | m_reserved |
\inmodule QtGui
The QSurface class is an abstraction of renderable surfaces in Qt.
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 20 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 24 of file qsurface.h.
The SurfaceType enum describes what type of surface this is.
\value RasterSurface The surface 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 30 of file qsurface.h.
|
virtual |
Destroys the surface.
Definition at line 109 of file qsurface.cpp.
References context, and QOpenGLContext::currentContext().
|
explicitprotected |
Creates a surface with the given type.
Definition at line 101 of file qsurface.cpp.
|
pure virtual |
Returns the format of the surface.
Implemented in QOffscreenSurface, and QWindow.
Referenced by QOpenGLContext::swapBuffers().
|
pure virtual |
Returns the size of the surface in pixels.
Implemented in QOffscreenSurface, and QWindow.
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 70 of file qsurface.cpp.
References QPlatformIntegration::hasCapability(), QGuiApplicationPrivate::instance(), QPlatformIntegration::OpenGLOnRasterSurface, and QGuiApplicationPrivate::platformIntegration().
Referenced by QCocoaWindow::isOpaque(), QEGLPlatformContext::makeCurrent(), QCocoaGLContext::makeCurrent(), QWindowsGLContext::makeCurrent(), QGLXContext::makeCurrent(), QOpenGLContext::makeCurrent(), and QOpenGLContext::swapBuffers().
QSurface::SurfaceClass QSurface::surfaceClass | ( | ) | const |
Returns the surface class of this surface.
Definition at line 121 of file qsurface.cpp.
References m_type.
Referenced by QSGRhiAtlasTexture::Manager::Manager(), currentSurfaceForCurrentContext(), QIOSContext::defaultFramebufferObject(), QAndroidPlatformOpenGLContext::eglSurfaceForPlatformSurface(), QEglFSContext::eglSurfaceForPlatformSurface(), QXcbEglContext::eglSurfaceForPlatformSurface(), QRhiGles2::ensureContext(), QCocoaGLContext::makeCurrent(), QIOSContext::makeCurrent(), QGLXContext::makeCurrent(), operator<<(), screenForPlatformSurface(), QAndroidPlatformOpenGLContext::swapBuffers(), QCocoaGLContext::swapBuffers(), QEglFSContext::swapBuffers(), QIOSContext::swapBuffers(), QXcbEglContext::swapBuffers(), and QGLXContext::swapBuffers().
|
pure virtual |
Returns a handle to the platform-specific implementation of the surface.
Implemented in QOffscreenSurface.
Referenced by currentSurfaceForCurrentContext(), QOpenGLVertexArrayObjectPrivate::destroy(), QRhiGles2::ensureContext(), QOpenGLContext::makeCurrent(), and QOpenGLContext::swapBuffers().
|
pure virtual |
Returns the type of the surface.
Implemented in QOffscreenSurface, and QWindow.
Referenced by QPlatformSurface::isRasterSurface().
|
protected |
Definition at line 58 of file qsurface.h.
|
protected |
Definition at line 56 of file qsurface.h.
Referenced by surfaceClass().