pub enum SurfacePhase {
NoSurface,
SurfaceReady,
SurfaceLost,
}Expand description
Which lifecycle state the surface is in.
Rendering only happens in SurfacePhase::SurfaceReady; the other two
phases mean there is no usable swapchain and frames are skipped.
Variants§
NoSurface
No surface has been created yet, or the surface was explicitly destroyed.
SurfaceReady
A configured surface is available and frames can be rendered.
SurfaceLost
The surface was lost mid-render (e.g. ERROR_SURFACE_LOST_KHR); it has
been dropped and the shell must recreate it via on_surface_created.
Implementations§
Source§impl SurfacePhase
impl SurfacePhase
Sourcepub fn can_render(self) -> bool
pub fn can_render(self) -> bool
Whether a frame may be rendered in this phase.
Only SurfacePhase::SurfaceReady can render; the machine drops frames
in every other phase rather than queueing them.
Trait Implementations§
Source§impl Clone for SurfacePhase
impl Clone for SurfacePhase
Source§fn clone(&self) -> SurfacePhase
fn clone(&self) -> SurfacePhase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SurfacePhase
Source§impl Debug for SurfacePhase
impl Debug for SurfacePhase
impl Eq for SurfacePhase
Source§impl PartialEq for SurfacePhase
impl PartialEq for SurfacePhase
impl StructuralPartialEq for SurfacePhase
Auto Trait Implementations§
impl Freeze for SurfacePhase
impl RefUnwindSafe for SurfacePhase
impl Send for SurfacePhase
impl Sync for SurfacePhase
impl Unpin for SurfacePhase
impl UnsafeUnpin for SurfacePhase
impl UnwindSafe for SurfacePhase
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
Mutably borrows from an owned value. Read more
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.