Timers

If you wish to use SDL's function-calling timer, you must use the "SDL_INIT_TIMER" flag when initializing SDL:

SDL_Init(SDL_INIT_TIMER);
Then you can call "SDL_SetTimer()" to have a particular function executed after a certain interval of time:

Uint32 callback(Uint32 interval)
{
  ...
  return(interval);
}

...

SDL_SetTimer(interval, callback);
Every "interval" milliseconds, callback will be called.