From 6bbe7d88b8fd93f6c07b7d1ece14af00353526eb Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Thu, 30 May 2024 16:19:33 +0200 Subject: microui: make clipboard optional during init Clipboard is an optional addition to the microui functionality, but the init function makes it look like it is required. Additionally, a bunch of the examples both on the Odin-Lang/examples repo and others are now "broken". --- vendor/microui/microui.odin | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vendor/microui/microui.odin b/vendor/microui/microui.odin index cf39e2f55..e545b742b 100644 --- a/vendor/microui/microui.odin +++ b/vendor/microui/microui.odin @@ -319,7 +319,12 @@ default_draw_frame :: proc(ctx: ^Context, rect: Rect, colorid: Color_Type) { } } -init :: proc(ctx: ^Context, set_clipboard: proc(user_data: rawptr, text: string) -> (ok: bool), get_clipboard: proc(user_data: rawptr) -> (text: string, ok: bool), clipboard_user_data: rawptr) { +init :: proc( + ctx: ^Context, + set_clipboard: proc(user_data: rawptr, text: string) -> (ok: bool) = nil, + get_clipboard: proc(user_data: rawptr) -> (text: string, ok: bool) = nil, + clipboard_user_data: rawptr = nil, +) { ctx^ = {} // zero memory ctx.draw_frame = default_draw_frame ctx._style = default_style -- cgit v1.2.3