pub struct MotionFrameHost { /* private fields */ }Expand description
Renderer-neutral host state for one adapter-owned motion frame source.
The host does not schedule frames by itself. It records the latest motion demand and returns a small decision object that the owning adapter can translate into its own frame request API.
Implementations§
Source§impl MotionFrameHost
impl MotionFrameHost
Sourcepub const fn last_elapsed(&self) -> Duration
pub const fn last_elapsed(&self) -> Duration
Returns the last clamped elapsed time observed by this host.
Sourcepub const fn last_frame_demand(&self) -> MotionFrameDemand
pub const fn last_frame_demand(&self) -> MotionFrameDemand
Returns the latest frame demand observed by this host.
Sourcepub const fn requested_frames(&self) -> u64
pub const fn requested_frames(&self) -> u64
Returns how many frame requests this host has asked the adapter to issue.
Sourcepub fn observe(
&mut self,
frame_demand: MotionFrameDemand,
) -> MotionFrameHostUpdate
pub fn observe( &mut self, frame_demand: MotionFrameDemand, ) -> MotionFrameHostUpdate
Observes a frame demand and returns the adapter decision for this render pass.
Sourcepub fn observe_all(
&mut self,
demands: impl IntoIterator<Item = MotionFrameDemand>,
) -> MotionFrameHostUpdate
pub fn observe_all( &mut self, demands: impl IntoIterator<Item = MotionFrameDemand>, ) -> MotionFrameHostUpdate
Combines many frame demands and returns the adapter decision for this render pass.
Sourcepub fn sample_elapsed<T>(
&mut self,
requested_elapsed: Duration,
sample: impl FnOnce(MotionClockSample) -> (T, MotionFrameDemand),
) -> MotionFrameHostSample<T>
pub fn sample_elapsed<T>( &mut self, requested_elapsed: Duration, sample: impl FnOnce(MotionClockSample) -> (T, MotionFrameDemand), ) -> MotionFrameHostSample<T>
Samples motion from explicit adapter elapsed time and records the returned frame demand.
Sourcepub fn sample_since<T>(
&mut self,
started_at: Instant,
now: Instant,
sample: impl FnOnce(MotionClockSample) -> (T, MotionFrameDemand),
) -> MotionFrameHostSample<T>
pub fn sample_since<T>( &mut self, started_at: Instant, now: Instant, sample: impl FnOnce(MotionClockSample) -> (T, MotionFrameDemand), ) -> MotionFrameHostSample<T>
Samples motion from adapter instants and records the returned frame demand.
If the owner’s run epoch changes, call Self::reset before sampling the new run.