1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

sokol: add mouse locking (#10684)

This commit is contained in:
crthpl 2021-07-06 10:43:41 -07:00 committed by GitHub
parent 55eeb701a9
commit 9eee6631cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -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 {

View File

@ -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