Need help with timers - preferably SDL

Started by
9 comments, last by liquidAir 21 years, 4 months ago
quote:Original post by liquidAir
Yeah, SDL_Delay freezes the whole application which diables input!!! Hapy now!?

Yes, perfectly Hapy. Did your original question say Anything about input? At all? Nope.

Pseudocode:

Do something.
Get the time and store it in a variable; SDL_GetTicks() will do nicely.
Add on the delay you want to that variable.
Each time through your loop, compare the current time to that variable.
If the current time is equal to or more than it, it''s time to do whatever you''re waiting for.



[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

This topic is closed to new replies.

Advertisement