Struct sdl2::video::WindowBuilder

source ·
pub struct WindowBuilder { /* private fields */ }
Expand description

The type that allows you to build windows.

Implementations§

source§

impl WindowBuilder

source

pub fn new( v: &VideoSubsystem, title: &str, width: u32, height: u32, ) -> WindowBuilder

Initializes a new WindowBuilder.

source

pub fn build(&self) -> Result<Window, WindowBuildError>

Builds the window.

source

pub fn window_flags(&self) -> u32

Gets the underlying window flags.

source

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.

source

pub fn position(&mut self, x: i32, y: i32) -> &mut WindowBuilder

Sets the window position.

source

pub fn position_centered(&mut self) -> &mut WindowBuilder

Centers the window.

source

pub fn fullscreen(&mut self) -> &mut WindowBuilder

Sets the window to fullscreen.

source

pub fn fullscreen_desktop(&mut self) -> &mut WindowBuilder

Sets the window to fullscreen at the current desktop resolution.

source

pub fn opengl(&mut self) -> &mut WindowBuilder

Sets the window to be usable with an OpenGL context

source

pub fn vulkan(&mut self) -> &mut WindowBuilder

Sets the window to be usable with a Vulkan instance

source

pub fn hidden(&mut self) -> &mut WindowBuilder

Hides the window.

source

pub fn borderless(&mut self) -> &mut WindowBuilder

Removes the window decoration.

source

pub fn resizable(&mut self) -> &mut WindowBuilder

Sets the window to be resizable.

source

pub fn minimized(&mut self) -> &mut WindowBuilder

Minimizes the window.

source

pub fn maximized(&mut self) -> &mut WindowBuilder

Maximizes the window.

source

pub fn input_grabbed(&mut self) -> &mut WindowBuilder

Sets the window to have grabbed input focus.

source

pub fn allow_highdpi(&mut self) -> &mut WindowBuilder

Creates the window in high-DPI mode if supported (>= SDL 2.0.1)

source

pub fn always_on_top(&mut self) -> &mut WindowBuilder

Window should always above others (>= SDL 2.0.5)

source

pub fn metal_view(&mut self) -> &mut WindowBuilder

Create a SDL_MetalView when constructing the window. This is required when using the raw_window_handle feature on MacOS. Has no effect no other platforms.

source

pub fn set_shaped(&mut self) -> &mut WindowBuilder

Sets shaped state, to create via SDL_CreateShapedWindow instead of SDL_CreateWindow

Trait Implementations§

source§

impl Debug for WindowBuilder

source§

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

Formats the value using the given formatter. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.