Contents

LayerRenderer.Frame

A type that provides access to the timing information and data types you need to render a single frame of content.

Declaration

struct Frame

Overview

A frame represents a snapshot of your app’s content at a single moment in time. In your rendering loop, you render your content into static images many times a second to create the illusion of animation. A LayerRenderer.Frame provides the Metal textures and information you need to render one of those images.

During each iteration of your app’s rendering loop, call queryNextFrame() to retrieve the next frame to render. The system manages a finite number of frames and recycles them to maximize efficiency. You typically draw only one frame at a time, starting work on each new frame only after completing the previous frame.

Separate the work you do for each frame into two phases: the update phase and the encode phase. Use the update phase to perform tasks that don’t depend on the current device pose. For example, you might update your app’s data structures to reflect recent interactions with your content. Use the submission phase to retrieve the current pose and render the frame’s content using that information. Each frame provides a LayerRenderer.Drawable type with access to the specific textures and rendering details for that frame.

Topics

Getting timing information

Reporting frame update times

Getting the drawable environment

Reporting frame submission times

Getting frame-related details

Creating a frame

Instance Methods

See Also

Render-loop setup