add callbacks for mouse movement and mouse clicking
This commit is contained in:
24
ffi/glfw-input.sml
Normal file
24
ffi/glfw-input.sml
Normal file
@@ -0,0 +1,24 @@
|
||||
structure Input =
|
||||
struct
|
||||
type window = MLton.Pointer.t
|
||||
|
||||
(* Export function to C. *)
|
||||
val exportMouseMoveCallback =
|
||||
_export "mltonMouseMoveCallback" public : (int * int -> unit) -> unit;
|
||||
|
||||
(* Import function to set callback for GLFW. *)
|
||||
val setMouseMoveCallback = _import "setMouseMoveCallback" public reentrant : window -> unit;
|
||||
|
||||
val exportMouseClickCallback =
|
||||
_export "mltonMouseClickCallback" public : (int * int -> unit) -> unit;
|
||||
|
||||
val setMouseClickCallback = _import "setMouseClickCallback" public reentrant : window -> unit;
|
||||
|
||||
(* Constants for mouse input. *)
|
||||
val (MOUSE_PRESSED, _) =
|
||||
_symbol "MOUSE_PRESSED" public : ( unit -> int ) * ( int -> unit );
|
||||
val (MOUSE_RELEASED, _) =
|
||||
_symbol "MOUSE_RELEASED" public : ( unit -> int ) * ( int -> unit );
|
||||
val (LEFT_MOUSE_BUTTON, _) =
|
||||
_symbol "LEFT_MOUSE_BUTTON" public : ( unit -> int ) * ( int -> unit );
|
||||
end
|
||||
Reference in New Issue
Block a user