sdl2: fix initialization services
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 23 Feb 2017 22:26:26 +0000 (17:26 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 27 Feb 2017 19:50:10 +0000 (14:50 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/sdl2/image.nit
lib/sdl2/sdl2_base.nit

index bdceeac..69492e2 100644 (file)
@@ -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; `}
 
index ff98dbb..a72aa80 100644 (file)
@@ -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
        #