sokol: fixes

This commit is contained in:
lydiandy 2020-02-25 01:02:22 +08:00 committed by GitHub
parent 96da5b33c0
commit 3c0b73c2d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 114 additions and 48 deletions

View file

@ -33,6 +33,13 @@ pub enum MouseButton {
middle = 2
}
pub enum Modifier {
shift = 1 //(1<<0)
ctrl = 2 //(1<<1)
alt = 4 //(1<<2)
super = 8 //(1<<3)
}
pub enum KeyCode {
invalid = 0
space = 32

View file

@ -186,3 +186,8 @@ pub fn win32_get_hwnd() voidptr {
return C.sapp_win32_get_hwnd()
}
/* Android: get native activity handle */
[inline]
pub fn android_get_native_activity() voidptr {
return C.sapp_android_get_native_activity()
}

View file

@ -67,3 +67,5 @@ fn C.sapp_d3d11_get_render_target_view() voidptr
fn C.sapp_d3d11_get_depth_stencil_view() voidptr
/* Win32: get the HWND window handle */
fn C.sapp_win32_get_hwnd() voidptr
/* Android: get native activity handle */
fn C.sapp_android_get_native_activity() voidptr

View file

@ -5,7 +5,7 @@ pub:
init_cb fn() /* these are the user-provided callbacks without user data */
frame_cb fn()
cleanup_cb fn()
event_cb fn( voidptr) //&sapp_event)
event_cb fn(&C.sapp_event) //&sapp_event)
fail_cb fn(byteptr)
user_data voidptr /* these are the user-provided callbacks with user data */
@ -13,7 +13,7 @@ pub:
frame_userdata_cb fn(voidptr)
cleanup_userdata_cb fn(voidptr)
event_userdata_cb fn(&C.sapp_event, voidptr)
fail_userdata_cb fn(voidptr)
fail_userdata_cb fn(byteptr,voidptr)
width int /* the preferred width of the window / canvas */
height int /* the preferred height of the window / canvas */