diff --git a/input.c b/input.c index 733de26..fa0f4ad 100644 --- a/input.c +++ b/input.c @@ -4,6 +4,7 @@ #include #include +#include "SDL_timer.h" #include "config.h" #include "input.h" #include "render.h" @@ -392,8 +393,12 @@ void handle_sdl_events(config_params_s *conf) { case SDL_WINDOWEVENT: if (event.window.event == SDL_WINDOWEVENT_RESIZED) { - SDL_Log("Resizing window..."); - key = (input_msg_s){special, msg_reset_display}; + static uint32_t ticks_window_resized = 0; + if (SDL_GetTicks() - ticks_window_resized > 500) { + SDL_Log("Resizing window..."); + key = (input_msg_s){special, msg_reset_display}; + ticks_window_resized = SDL_GetTicks(); + } } break; diff --git a/input.h b/input.h index a13a505..f8ad6de 100644 --- a/input.h +++ b/input.h @@ -5,6 +5,7 @@ #define INPUT_H_ #include +#include "config.h" typedef enum input_buttons_t { INPUT_UP, @@ -38,6 +39,6 @@ typedef struct input_msg_s { int initialize_game_controllers(); void close_game_controllers(); -input_msg_s get_input_msg(); +input_msg_s get_input_msg(config_params_s *conf); -#endif \ No newline at end of file +#endif