[SDL] animations etc

Francesco Orsenigo xarvh at lombardiacom.it
Tue Sep 17 00:51:02 PDT 2002


Alan Wolfe:
> Do you just use a timer and update things to make them
> animate when the timer is called or what?

Do not use the timer callback to animate the whole thing.
Just insert in your main loop:

if(actual_time() - last_frame_update_time >= X seconds)
  {
         last frame update = actual_time();
         update_all_frames();
  }

This is just pseudo code, but should give you an idea.

See ya,
Francesco Orsenigo, Xarvh Project
http://freeweb.lombardiacom.it/xarvh/




More information about the SDL mailing list