From: Alexis Laferrière Date: Thu, 23 Feb 2017 22:26:26 +0000 (-0500) Subject: sdl2: fix initialization services X-Git-Url: http://nitlanguage.org sdl2: fix initialization services Signed-off-by: Alexis Laferrière --- diff --git a/lib/sdl2/image.nit b/lib/sdl2/image.nit index bdceeac..69492e2 100644 --- a/lib/sdl2/image.nit +++ b/lib/sdl2/image.nit @@ -60,7 +60,7 @@ redef extern class SDLSurface end # Flags from `sys.sdl.img.initialize` -extern class SDLImgInitFlags `{ int `} +extern class SDLImgInitFlags `{ IMG_InitFlags `} # Get the default empty flag set new `{ return 0; `} diff --git a/lib/sdl2/sdl2_base.nit b/lib/sdl2/sdl2_base.nit index ff98dbb..a72aa80 100644 --- a/lib/sdl2/sdl2_base.nit +++ b/lib/sdl2/sdl2_base.nit @@ -36,8 +36,8 @@ class SDL # TODO make this private and only called through `sys.sdl` init internal do end - # Initialize the given SDL `subsystems` - fun initialize(subsystems: SDLInitFlags): Bool `{ return SDL_Init(subsystems); `} + # Initialize the given SDL `subsystems`, returns `false` on error + fun initialize(subsystems: SDLInitFlags): Bool `{ return SDL_Init(subsystems) == 0; `} # Returns the latest SDL error #