# SDL display support (used in Linux for windows and inputes only)
module sdl is
- c_compiler_option(exec("sdl-config", "--cflags"))
- c_linker_option(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf")
+ cflags exec("sdl-config", "--cflags")
+ ldflags(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf")
end
import mnit_display
+import c
in "C header" `{
#include <unistd.h>
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
fun is_left_button: Bool do return button == 1
# Is this event raised by the right button?
- fun is_right_button: Bool do return button == 2
+ fun is_right_button: Bool do return button == 3
# Is this event raised by the middle button?
- fun is_middle_button: Bool do return button == 3
+ fun is_middle_button: Bool do return button == 2
# Is this event raised by the wheel going down?
fun is_down_wheel: Bool do return button == 4