CopperSpice API  1.9.1
QSurface Class Referenceabstract

The QSurface class is an abstraction of renderable surfaces. More...

Inheritance diagram for QSurface:
QOffscreenSurface QWindow QPaintDeviceWindow QVulkanWindow QOpenGLWindow QRasterWindow

Public Types

enum  SurfaceClass
 
enum  SurfaceType
 

Public Methods

virtual ~QSurface ()
 
virtual QSurfaceFormat format () const = 0
 
virtual QSize size () const = 0
 
bool supportsOpenGL () const
 
SurfaceClass surfaceClass () const
 
virtual QPlatformSurfacesurfaceHandle () const = 0
 
virtual SurfaceType surfaceType () const = 0
 

Protected Methods

 QSurface (SurfaceClass type)
 

Detailed Description

The QSurface class is an abstraction of renderable surfaces. The size of the surface is accessible with the size() method. The rendering specific attributes of the surface are accessible through the format() method.

Member Enumeration Documentation

The SurfaceClass enum describes the actual subclass of the surface.

Constant Value Description
QSurface::Window 0 Surface is an instance of QWindow
QSurface::Offscreen 1 Surface is an instance of QOffscreenSurface

The SurfaceType enum describes what type of surface this is.

Constant Value Description
QSurface::RasterSurface 0 Surface is composed of pixels and can be rendered to using a software rasterizer like the raster paint engine.
QSurface::OpenGLSurface 1 Surface is an OpenGL compatible surface and can be used in conjunction with QOpenGLContext.
QSurface::RasterGLSurface 2 Surface can be rendered to using a software rasterizer, and also supports OpenGL. This surface type is intended for internal use and requires the use of private API.
QSurface::VulkanSurface 3 Surface is a Vulkan compatible surface and can be used in conjunction with the Vulkan graphics API.

Constructor & Destructor Documentation

QSurface::~QSurface ( )
virtual

Destroys the surface.

QSurface::QSurface ( SurfaceClass  type)
explicitprotected

Creates a surface with the given type.

Method Documentation

QSurfaceFormat QSurface::format ( ) const
pure virtual

Returns the format of the surface.

Implemented in QWindow::format(), QOffscreenSurface::format()

QSize QSurface::size ( ) const
pure virtual

Returns the size of the surface in pixels.

Implemented in QWindow::size(), QOffscreenSurface::size()

bool QSurface::supportsOpenGL ( ) const

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

QSurface::SurfaceClass QSurface::surfaceClass ( ) const

Returns the surface class of this surface.

QPlatformSurface * QSurface::surfaceHandle ( ) const
pure virtual

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

SurfaceType QSurface::surfaceType ( ) const
pure virtual

Returns the type of the surface.

Implemented in QWindow::surfaceType(), QOffscreenSurface::surfaceType()