[go: up one dir, main page]

Function sdl2::init [] [src]

pub fn init() -> InitBuilder

Initializes the SDL library. This must be called before using any other SDL function.

Example

let sdl_context = sdl2::init().everything().unwrap();

let mut event_pump = sdl_context.event_pump();
for event in event_pump.poll_iter() {
    // ...
}

// SDL_Quit() is called here as `sdl_context` is dropped.