Instance Method

canDraw(in:pixelFormat:forLayerTime:displayTime:)

Invoked to ask the layer whether it can (or should) draw.

Declaration

func canDraw(in context: NSOpenGLContext, pixelFormat: NSOpenGLPixelFormat, forLayerTime t: CFTimeInterval, displayTime ts: UnsafePointer<CVTimeStamp>) -> Bool

Parameters

context

The NSOpenGLContext in to which the OpenGL content would be drawn.

pixelFormat

The pixel format used when the context was created.

timeInterval

The current layer time.

timeStamp

The display timestamp associated with timeInterval. Can be null.

Return Value

true if the receiver should render OpenGL content, false otherwise.

Discussion

This method is called before attempting to render the frame for the layer time specified by timeInterval. If the method returns false, the frame is skipped. The default implementation always returns true.