Enum bevy::window::PresentMode
pub enum PresentMode {
AutoVsync,
AutoNoVsync,
Immediate,
Mailbox,
Fifo,
}
Expand description
Presentation mode for a window.
The presentation mode specifies when a frame is presented to the window. The Fifo
option corresponds to a traditional VSync
, where the framerate is capped by the
display refresh rate. Both Immediate
and Mailbox
are low-latency and are not
capped by the refresh rate, but may not be available on all platforms. Tearing
may be observed with Immediate
mode, but will not be observed with Mailbox
or
Fifo
.
AutoVsync
or AutoNoVsync
will gracefully fallback to Fifo
when unavailable.
Immediate
or Mailbox
will panic if not supported by the platform.
The presentation mode may be declared in the WindowDescriptor
using WindowDescriptor::present_mode
or updated on a Window
using set_present_mode
.
Variants§
AutoVsync
Chooses FifoRelaxed -> Fifo based on availability.
Because of the fallback behavior, it is supported everywhere.
AutoNoVsync
Chooses Immediate -> Mailbox -> Fifo (on web) based on availability.
Because of the fallback behavior, it is supported everywhere.
Immediate
The presentation engine does not wait for a vertical blanking period and the request is presented immediately. This is a low-latency presentation mode, but visible tearing may be observed. Not optimal for mobile.
Selecting this variant will panic if not supported, it is preferred to use
PresentMode::AutoNoVsync
.
Mailbox
The presentation engine waits for the next vertical blanking period to update the current image, but frames may be submitted without delay. This is a low-latency presentation mode and visible tearing will not be observed. Not optimal for mobile.
Selecting this variant will panic if not supported, it is preferred to use
PresentMode::AutoNoVsync
.
Fifo
The presentation engine waits for the next vertical blanking period to update
the current image. The framerate will be capped at the display refresh rate,
corresponding to the VSync
. Tearing cannot be observed. Optimal for mobile.
Trait Implementations§
§impl Clone for PresentMode
impl Clone for PresentMode
§fn clone(&self) -> PresentMode
fn clone(&self) -> PresentMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for PresentMode
impl Debug for PresentMode
§impl Hash for PresentMode
impl Hash for PresentMode
§impl PartialEq<PresentMode> for PresentMode
impl PartialEq<PresentMode> for PresentMode
§fn eq(&self, other: &PresentMode) -> bool
fn eq(&self, other: &PresentMode) -> bool
impl Copy for PresentMode
impl Eq for PresentMode
impl StructuralEq for PresentMode
impl StructuralPartialEq for PresentMode
Auto Trait Implementations§
impl RefUnwindSafe for PresentMode
impl Send for PresentMode
impl Sync for PresentMode
impl Unpin for PresentMode
impl UnwindSafe for PresentMode
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist. Read more§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more§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. Read more§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. Read moresource§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.