pub struct Frame {
pub clear_color: [f32; 4],
/* private fields */
}Fields§
§clear_color: [f32; 4]Implementations§
Source§impl Frame
impl Frame
Sourcepub fn painter<'a>(&'a mut self, gfx: &'a mut Graphics) -> Painter<'a>
pub fn painter<'a>(&'a mut self, gfx: &'a mut Graphics) -> Painter<'a>
Begin a 2D rendering pass. Returns a Painter that flushes on drop.
pub fn encoder_mut(&mut self) -> Option<&mut CommandEncoder>
Sourcepub fn view(&self) -> &TextureView
pub fn view(&self) -> &TextureView
The window’s (surface’s) view. With a virtual resolution the painter draws into the
canvas instead (Self::target_view), which is scaled onto this view by
Graphics::flush_pending or at the end of the frame.
Sourcepub fn target_view(&self) -> &TextureView
pub fn target_view(&self) -> &TextureView
The view the painter draws into: the virtual-resolution canvas when one is set, else the window’s view.
With indexed colour on (Self::target_is_indexed) this is the index canvas: it holds
palette indices, not colours. Write them with index_out from
INDEX_WGSL (feature indexed); an RGBA pass would write meaningless indices. Colour
effects belong in a PostEffect, which sees the resolved colours.
Sourcepub fn target_is_indexed(&self) -> bool
pub fn target_is_indexed(&self) -> bool
Whether Self::target_view holds palette indices (indexed colour was on when the
frame began) rather than colours. Always false without the indexed feature.
Sourcepub fn view_and_encoder(&mut self) -> (&TextureView, &mut CommandEncoder)
pub fn view_and_encoder(&mut self) -> (&TextureView, &mut CommandEncoder)
Split borrow of the view and encoder so overlays (egui, custom passes) can record into the same frame without fighting the borrow checker.
Auto Trait Implementations§
impl !RefUnwindSafe for Frame
impl !UnwindSafe for Frame
impl Forget for Frame
impl Freeze for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
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> 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.