Struct sdl2::video::WindowBuilder
source · pub struct WindowBuilder { /* private fields */ }
Expand description
The type that allows you to build windows.
Implementations§
source§impl WindowBuilder
impl WindowBuilder
sourcepub fn new(
v: &VideoSubsystem,
title: &str,
width: u32,
height: u32,
) -> WindowBuilder
pub fn new( v: &VideoSubsystem, title: &str, width: u32, height: u32, ) -> WindowBuilder
Initializes a new WindowBuilder
.
sourcepub fn build(&self) -> Result<Window, WindowBuildError>
pub fn build(&self) -> Result<Window, WindowBuildError>
Builds the window.
sourcepub fn window_flags(&self) -> u32
pub fn window_flags(&self) -> u32
Gets the underlying window flags.
sourcepub fn set_window_flags(&mut self, flags: u32) -> &mut WindowBuilder
pub fn set_window_flags(&mut self, flags: u32) -> &mut WindowBuilder
Sets the underlying window flags. This will effectively undo any previous build operations, excluding window size and position.
sourcepub fn position(&mut self, x: i32, y: i32) -> &mut WindowBuilder
pub fn position(&mut self, x: i32, y: i32) -> &mut WindowBuilder
Sets the window position.
sourcepub fn position_centered(&mut self) -> &mut WindowBuilder
pub fn position_centered(&mut self) -> &mut WindowBuilder
Centers the window.
sourcepub fn fullscreen(&mut self) -> &mut WindowBuilder
pub fn fullscreen(&mut self) -> &mut WindowBuilder
Sets the window to fullscreen.
sourcepub fn fullscreen_desktop(&mut self) -> &mut WindowBuilder
pub fn fullscreen_desktop(&mut self) -> &mut WindowBuilder
Sets the window to fullscreen at the current desktop resolution.
sourcepub fn opengl(&mut self) -> &mut WindowBuilder
pub fn opengl(&mut self) -> &mut WindowBuilder
Sets the window to be usable with an OpenGL context
sourcepub fn vulkan(&mut self) -> &mut WindowBuilder
pub fn vulkan(&mut self) -> &mut WindowBuilder
Sets the window to be usable with a Vulkan instance
Hides the window.
sourcepub fn borderless(&mut self) -> &mut WindowBuilder
pub fn borderless(&mut self) -> &mut WindowBuilder
Removes the window decoration.
sourcepub fn resizable(&mut self) -> &mut WindowBuilder
pub fn resizable(&mut self) -> &mut WindowBuilder
Sets the window to be resizable.
sourcepub fn minimized(&mut self) -> &mut WindowBuilder
pub fn minimized(&mut self) -> &mut WindowBuilder
Minimizes the window.
sourcepub fn maximized(&mut self) -> &mut WindowBuilder
pub fn maximized(&mut self) -> &mut WindowBuilder
Maximizes the window.
sourcepub fn input_grabbed(&mut self) -> &mut WindowBuilder
pub fn input_grabbed(&mut self) -> &mut WindowBuilder
Sets the window to have grabbed input focus.
sourcepub fn allow_highdpi(&mut self) -> &mut WindowBuilder
pub fn allow_highdpi(&mut self) -> &mut WindowBuilder
Creates the window in high-DPI mode if supported (>= SDL 2.0.1)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowBuilder
impl RefUnwindSafe for WindowBuilder
impl !Send for WindowBuilder
impl !Sync for WindowBuilder
impl Unpin for WindowBuilder
impl UnwindSafe for WindowBuilder
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