pub struct RenderedSource<R: SceneRenderer> { /* private fields */ }Expand description
Default SceneSource implementation wrapping a scene + a
renderer. Advances one frame per pull at the scene’s declared
framerate; emits None when a finite scene’s last frame has
been yielded.
Implementations§
Source§impl<R: SceneRenderer> RenderedSource<R>
impl<R: SceneRenderer> RenderedSource<R>
Sourcepub fn new(scene: Scene, renderer: R) -> Self
pub fn new(scene: Scene, renderer: R) -> Self
Take ownership of scene + renderer. Does not call
prepare on the renderer — that happens lazily on the first
pull.
Sourcepub fn scene(&self) -> &Scene
pub fn scene(&self) -> &Scene
Access the underlying scene (read-only). Useful for tests + compositors that want to inspect state between pulls.
Sourcepub fn scene_mut(&mut self) -> &mut Scene
pub fn scene_mut(&mut self) -> &mut Scene
Mutate the scene between pulls. The streaming-compositor use
case uses this to apply Operations pulled from a control
channel. Mid-stream mutations MUST NOT shift earlier
timestamps — append-only operations (new keyframes after
next_timestamp(), new objects, removed-in-future) are
safe; rewriting existing keyframes is not.
Sourcepub fn next_timestamp(&self) -> TimeStamp
pub fn next_timestamp(&self) -> TimeStamp
Timestamp of the next frame to be pulled.