[][src]Function beryllium::init

pub unsafe fn init() -> Result<SDLToken, String>

Initializes SDL2 and gives you a token as proof, or an error message.

Failure

  • You cannot double initialize SDL2, you'll get an error.
  • If SDL2 fails to initialize you'll get an error and it will revert itself to an uninitialized state, perhaps allowing you to try again.

Safety

  • This can only be called from the main thread (because of a macOS limit built into Cocoa).