[SDL] Constant framerate code?
Jonathan Greig
redteam316 at gmail.com
Thu Apr 26 21:05:17 PDT 2007
LazyFoo and Sol's tutorials on the SDL site helped me out alot but for most
of my progs I adapted my own code for it.
Essentially, I just have a text file with the number of FPS (physical
iteration per second) in my main code. Use the SDL_ticks function in an
equation to determine how many frames have passed. Then, the user can config
it manually, or add something into your program at startup that if the
physical FPS hasn't been set, to pop up a config dialog that configures it
automatically through a series of loops.
I've had this problem getting a program to work on one OS or another but the
actual speed(CPU/RAM) has really been negligent in the equation considering
the faster the computer runs, the longer it's going to stall to run the next
iteration/loop. My actual framerate code was adapted from the Open Zelda
timedelta() function. Hope this helps some.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070426/fee495c8/attachment.htm
More information about the SDL
mailing list