abstract input into platform layer

This commit is contained in:
2026-03-02 23:01:40 -05:00
parent 8d56ea7217
commit 46f636a9ac
5 changed files with 48 additions and 60 deletions

View File

@@ -33,12 +33,10 @@ struct UI_WidgetState {
// Dropdown
uint32_t open_dropdown_id; // Clay element ID hash of the open dropdown (0 = none)
// Input events for this frame
PlatformInputEvents input;
// Input for this frame
PlatformInput input;
// Click detection
B32 mouse_down;
B32 was_mouse_down;
B32 mouse_clicked; // true on the frame mouse transitions from up->down
};
@@ -47,8 +45,8 @@ extern UI_WidgetState g_wstate;
// Call once at startup
void ui_widgets_init();
// Call each frame before building widgets. Pass in the frame's input events.
void ui_widgets_begin_frame(PlatformInputEvents input, B32 mouse_down, B32 was_mouse_down);
// Call each frame before building widgets. Pass in the frame's input.
void ui_widgets_begin_frame(PlatformInput input);
// Reset per-frame text input display buffer allocator (called by begin_frame, but
// can also be called manually if needed)