nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
125da5c
)
lib/sdl: add access to texture pixels and alpha mask
author
Alexis Laferrière
<alexis.laf@xymus.net>
Wed, 17 Dec 2014 15:48:00 +0000
(10:48 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Wed, 14 Jan 2015 13:47:15 +0000
(08:47 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/sdl.nit
patch
|
blob
|
history
diff --git
a/lib/sdl.nit
b/lib/sdl.nit
index
26ae459
..
168f123
100644
(file)
--- 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 <unistd.h>
@@
-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