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 listrelative : if true returns mouse delta instead of positionval warp : int -> int -> unittype 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 -> cursorThe 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 -> unitval set_cursor : cursor -> unitval get_cursor : unit -> cursorval cursor_visible : unit -> boolval show_cursor : bool -> unitval cursor_data : cursor -> cursor_dataval pprint_cursor : cursor -> unitval convert_to_cursor : data:int array ->
mask:int array -> w:int -> h:int -> hot_x:int -> hot_y:int -> cursor