Archived

This topic is now archived and is closed to further replies.

hotdot

SDL Timer optimisation help

Recommended Posts

Ok here is my problem, wich is not quite a big one and can be solved in a snap but it needs to be asked about. Heres the debate: I am using SDL (wich is totaly cool btw) and i am stepping into the timing mechanism of my rendering. Since i would tend to think toward portability, i cannot use super-high-res-Windows-timers, surely because its platform dependant. So has anybody a clue on how i should Time this up with the SDL timer since it can only call a "callback" function. (or at least its what i read). Any design help would be appreciated. May the code be with us !

Share this post


Link to post
Share on other sites
Call SDL_GetTicks() to get the number of milliseconds since you initialized the SDL library. IIRC it uses the QueryPerformanceCounter/QueryPerformanceFrequency combination under windows if it''s available (and if I''m wrong, you can very easily change SDL to do so).

Share this post


Link to post
Share on other sites