pub struct FrameInput {
pub cam: Camera2d,
pub world_size: [f32; 2],
pub viewport_dp: [f32; 2],
pub sprites: Vec<SpriteInstance>,
pub texts: Vec<WorldText>,
pub background: Option<[f32; 4]>,
pub overlay_color: Option<[f32; 4]>,
pub chroma: f32,
}Expand description
Everything the viewport draws this frame. Plain snapshot data.
Framing contract: canvas, GPU, and picks all derive from world_size
camthrougheffective_fit/fit_view_proj/world_to_dp.
Fields§
§cam: Camera2d§world_size: [f32; 2]World-space extent the contain-fit maps into the viewport.
viewport_dp: [f32; 2]Cold-start viewport size in dp (physical px / density), used for
the GPU camera until the first painted FrameGeom arrives.
Divide physical px by density before storing here.
sprites: Vec<SpriteInstance>§texts: Vec<WorldText>World-anchored text, drawn after the sprite pass on canvas. GPU viewports ignore this field; compose texts as sibling views.
background: Option<[f32; 4]>Full-viewport fill under everything (letterbox included).
overlay_color: Option<[f32; 4]>Optional fullscreen tint, applied after the sprite pass on
canvas and GPU ((c * 255) as u8 per channel, alpha-blended).
chroma: f32Chromatic aberration amount. GPU renders offscreen and composites
back with an RGB split; 0.0 draws the batch into the main pass.
Canvas ignores it (vector path has no pixels to sample).
Trait Implementations§
Source§impl Clone for FrameInput
impl Clone for FrameInput
Source§impl Debug for FrameInput
impl Debug for FrameInput
Auto Trait Implementations§
impl Freeze for FrameInput
impl RefUnwindSafe for FrameInput
impl Send for FrameInput
impl Sync for FrameInput
impl Unpin for FrameInput
impl UnsafeUnpin for FrameInput
impl UnwindSafe for FrameInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.