cp_drawable_t
A type that provides the textures and information you need to draw a frame of content.
Declaration
typedef struct cp_drawable * cp_drawable_t;Discussion
When you draw a frame of content, the frame’s cp_drawable_t type provides the actual textures and rendering information you need. Do as much work as possible in advance to prepare for rendering, and retrieve the cp_drawable_t only when you’re ready to start encoding commands into your Metal command buffers. The system recycles frames and their drawables for efficiency, so if you retrieve the drawable too early, it might not be ready to use.
Use the drawable’s LayerRenderer.Drawable.View instances to determine where to draw your content in the provided textures. After you finish encoding your content, call encodePresent(commandBuffer:) to add a presentation notification to your command buffer. This command tells Compositor Services when to display the frame, and is essential for displaying your frame on time.