#[repr(transparent)]pub struct SDL_GPUPresentMode(pub c_int);Expand description
Specifies the timing that will be used to present swapchain textures to the OS.
VSYNC mode will always be supported. IMMEDIATE and MAILBOX modes may not be supported on certain systems.
It is recommended to query SDL_WindowSupportsGPUPresentMode after claiming
the window if you wish to change the present mode to IMMEDIATE or MAILBOX.
- VSYNC: Waits for vblank before presenting. No tearing is possible. If there is a pending image to present, the new image is enqueued for presentation. Disallows tearing at the cost of visual latency.
- IMMEDIATE: Immediately presents. Lowest latency option, but tearing may occur.
- MAILBOX: Waits for vblank before presenting. No tearing is possible. If there is a pending image to present, the pending image is replaced by the new image. Similar to VSYNC, but with reduced visual latency.
§Availability
This enum is available since SDL 3.2.0.
§See also
SDL_SetGPUSwapchainParametersSDL_WindowSupportsGPUPresentModeSDL_WaitAndAcquireGPUSwapchainTexture
§Known values (sdl3-sys)
| Associated constant | Global constant | Description |
|---|---|---|
VSYNC | SDL_GPU_PRESENTMODE_VSYNC | |
IMMEDIATE | SDL_GPU_PRESENTMODE_IMMEDIATE | |
MAILBOX | SDL_GPU_PRESENTMODE_MAILBOX |
Tuple Fields§
§0: c_intImplementations§
Trait Implementations§
Source§impl Clone for SDL_GPUPresentMode
impl Clone for SDL_GPUPresentMode
Source§fn clone(&self) -> SDL_GPUPresentMode
fn clone(&self) -> SDL_GPUPresentMode
Returns a duplicate 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 SDL_GPUPresentMode
Available on crate feature debug-impls only.
impl Debug for SDL_GPUPresentMode
Available on crate feature
debug-impls only.Source§impl Default for SDL_GPUPresentMode
impl Default for SDL_GPUPresentMode
Source§fn default() -> SDL_GPUPresentMode
fn default() -> SDL_GPUPresentMode
Returns the “default value” for a type. Read more
Source§impl From<SDL_GPUPresentMode> for c_int
impl From<SDL_GPUPresentMode> for c_int
Source§fn from(value: SDL_GPUPresentMode) -> Self
fn from(value: SDL_GPUPresentMode) -> Self
Converts to this type from the input type.
Source§impl GroupMetadata for SDL_GPUPresentMode
Available on crate feature metadata only.
impl GroupMetadata for SDL_GPUPresentMode
Available on crate feature
metadata only.Source§const GROUP_METADATA: &'static Group
const GROUP_METADATA: &'static Group
Metadata for this group
Source§impl Hash for SDL_GPUPresentMode
impl Hash for SDL_GPUPresentMode
Source§impl Ord for SDL_GPUPresentMode
impl Ord for SDL_GPUPresentMode
Source§fn cmp(&self, other: &SDL_GPUPresentMode) -> Ordering
fn cmp(&self, other: &SDL_GPUPresentMode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<SDL_GPUPresentMode> for c_int
impl PartialEq<SDL_GPUPresentMode> for c_int
Source§impl PartialEq<i32> for SDL_GPUPresentMode
impl PartialEq<i32> for SDL_GPUPresentMode
Source§impl PartialEq for SDL_GPUPresentMode
impl PartialEq for SDL_GPUPresentMode
Source§impl PartialOrd for SDL_GPUPresentMode
impl PartialOrd for SDL_GPUPresentMode
impl Copy for SDL_GPUPresentMode
impl Eq for SDL_GPUPresentMode
impl StructuralPartialEq for SDL_GPUPresentMode
Auto Trait Implementations§
impl Freeze for SDL_GPUPresentMode
impl RefUnwindSafe for SDL_GPUPresentMode
impl Send for SDL_GPUPresentMode
impl Sync for SDL_GPUPresentMode
impl Unpin for SDL_GPUPresentMode
impl UnwindSafe for SDL_GPUPresentMode
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