Yielding the CPU? |
Mohamed El Dawy
Guest
|
Hi,
I am still quite new to SDL. I noticed many tutorials use this, after flipping the screen while( fps.get_ticks() < 1000 / FRAMES_PER_SECOND ) { //wait } To maintain the correct FPS. This doesn't seem very nice to the CPU, because it will keep CPU utilization to 100% for no reason. I was wondering. Does SDL have a function that will yield the CPU for the rest of this quantum (or for some given time)? If not, what is the name of the function that was used to achieve this in Windows? (Sorry, my memory fails me!) Thank you very much in advance. --------------------------------- Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060123/4ce186d7/attachment.html |
|||||||||||
|
Yielding the CPU? |
Josh Matthews
Guest
|
SDL_Delay(# of clock ticks)
On 1/23/06, Mohamed El Dawy <msdawy at yahoo.com> wrote:
-- Cheers, Josh PGP: http://revvy.box43.net/Josh_Matthews.asc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060123/1d376db9/attachment.htm |
|||||||||||||
|