input: input handling is now only done on ticks and every frames.
authorLukas Krickl <lukas@krickl.dev>
Fri, 6 Mar 2026 08:28:32 +0000 (09:28 +0100)
committerLukas Krickl <lukas@krickl.dev>
Fri, 6 Mar 2026 08:28:32 +0000 (09:28 +0100)
Input polling still happens every frame.

src/i_input.c
src/lrts.c
src/r_render.c
src/t_update.c

index 45cc21b93e23fe789eaf1d308466a5c31fb0bbee..2bc62131af34f60da85c1e102d013bcf3a6db4db 100644 (file)
@@ -23,7 +23,7 @@ void i_input_map_init_default(enum i_input_actions action,
        e->mod_shift = mod_shift;
        e->mod_alt = mod_alt;
        e->mod_ctrl = mod_ctrl;
-               e->mod_super = mod_super;
+       e->mod_super = mod_super;
 }
 
 
@@ -77,7 +77,6 @@ void i_input_poll(void) {
        u32 i;
        struct lrts_config *c = lrts_cfg();
        struct i_input_map_ent *e;
-       p_poll_events();
        i_input_update();
        
        /* 
index 7b742e4d89a2820288702d690d058da4af1e0198..25f205018903197299e2540847d8e8ce8a2539d0 100644 (file)
@@ -107,7 +107,7 @@ int lrts_main(int argc, char **argv) {
        p_render_init_framebuffer();
 
        while (!lrts_cfg()->exit) {
-               i_input_poll();
+               p_poll_events();
                t_sim_update();
                r_render_frame();
        }
index b1542863d37607506d73dfa0051adeb8f41c99ee..fcacfe8ec0d13a5e3f58bb98ccafa2d780fb80c0 100644 (file)
@@ -29,7 +29,7 @@ void r_draw_pixel(struct r_framebuffer *fb, i32 x, i32 y, r_color color) {
 void r_render_debug(void) {
        struct lrts_state *state = lrts_state();
 
-       u_debug_draw_text(0, 0, "FPS: %02d", state->fps); 
+       u_debug_draw_text(0, 0, "FPS: %02d, Tick: %d", state->fps, state->tick_count); 
 }
 
 void r_render_frame(void) {
index 472fa5df11c916943ee61798b1c55fc3e8266490..6bd5f69b7bdd940027b07aec03f4f8fb720218fa 100644 (file)
@@ -33,6 +33,8 @@ void t_sim_update(void) {
 
        t_updates_this_interval++;
        state->tick_count++;
+               
+       i_input_poll();
        
        /* update game simulation */
 }