Enum bevy_internal::winit::UpdateMode
source · pub enum UpdateMode {
Continuous,
Reactive {
wait: Duration,
},
ReactiveLowPower {
wait: Duration,
},
}
Expand description
Determines how frequently an App
should update.
Note: This setting is independent of VSync. VSync is controlled by a window’s
PresentMode
setting. If an app can update faster than the refresh
rate, but VSync is enabled, the update rate will be indirectly limited by the renderer.
Variants§
Continuous
Reactive
Fields
wait: Duration
The approximate time from the start of one update to the next.
Note: This has no upper limit.
The App
will wait indefinitely if you set this to Duration::MAX
.
The App
will update in response to the following, until an
AppExit
event appears:
wait
time has elapsed since the previous update- a redraw has been requested by
RequestRedraw
- new window or raw input events have appeared
ReactiveLowPower
Fields
wait: Duration
The approximate time from the start of one update to the next.
Note: This has no upper limit.
The App
will wait indefinitely if you set this to Duration::MAX
.
The App
will update in response to the following, until an
AppExit
event appears:
wait
time has elapsed since the previous update- a redraw has been requested by
RequestRedraw
- new window events have appeared
Note: Unlike Reactive
, this mode will ignore events that
don’t come from interacting with a window, like MouseMotion
.
Use this mode if, for example, you only want your app to update when the mouse cursor is
moving over a window, not just moving in general. This can greatly reduce power consumption.
Trait Implementations§
source§impl Clone for UpdateMode
impl Clone for UpdateMode
source§fn clone(&self) -> UpdateMode
fn clone(&self) -> UpdateMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UpdateMode
impl Debug for UpdateMode
impl Copy for UpdateMode
Auto Trait Implementations§
impl RefUnwindSafe for UpdateMode
impl Send for UpdateMode
impl Sync for UpdateMode
impl Unpin for UpdateMode
impl UnwindSafe for UpdateMode
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§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.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
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.