pub struct Sdl2Window {
    pub window: Window,
    pub context: GLContext,
    pub sdl_context: Sdl,
    pub video_subsystem: VideoSubsystem,
    /* private fields */
}
Expand description

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

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.

Creates a window with the supplied SDL Video subsystem.

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

Trait Implementations

Gets a copy of the title of the window.

Sets the title of the window.

Gets whether the window will automatically close when attempting to close it. Read more

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window. Read more

Gets whether to exit when pressing esc. Read more

Sets whether to exit when pressing esc. Read more

Sets whether to capture/grab the cursor. Read more

Shows the window. Read more

Hides the window. Read more

Gets the position of window.

Sets the position of window. Read more

Sets the window size. Read more

Sets title on window. Read more

Sets whether to exit when pressing the Esc button. Read more

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window. Read more

Sets whether to capture/grab the cursor. Read more

Sets the position of window. Read more

Builds the window from a WindowSettings object. Read more

Executes the destructor for this type. Read more

Returns the address of the specified OpenGL function if it exists. Read more

Returns true if this window’s gl context is the current gl context.

Make the window’s gl context the current gl context.

Returns true if the window should close.

Tells the window to close or stay open.

Swaps render buffers. Read more

Gets the size of the window.

Wait indefinitely for an input event to be available from the window.

Wait for an input event to be available from the window or for the specified timeout to be reached. Read more

Polls an input event from the window. Read more

Gets the draw size of the window. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.