Protocol

MTLDrawable

A displayable resource that can be rendered or written to.

Declaration

@protocol MTLDrawable

Overview

Objects that implement this protocol are connected both to the Metal framework and an underlying display system (such as Core Animation) that’s capable of showing content onscreen. You use drawable objects when you want to render images using Metal and present them onscreen.

Don’t implement this protocol yourself; instead, see CAMetalLayer, for a class that can create and manage drawable objects for you.

Topics

Identifying the Drawable

drawableID

A positive integer that identifies the drawable.

Required.

Presenting the Drawable

- present

Presents the drawable onscreen as soon as possible.

Required.

- presentAfterMinimumDuration:

Presents the drawable onscreen as soon as possible after a previous drawable is visible for the specified duration.

Required.

- presentAtTime:

Presents the drawable onscreen at a specific host time.

Required.

Getting Presentation Information

- addPresentedHandler:

Registers a block of code to be called immediately after the drawable is presented.

Required.

MTLDrawablePresentedHandler

A block of code invoked after a drawable is presented.

presentedTime

The host time, in seconds, when the drawable was displayed onscreen.

Required.

Relationships

Inherits From

Inherited By

See Also

Metal Drawables

CAMetalDrawable

A Metal drawable associated with a Core Animation layer.