pub enum SwapInterval {
DontWait,
Wait(NonZeroU32),
}
Expand description
A swap interval.
The default swap interval for your Surface
is platform-dependent. For
example, on EGL it is 1
by default, but on GLX it is 0
by default.
Please note that your application’s desired swap interval may be overridden
by external, driver-specific configuration, which means that you can’t know
in advance whether crate::surface::GlSurface::swap_buffers
will block
or not.
§Platform specific
- Wayland: when the window is hidden and
SwapInterval::Wait
is usedGlSurface::swap_buffers
and any functions based on it may block until the window is visible again. Using this variant is not recommended on Wayland and instead the throttling should be performed byframe callbacks
.
Variants§
DontWait
When this variant is used calling
crate::surface::GlSurface::swap_buffers()
will not block.
Wait(NonZeroU32)
The swap is synchronized to the n
’th video frame. This is typically
set to 1
to enable vsync and prevent screen tearing.
Trait Implementations§
Source§impl Clone for SwapInterval
impl Clone for SwapInterval
Source§fn clone(&self) -> SwapInterval
fn clone(&self) -> SwapInterval
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SwapInterval
impl Debug for SwapInterval
Source§impl PartialEq for SwapInterval
impl PartialEq for SwapInterval
impl Copy for SwapInterval
impl Eq for SwapInterval
impl StructuralPartialEq for SwapInterval
Auto Trait Implementations§
impl Freeze for SwapInterval
impl RefUnwindSafe for SwapInterval
impl Send for SwapInterval
impl Sync for SwapInterval
impl Unpin for SwapInterval
impl UnwindSafe for SwapInterval
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