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>
Source§impl<'video> HasRawWindowHandle for Window<'video>
impl<'video> HasRawWindowHandle for Window<'video>
Source§fn raw_window_handle(&self) -> RawWindowHandle
fn raw_window_handle(&self) -> RawWindowHandle
Downcasts into a raw window handle.
Auto Trait Implementations§
impl<'video> Freeze for Window<'video>
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