Struct sdl2::Sdl [] [src]

pub struct Sdl { /* fields omitted */ }

The SDL context type. Initialize with sdl2::init().

From a thread-safety perspective, Sdl represents the main thread. As such, Sdl is a useful type for ensuring that SDL types that can only be used on the main thread are initialized that way.

For instance, SDL_PumpEvents() is not thread safe, and may only be called on the main thread. All functionality that calls SDL_PumpEvents() is thus put into an EventPump type, which can only be obtained through Sdl. This guarantees that the only way to call event-pumping functions is on the main thread.

Methods

impl Sdl
[src]

impl Sdl
[src]

impl Sdl
[src]

Initializes the audio subsystem.

Initializes the event subsystem.

Initializes the joystick subsystem.

Initializes the haptic subsystem.

Initializes the game controller subsystem.

Initializes the timer subsystem.

Initializes the video subsystem.

Obtains the SDL event pump.

At most one EventPump is allowed to be alive during the program's execution. If this function is called while an EventPump instance is alive, the function will return an error.

Trait Implementations

impl Clone for Sdl
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more