Instance Property

currentDrawable

The drawable to use for the current frame.

Declaration

@property(nonatomic, readonly) id<CAMetalDrawable> currentDrawable;

Discussion

If all drawable objects are in use, the value of this property is nil. Your app should check that currentDrawable isn’t nil before attempting to draw. The view changes the value of this property only after returning from a drawing function, either drawRect: from a subclassed instance of the view, or drawInMTKView: from the view’s delegate.

Use a MTLRenderCommandEncoder object to render into the drawable’s texture and present it for display (typically registered using the presentDrawable: method of a command buffer). Try to minimize the time between when you fetch the drawable and when you submit the command buffer that uses it. For more information, see Keeping References to Drawables.

See Also

Retrieving Render Target Information

currentRenderPassDescriptor

A render pass descriptor to draw into the current drawable.

depthStencilTexture

A packed depth and stencil texture associated with the currentDrawable object’s texture.

multisampleColorTexture

The multisample color sample texture to render into.