Skip to main content

add_frame_consumer

Function add_frame_consumer 

Source
pub fn add_frame_consumer(cb: impl FnMut(Duration) + 'static) -> FrameConsumer
Expand description

Register cb to run every animation frame with the delta since the previous frame, and start the vsync loop if it wasn’t already running. Remove with remove_frame_consumer; the frame_clock piece ties that to its scope so it stops when the piece unmounts.

Day API ↩ Guides· daybrite.dev