If you wish to use SDL's function-calling timer, you must use the "SDL_INIT_TIMER" flag when initializing SDL:
Then you can call "SDL_SetTimer()" to have a particular function executed after a certain interval of time:SDL_Init(SDL_INIT_TIMER);
Every "interval" milliseconds, callback will be called.Uint32 callback(Uint32 interval) { ... return(interval); } ... SDL_SetTimer(interval, callback);