Skip to content

Commit ea7de1d

Browse files
committed
v3: fix review follow-up regressions
1 parent 2abf5fc commit ea7de1d

5 files changed

Lines changed: 439 additions & 68 deletions

File tree

vlib/sokol/sapp/sapp_structs.c.v

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -230,26 +230,20 @@ pub:
230230

231231
pub type Swapchain = C.sapp_swapchain
232232

233-
pub type Event = C.sapp_event
234-
235-
pub type FnEventCb = fn (const_event &Event)
236-
237-
pub type FnEventUserDataCb = fn (const_event &Event, user_data voidptr)
238-
239233
@[typedef]
240234
pub struct C.sapp_desc {
241235
pub mut:
242236
// these are the user-provided callbacks without user data
243-
init_cb fn () = unsafe { nil }
244-
frame_cb fn () = unsafe { nil }
245-
cleanup_cb fn () = unsafe { nil }
246-
event_cb FnEventCb = unsafe { nil } // const sapp_event*
237+
init_cb fn () = unsafe { nil }
238+
frame_cb fn () = unsafe { nil }
239+
cleanup_cb fn () = unsafe { nil }
240+
event_cb fn (&Event) = unsafe { nil } // &sapp_event
247241

248242
user_data voidptr // these are the user-provided callbacks with user data
249-
init_userdata_cb fn (voidptr) = unsafe { nil }
250-
frame_userdata_cb fn (voidptr) = unsafe { nil }
251-
cleanup_userdata_cb fn (voidptr) = unsafe { nil }
252-
event_userdata_cb FnEventUserDataCb = unsafe { nil }
243+
init_userdata_cb fn (voidptr) = unsafe { nil }
244+
frame_userdata_cb fn (voidptr) = unsafe { nil }
245+
cleanup_userdata_cb fn (voidptr) = unsafe { nil }
246+
event_userdata_cb fn (&Event, voidptr) = unsafe { nil }
253247

254248
width int // the preferred width of the window / canvas
255249
height int // the preferred height of the window / canvas
@@ -305,6 +299,8 @@ pub mut:
305299
framebuffer_height int // = window_height * dpi_scale
306300
}
307301

302+
pub type Event = C.sapp_event
303+
308304
pub fn (e &Event) str() string {
309305
return 'evt: frame_count=${e.frame_count}, type=${EventType(e.type)}'
310306
}

0 commit comments

Comments
 (0)