From: Alexis Laferrière Date: Wed, 17 Dec 2014 15:48:00 +0000 (-0500) Subject: lib/sdl: add access to texture pixels and alpha mask X-Git-Tag: v0.7.1~20^2~2 X-Git-Url: http://nitlanguage.org lib/sdl: add access to texture pixels and alpha mask Signed-off-by: Alexis Laferrière --- diff --git a/lib/sdl.nit b/lib/sdl.nit index 26ae459..168f123 100644 --- a/lib/sdl.nit +++ b/lib/sdl.nit @@ -21,6 +21,7 @@ module sdl is end import mnit_display +import c in "C header" `{ #include @@ -244,6 +245,12 @@ extern class SDLImage redef fun height: Int `{ return recv->h; `} fun is_ok: Bool do return not address_is_null + + # Returns a reference to the pixels of the texture + fun pixels: NativeCByteArray `{ return recv->pixels; `} + + # Does this texture has an alpha mask? + fun amask: Bool `{ return recv->format->Amask; `} end # A simple rectangle