diff --git a/vlib/sokol/sapp/sapp.v b/vlib/sokol/sapp/sapp.v index a5264a2688..f963277acf 100644 --- a/vlib/sokol/sapp/sapp.v +++ b/vlib/sokol/sapp/sapp.v @@ -86,6 +86,16 @@ pub fn mouse_shown() bool { return C.sapp_mouse_shown() } +[inline] +pub fn lock_mouse(locked bool) { + C.sapp_lock_mouse(locked) +} + +[inline] +pub fn mouse_locked() bool { + return C.sapp_mouse_locked() +} + // return the userdata pointer optionally provided in sapp_desc [inline] pub fn userdata() voidptr { diff --git a/vlib/sokol/sapp/sapp_funcs.v b/vlib/sokol/sapp/sapp_funcs.v index f05c06564b..aae95c8e1e 100644 --- a/vlib/sokol/sapp/sapp_funcs.v +++ b/vlib/sokol/sapp/sapp_funcs.v @@ -26,9 +26,15 @@ fn C.sapp_keyboard_shown() bool // show or hide the mouse cursor fn C.sapp_show_mouse(visible bool) -// show or hide the mouse cursor +// return true if the mouse cursor is shown fn C.sapp_mouse_shown() bool +// lock or unlock the mouse cursor +fn C.sapp_lock_mouse(locked bool) + +// return true if the mouse cursor is locked +fn C.sapp_mouse_locked() bool + // return the userdata pointer optionally provided in sapp_desc fn C.sapp_userdata() voidptr