[SDL] Re: Fixed FPS ratio... AND OTHERS!!!
pp at ludusdesign.com
Thu Jun 15 12:51:05 PDT 2000
Santiago Romero wrote:
> > This is normally a cardinal sin under Unix but if you know what you are
> > doing, are alone on your machine and use it for short periods,
> > it can be excused. But don't do it if SDL_Delay works for you.
> exactly... and thinking that I only code for Linux, I think I can use
> SDL_Delay() for all purposes, rigth? (because it uses gettimeofday()).
What you can do is SDL_Delay() for just a little less than what you want
to wait for (say, 10 ms less), then busy wait the rest. If you want to
be really nifty, you could dynamically adjust the amount of time you
substract from the SDL_Delay() according to how much time is remaining
on average before going into the busy wait... :-)
More information about the SDL