SDL_WindowFlags

Struct SDL_WindowFlags 

Source
#[repr(transparent)]
pub struct SDL_WindowFlags(pub Uint64);
Expand description

The flags on a window.

These cover a lot of true/false, or on/off, window state. Some of it is immutable after being set through SDL_CreateWindow(), some of it can be changed on existing windows by the app, and some of it might be altered by the user or system outside of the app’s control.

When creating windows with SDL_WINDOW_RESIZABLE, SDL will constrain resizable windows to the dimensions recommended by the compositor to fit it within the usable desktop space, although some compositors will do this automatically without intervention as well. Use SDL_SetWindowResizable after creation instead if you wish to create a window with a specific size.

§Availability

This datatype is available since SDL 3.2.0.

§See also

§Known values (sdl3-sys)

Associated constantGlobal constantDescription
FULLSCREENSDL_WINDOW_FULLSCREENwindow is in fullscreen mode
OPENGLSDL_WINDOW_OPENGLwindow usable with OpenGL context
OCCLUDEDSDL_WINDOW_OCCLUDEDwindow is occluded
HIDDENSDL_WINDOW_HIDDENwindow is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible
BORDERLESSSDL_WINDOW_BORDERLESSno window decoration
RESIZABLESDL_WINDOW_RESIZABLEwindow can be resized
MINIMIZEDSDL_WINDOW_MINIMIZEDwindow is minimized
MAXIMIZEDSDL_WINDOW_MAXIMIZEDwindow is maximized
MOUSE_GRABBEDSDL_WINDOW_MOUSE_GRABBEDwindow has grabbed mouse input
INPUT_FOCUSSDL_WINDOW_INPUT_FOCUSwindow has input focus
MOUSE_FOCUSSDL_WINDOW_MOUSE_FOCUSwindow has mouse focus
EXTERNALSDL_WINDOW_EXTERNALwindow not created by SDL
MODALSDL_WINDOW_MODALwindow is modal
HIGH_PIXEL_DENSITYSDL_WINDOW_HIGH_PIXEL_DENSITYwindow uses high pixel density back buffer if possible
MOUSE_CAPTURESDL_WINDOW_MOUSE_CAPTUREwindow has mouse captured (unrelated to MOUSE_GRABBED)
MOUSE_RELATIVE_MODESDL_WINDOW_MOUSE_RELATIVE_MODEwindow has relative mode enabled
ALWAYS_ON_TOPSDL_WINDOW_ALWAYS_ON_TOPwindow should always be above others
UTILITYSDL_WINDOW_UTILITYwindow should be treated as a utility window, not showing in the task bar and window list
TOOLTIPSDL_WINDOW_TOOLTIPwindow should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window
POPUP_MENUSDL_WINDOW_POPUP_MENUwindow should be treated as a popup menu, requires a parent window
KEYBOARD_GRABBEDSDL_WINDOW_KEYBOARD_GRABBEDwindow has grabbed keyboard input
FILL_DOCUMENTSDL_WINDOW_FILL_DOCUMENTwindow is in fill-document mode (Emscripten only), since SDL 3.4.0
VULKANSDL_WINDOW_VULKANwindow usable for Vulkan surface
METALSDL_WINDOW_METALwindow usable for Metal view
TRANSPARENTSDL_WINDOW_TRANSPARENTwindow with transparent buffer
NOT_FOCUSABLESDL_WINDOW_NOT_FOCUSABLEwindow should not be focusable

Tuple Fields§

§0: Uint64

Implementations§

Source§

impl SDL_WindowFlags

Source

pub const FULLSCREEN: Self

window is in fullscreen mode

Source

pub const OPENGL: Self

window usable with OpenGL context

Source

pub const OCCLUDED: Self

window is occluded

Source

pub const HIDDEN: Self

window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible

Source

pub const BORDERLESS: Self

no window decoration

Source

pub const RESIZABLE: Self

window can be resized

Source

pub const MINIMIZED: Self

window is minimized

Source

pub const MAXIMIZED: Self

window is maximized

Source

pub const MOUSE_GRABBED: Self

window has grabbed mouse input

Source

pub const INPUT_FOCUS: Self

window has input focus

Source

pub const MOUSE_FOCUS: Self

window has mouse focus

Source

pub const EXTERNAL: Self

window not created by SDL

Source

pub const MODAL: Self

window is modal

Source

pub const HIGH_PIXEL_DENSITY: Self

window uses high pixel density back buffer if possible

Source

pub const MOUSE_CAPTURE: Self

window has mouse captured (unrelated to MOUSE_GRABBED)

Source

pub const MOUSE_RELATIVE_MODE: Self

window has relative mode enabled

Source

pub const ALWAYS_ON_TOP: Self

window should always be above others

Source

pub const UTILITY: Self

window should be treated as a utility window, not showing in the task bar and window list

Source

pub const TOOLTIP: Self

window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window

Source

pub const POPUP_MENU: Self

window should be treated as a popup menu, requires a parent window

Source

pub const KEYBOARD_GRABBED: Self

window has grabbed keyboard input

Source

pub const FILL_DOCUMENT: Self

window is in fill-document mode (Emscripten only), since SDL 3.4.0

Source

pub const VULKAN: Self

window usable for Vulkan surface

Source

pub const METAL: Self

window usable for Metal view

Source

pub const TRANSPARENT: Self

window with transparent buffer

Source

pub const NOT_FOCUSABLE: Self

window should not be focusable

Trait Implementations§

Source§

impl BitAnd for SDL_WindowFlags

Source§

type Output = SDL_WindowFlags

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAndAssign for SDL_WindowFlags

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for SDL_WindowFlags

Source§

type Output = SDL_WindowFlags

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign for SDL_WindowFlags

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for SDL_WindowFlags

Source§

type Output = SDL_WindowFlags

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign for SDL_WindowFlags

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for SDL_WindowFlags

Source§

fn clone(&self) -> SDL_WindowFlags

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SDL_WindowFlags

Available on crate feature debug-impls only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SDL_WindowFlags

Source§

fn default() -> SDL_WindowFlags

Returns the “default value” for a type. Read more
Source§

impl From<SDL_WindowFlags> for Uint64

Source§

fn from(value: SDL_WindowFlags) -> Self

Converts to this type from the input type.
Source§

impl GroupMetadata for SDL_WindowFlags

Available on crate feature metadata only.
Source§

const GROUP_METADATA: &'static Group

Metadata for this group
Source§

impl Hash for SDL_WindowFlags

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Not for SDL_WindowFlags

Source§

type Output = SDL_WindowFlags

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq<SDL_WindowFlags> for Uint64

Source§

fn eq(&self, other: &SDL_WindowFlags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u64> for SDL_WindowFlags

Source§

fn eq(&self, other: &Uint64) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for SDL_WindowFlags

Source§

fn eq(&self, other: &SDL_WindowFlags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SDL_WindowFlags

Source§

impl Eq for SDL_WindowFlags

Source§

impl StructuralPartialEq for SDL_WindowFlags

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.