pub struct cp_frame_timing { /* private fields */ }frame_timing only.Expand description
Implementations§
Source§impl cp_frame_timing
impl cp_frame_timing
Sourcepub unsafe fn optimal_input_time(frame_timing: cp_frame_timing_t) -> cp_time_t
Available on crate feature cp_types only.
pub unsafe fn optimal_input_time(frame_timing: cp_frame_timing_t) -> cp_time_t
cp_types only.Returns the optimal time to query the input for a frame.
- Parameters:
- timing_information: The frame’s timing information. Fetch this
information using the
cp_frame_predict_timingfunction. If you already called that function once for the frame, you can call thecp_drawable_get_frame_timingfunction to get the information instead. - Returns: The Mach absolute time at which to query the input for your frame.
The returned value indicates the optimal time for you to query the input for your frame.
§Safety
frame_timing must be a valid pointer.
Sourcepub unsafe fn rendering_deadline(frame_timing: cp_frame_timing_t) -> cp_time_t
Available on crate feature cp_types only.
pub unsafe fn rendering_deadline(frame_timing: cp_frame_timing_t) -> cp_time_t
cp_types only.Returns the time at which you must finish all work for the specified frame.
- Parameters:
- timing_information: The frame’s timing information. Fetch this
information using the
cp_frame_predict_timingfunction. If you already called that function once for the frame, you can call thecp_drawable_get_frame_timingfunction to get the information instead. - Returns: The Mach absolute time at which you must finish all work for the frame. This value reflects the total presentation time minus the overhead for the compositor to render your frame and display it onscreen.
Finish all CPU and GPU work by the returned time to ensure the timely display of the frame onscreen.
§Safety
frame_timing must be a valid pointer.
Sourcepub unsafe fn presentation_time(frame_timing: cp_frame_timing_t) -> cp_time_t
Available on crate feature cp_types only.
pub unsafe fn presentation_time(frame_timing: cp_frame_timing_t) -> cp_time_t
cp_types only.Returns the time at which the system will display the frame onscreen.
- Parameters:
- timing_information: The frame’s timing information. Fetch
this information using the
cp_frame_predict_timingfunction. If you already called that function once for the frame, you can call thecp_drawable_get_frame_timingfunction to get the information instead. - Returns: The Mach absolute time at which the layer presents the frame onscreen.
You can use the presentation time as a synchronization point for other parts of your app. For example, you might play a specific audio clip when the frame appears.
§Safety
frame_timing must be a valid pointer.
Sourcepub unsafe fn trackable_anchor_time(
frame_timing: cp_frame_timing_t,
) -> cp_time_t
Available on crate feature cp_types only.
pub unsafe fn trackable_anchor_time( frame_timing: cp_frame_timing_t, ) -> cp_time_t
cp_types only.Returns the time to used to predict transform of trackable anchors to provide best content registration with the frame.
- Parameters:
- timing_information: The frame’s timing information. Fetch
this information using the
cp_frame_predict_timingfunction. If you already called that function once for the frame, you can call thecp_drawable_get_frame_timingfunction to get the information instead. - Returns: The Mach absolute time to use to predict transform of a trackable anchor.
You can use trackable anchor prediction time for prediction of ARKit trackable anchors to register rendered anchored content to the real-world objects. The offset of this time to presentation time is variable, so it is recommended to query this per-frame.
- note: For predicting ARKit device anchor use presentation time, see
cp_frame_timing_get_presentation_time
§Safety
frame_timing must be a valid pointer.