Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSurface Class Referenceabstract

\inmodule QtGui More...

#include <qsurface.h>

+ Inheritance diagram for QSurface:
+ Collaboration diagram for QSurface:

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 QPlatformSurfacesurfaceHandle () 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
 

Detailed Description

\inmodule QtGui

Since
5.0

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.

Member Enumeration Documentation

◆ SurfaceClass

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.

◆ SurfaceType

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.

Constructor & Destructor Documentation

◆ ~QSurface()

QSurface::~QSurface ( )
virtual

Destroys the surface.

Definition at line 109 of file qsurface.cpp.

References context, and QOpenGLContext::currentContext().

+ Here is the call graph for this function:

◆ QSurface()

QSurface::QSurface ( SurfaceClass type)
explicitprotected

Creates a surface with the given type.

Definition at line 101 of file qsurface.cpp.

Member Function Documentation

◆ format()

QSurfaceFormat QSurface::format ( ) const
pure virtual

Returns the format of the surface.

Implemented in QOffscreenSurface, and QWindow.

Referenced by QOpenGLContext::swapBuffers().

+ Here is the caller graph for this function:

◆ size()

QSize QSurface::size ( ) const
pure virtual

Returns the size of the surface in pixels.

Implemented in QOffscreenSurface, and QWindow.

◆ supportsOpenGL()

bool QSurface::supportsOpenGL ( ) const

Returns true if the surface is OpenGL compatible and can be used in conjunction with QOpenGLContext; otherwise returns false.

Since
5.3

Definition at line 70 of file qsurface.cpp.

References QGuiApplicationPrivate::instance(), and QPlatformIntegration::OpenGLOnRasterSurface.

Referenced by QCocoaWindow::isOpaque(), QEGLPlatformContext::makeCurrent(), QCocoaGLContext::makeCurrent(), QWindowsGLContext::makeCurrent(), QGLXContext::makeCurrent(), QOpenGLContext::makeCurrent(), and QOpenGLContext::swapBuffers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ surfaceClass()

◆ surfaceHandle()

QPlatformSurface * QSurface::surfaceHandle ( ) const
pure virtual

Returns a handle to the platform-specific implementation of the surface.

Implemented in QOffscreenSurface.

Referenced by QRhiGles2::ensureContext(), QOpenGLContext::makeCurrent(), and QOpenGLContext::swapBuffers().

+ Here is the caller graph for this function:

◆ surfaceType()

SurfaceType QSurface::surfaceType ( ) const
pure virtual

Returns the type of the surface.

Implemented in QOffscreenSurface, and QWindow.

Referenced by QPlatformSurface::isRasterSurface().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_reserved

QSurfacePrivate* QSurface::m_reserved
protected

Definition at line 58 of file qsurface.h.

◆ m_type

SurfaceClass QSurface::m_type
protected

Definition at line 56 of file qsurface.h.

Referenced by surfaceClass().


The documentation for this class was generated from the following files: