[][src]Struct sdl2_window::Sdl2Window

pub struct Sdl2Window {
    pub window: Window,
    pub context: GLContext,
    pub sdl_context: Sdl,
    pub video_subsystem: VideoSubsystem,
    // some fields omitted
}

A window implemented by SDL2 back-end.

Fields

window: Window

SDL window handle.

context: GLContext

Allow dead code because this keeps track of the OpenGL context. Will be released on drop.

sdl_context: Sdl

SDL context.

video_subsystem: VideoSubsystem

Video subsystem.

Implementations

impl Sdl2Window[src]

pub fn new(settings: &WindowSettings) -> Result<Self, Box<dyn Error>>[src]

Creates a new game window for SDL2. This will initialize SDL and the video subsystem. You can retrieve both via the public fields on the Sdl2Window struct.

pub fn with_subsystem(
    video_subsystem: VideoSubsystem,
    settings: &WindowSettings
) -> Result<Self, Box<dyn Error>>
[src]

Creates a window with the supplied SDL Video subsystem.

pub fn init_joysticks(&mut self) -> Result<u32, String>[src]

Initialize the joystick subsystem. Required before joystick input events will be returned. Returns the number available or error.

Trait Implementations

impl AdvancedWindow for Sdl2Window[src]

impl BuildFromWindowSettings for Sdl2Window[src]

impl Drop for Sdl2Window[src]

impl OpenGLWindow for Sdl2Window[src]

impl Window for Sdl2Window[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.