Remove a timer created with SDL_AddTimer().
Defined in <SDL3/SDL_timer.h>
int SDL_RemoveTimer(SDL_TimerID id);
SDL_TimerID | id | the ID of the timer to remove. |
(int) Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
This function is available since SDL 3.0.0.
extern void *my_callback_param;
extern Uint32 SDLCALL my_callbackfunc(Uint32 interval, void *param);
33 / 10) * 10; /* To round it down to the nearest 10 ms */
Uint32 delay = (
/* ... */
SDL_TimerID my_timer_id = SDL_AddTimer(delay, my_callbackfunc, my_callback_param);
/* ... */
SDL_RemoveTimer(my_timer_id);