[SDL] Capping the framerate? (not noob)

L-28C kixdemp at gmail.com
Fri Aug 31 21:09:44 PDT 2007


Hello, ladies and gentlemen of the SDL list!

Okay. You all know what Lua is, right? If not, ignore this thread.

Here's my question. I've got a Lua script that will call SDL functions. 
Well, I _need_ to cap the framerate to 60FPS without the user having to 
do anything to the script.

I thought of making the user have a 'main loop' function in Lua that 
will execute in my program's main loop, which will do the capping. But I 
can't do that. Don't ask why, I've got my reasons.

So, anything like...

SDL_CapFramerate(60);

... that I can put in main() and will affect the whole program?

Yes? No? Didn't think so. So what's the closest approach?

Thanks in advance for any help provided!

(P.S., I know Allegro can do this, but it doesn't support alpha 
transparency which also is an underlined need.)



More information about the SDL mailing list