module Sdlmouse:Mouse event handling and cursorssig
..end
type
button =
| |
BUTTON_LEFT |
| |
BUTTON_MIDDLE |
| |
BUTTON_RIGHT |
| |
BUTTON_WHEELUP |
| |
BUTTON_WHEELDOWN |
val get_state : ?relative:bool -> unit -> int * int * button list
relative
: if true returns mouse delta instead of positionval warp : int -> int -> unit
type
cursor
type
cursor_data = {
|
data : |
(* | B/W cursor data | *) |
|
mask : |
(* | B/W cursor mask | *) |
|
w : |
(* | width in pixels | *) |
|
h : |
(* | height in pixels | *) |
|
hot_x : |
(* | the "tip" of the cursor | *) |
|
hot_y : |
(* | the "tip" of the cursor | *) |
val make_cursor : data:(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array2.t ->
mask:(int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array2.t ->
hot_x:int -> hot_y:int -> cursor
The cursor is created in black and white according to the following:
data mask resulting pixel on screen 0 1 White 1 1 Black 0 0 Transparent 1 0 Inverted color if possible, black if not.
Cursors created with this function must be freed
with Sdlmouse.free_cursor
.
val free_cursor : cursor -> unit
val set_cursor : cursor -> unit
val get_cursor : unit -> cursor
val cursor_visible : unit -> bool
val show_cursor : bool -> unit
val cursor_data : cursor -> cursor_data
val pprint_cursor : cursor -> unit
val convert_to_cursor : data:int array ->
mask:int array -> w:int -> h:int -> hot_x:int -> hot_y:int -> cursor