nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
readme: add information section
[nit.git]
/
lib
/
sdl.nit
diff --git
a/lib/sdl.nit
b/lib/sdl.nit
index
a8fa112
..
debe908
100644
(file)
--- a/
lib/sdl.nit
+++ b/
lib/sdl.nit
@@
-20,7
+20,7
@@
module sdl is
ldflags(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf")
end
ldflags(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf")
end
-import mnit_display
+import mnit::display
import c
in "C header" `{
import c
in "C header" `{
@@
-255,8
+255,8
@@
extern class SDLImage
# Returns a reference to the pixels of the texture
fun pixels: NativeCByteArray `{ return self->pixels; `}
# Returns a reference to the pixels of the texture
fun pixels: NativeCByteArray `{ return self->pixels; `}
- # Does this texture has an alpha mask?
- fun amask: Bool `{ return self->format->Amask; `}
+ # Mask for the alpha value of each pixel
+ fun amask: Int `{ return self->format->Amask; `}
end
# A simple rectangle
end
# A simple rectangle
@@
-293,14
+293,10
@@
class SDLMouseEvent
super PointerEvent
super SDLInputEvent
super PointerEvent
super SDLInputEvent
- redef var x: Float
- redef var y: Float
+ redef var x
+ redef var y
- private init (x, y: Float)
- do
- self.x = x
- self.y = y
- end
+ redef fun is_move do return false
end
# MouseButtonEvent used to get information when a button is pressed/depressed
end
# MouseButtonEvent used to get information when a button is pressed/depressed
@@
-310,7
+306,6
@@
class SDLMouseButtonEvent
var button: Int
redef var pressed
var button: Int
redef var pressed
- redef fun depressed do return not pressed
# Is this event raised by the left button?
fun is_left_button: Bool do return button == 1
# Is this event raised by the left button?
fun is_left_button: Bool do return button == 1
@@
-356,7
+351,8
@@
class SDLMouseMotionEvent
var rel_y: Float
redef var pressed
var rel_y: Float
redef var pressed
- redef fun depressed do return not pressed
+
+ redef fun is_move do return true
init (x, y, rel_x, rel_y: Float, pressed: Bool)
do
init (x, y, rel_x, rel_y: Float, pressed: Bool)
do