Function init
pub fn init() -> Result<Sdl, Error> ⓘ
Available on crate feature
dep_sdl3
only.Expand description
Initializes the SDL library. This must be called before using any other SDL function.
§Example
let sdl_context = sdl3::init().unwrap();
let mut event_pump = sdl_context.event_pump().unwrap();
for event in event_pump.poll_iter() {
// ...
}
// SDL_Quit() is called here as `sdl_context` is dropped.