A layer that provides a layer suitable for rendering OpenGL content.


class CAOpenGLLayer : CALayer


To provide OpenGL content you subclass CAOpenGLLayer and override draw(inCGLContext:pixelFormat:forLayerTime:displayTime:). You can specify that the OpenGL content is static by setting the isAsynchronous property to false.


Determining Layer Properties

var colorspace: CGColorSpace?

The layer's colorspace in Core Graphics.

var wantsExtendedDynamicRangeContent: Bool

Tells whether or not the layer supports content with extended dynamic range.

Managing Pixel Format

func copyCGLPixelFormat(forDisplayMask: UInt32) -> CGLPixelFormatObj

Returns the OpenGL pixel format suitable for rendering to the set of displays specified by the display mask.

func releaseCGLPixelFormat(CGLPixelFormatObj)

Releases the specified OpenGL pixel format object.

Managing the Rendering Context

func copyCGLContext(forPixelFormat: CGLPixelFormatObj) -> CGLContextObj

Returns the rendering context the receiver requires for the specified pixel format.

func releaseCGLContext(CGLContextObj)

Releases the specified rendering context.


Inherits From

Conforms To

See Also

Metal and OpenGL

class CAMetalLayer

A Core Animation layer that Metal can render into, typically to be displayed onscreen.

protocol CAMetalDrawable

A Metal drawable associated with a Core Animation layer.

class CAEAGLLayer

A layer that supports drawing OpenGL content in iOS and tvOS applications.

class CAEDRMetadata

Metadata describing how extended dynamic range (EDR) values should be tone mapped.

class CARenderer

A layer that allows an application to render a layer tree into a Core OpenGL context.