summaryrefslogtreecommitdiff
path: root/src/daw.c
diff options
context:
space:
mode:
authoronelin <oscar@nelin.dk>2025-11-28 20:16:32 +0000
committeronelin <oscar@nelin.dk>2025-12-18 21:14:13 +0000
commit7649615f710754582dcd6f9d17be30ad4682ca40 (patch)
tree82c8be00134ae85ab027ec641119a0630024c9a4 /src/daw.c
parent9175e44d16dbda51d26d90fdacea7fc7b0a3c9cc (diff)
Add instance to state init & update
Diffstat (limited to 'src/daw.c')
-rw-r--r--src/daw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/daw.c b/src/daw.c
index 36604b8..284bfc7 100644
--- a/src/daw.c
+++ b/src/daw.c
@@ -175,7 +175,7 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) {
{
u64 state_init_time = get_time();
- State_init(state, mem, state_arg);
+ State_init(state, p->window, mem, state_arg);
if (!w->render_targets) {
// Create only 1 additional framebuffer, in addition to the default
// one. This is used to render a texture that is represented as a quad
@@ -198,7 +198,7 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) {
// Update ticks
u64 ticks = 0;
- StateType (*update_func)(f64, void*) = State_updateFunc(state);
+ StateType (*update_func)(Window *restrict, void*, f64) = State_updateFunc(state);
u64 last_fps_measurement = frame_end;
u64 last_fps_ticks = 0;
@@ -223,7 +223,7 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) {
/* Update */
StateType next_state;
- next_state = update_func(dt, (void*)(mem->data));
+ next_state = update_func(p->window, (void*)(mem->data), dt);
if (next_state != STATE_null) {
if (next_state == STATE_quit) break;
@@ -243,7 +243,7 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) {
update_func = State_updateFunc(state);
{
u64 state_init_time = get_time();
- State_init(state, mem, retval);
+ State_init(state, p->window, mem, retval);
if (!w->render_targets) {
// Create only 1 additional framebuffer, in addition to the default
// one. This is used to render a texture that is represented as a quad