Struct rich_sdl2_rust::window::Window
source · pub struct Window<'video> { /* private fields */ }
Expand description
A window made by SDL2.
Implementations§
source§impl<'video> Window<'video>
impl<'video> Window<'video>
sourcepub fn from_id(id: u32, video: &'video Video<'_>) -> Option<Self>
pub fn from_id(id: u32, video: &'video Video<'_>) -> Option<Self>
Gets a window from the window id, or None
if does not exist.
sourcepub fn grabbed(video: &'video Video<'_>) -> Option<Self>
pub fn grabbed(video: &'video Video<'_>) -> Option<Self>
Gets a grabbed window, or None
if does not exist.
sourcepub fn mouse_focused(video: &'video Video<'_>) -> Option<Self>
pub fn mouse_focused(video: &'video Video<'_>) -> Option<Self>
Gets a focused window, or None
if does not exist.
sourcepub fn state(&self) -> WindowState
pub fn state(&self) -> WindowState
Returns the state of the window.
sourcepub fn display(&self) -> Option<Display<'_>>
pub fn display(&self) -> Option<Display<'_>>
Returns the display at the window, or None
if unavailable.
sourcepub fn pixel_format(&self) -> PixelFormatKind
pub fn pixel_format(&self) -> PixelFormatKind
Returns the pixel format of the window context.
sourcepub fn set_input_focus(&self) -> Result<()>
pub fn set_input_focus(&self) -> Result<()>
Explicitly sets the input focus to the window.
You almost want to use Window::raise
instead of this. This might give focus to a window that is completely obscured by other windows.
sourcepub fn full_screen(&self) -> Result<()>
pub fn full_screen(&self) -> Result<()>
sourcepub fn is_screen_keyboard_shown(&self) -> bool
pub fn is_screen_keyboard_shown(&self) -> bool
Returns whether the window is showing the screen keyboard.
sourcepub fn surface(&self) -> WindowSurface<'_>
pub fn surface(&self) -> WindowSurface<'_>
Makes the window surface.
sourcepub fn subsystem_kind(&self) -> SubsystemKind
pub fn subsystem_kind(&self) -> SubsystemKind
Gets a kind of the underlying subsystem.
Trait Implementations§
source§impl BorderExt for Window<'_>
impl BorderExt for Window<'_>
source§fn border_widths(&self) -> Result<BorderWidths>
fn border_widths(&self) -> Result<BorderWidths>
Returns the border widths of the window. Read more
source§impl BrightnessExt for Window<'_>
impl BrightnessExt for Window<'_>
source§fn brightness(&self) -> Brightness
fn brightness(&self) -> Brightness
Returns the brightness of the window.
source§fn set_brightness(&self, brightness: Brightness) -> Result<()>
fn set_brightness(&self, brightness: Brightness) -> Result<()>
Sets the brightness of the Window. Read more
source§impl ConfigExt for Window<'_>
impl ConfigExt for Window<'_>
source§fn set_max_size(&self, _: Size)
fn set_max_size(&self, _: Size)
Sets the maximum size of the window.
source§fn set_min_size(&self, _: Size)
fn set_min_size(&self, _: Size)
Sets the minimum size of the window.
source§fn set_opacity(&self, opacity: Opacity) -> Result<()>
fn set_opacity(&self, opacity: Opacity) -> Result<()>
Sets the opacity of the window. Read more
source§fn set_resizable(&self, resizable: bool)
fn set_resizable(&self, resizable: bool)
Sets whether the window is resizable.
source§fn remove_frame(&self)
fn remove_frame(&self)
Removes a frame from the window.
source§impl<'window> ContextSwitchExt<'window> for Window<'window>
impl<'window> ContextSwitchExt<'window> for Window<'window>
Auto Trait Implementations§
impl<'video> !RefUnwindSafe for Window<'video>
impl<'video> !Send for Window<'video>
impl<'video> !Sync for Window<'video>
impl<'video> Unpin for Window<'video>
impl<'video> !UnwindSafe for Window<'video>
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