nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/sdl: add access to texture pixels and alpha mask
[nit.git]
/
lib
/
sdl.nit
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
end
import mnit_display
+import c
in "C header" `{
#include <unistd.h>
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
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
end
# A simple rectangle