From 7649615f710754582dcd6f9d17be30ad4682ca40 Mon Sep 17 00:00:00 2001 From: onelin Date: Fri, 28 Nov 2025 21:16:32 +0100 Subject: Add instance to state init & update --- src/include/daw/state.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/daw/state.h b/src/include/daw/state.h index f98d5ff..72fe2f0 100644 --- a/src/include/daw/state.h +++ b/src/include/daw/state.h @@ -6,6 +6,7 @@ extern "C" { #endif #include +#include typedef enum StateType { STATE_null, @@ -17,11 +18,12 @@ typedef enum StateType { extern const char* StateTypeStr[]; -StateType (*State_updateFunc(StateType type))(f64, void*); +StateType (*State_updateFunc(StateType type))(Window *restrict, void*, f64); -void State_init(StateType type, memory* mem, void* arg); +// "mem" is userdefined memory representing the state of their statemachine +void State_init(StateType type, Window *restrict w, memory* mem, void* arg); void* State_free(StateType type, memory* mem); -StateType State_update(StateType type, f64 dt, memory* mem); +StateType State_update(StateType type, Window *restrict w, memory* mem, f64 dt); /* Reloads shared object file associated with state */ #ifdef DAW_BUILD_HOTRELOAD -- cgit v1.3