Setting Max FPS

Started by
3 comments, last by DEALOS 13 years, 11 months ago
I have been searching around for days and could not find something, so I am asking here. How do I set the max fps in DirectX 9 ?? What about Win32 ??
Advertisement
You have to control the FPS yourself. If you want a maximum FPS of 100, for example, just make sure you don't render a new frame unless 10ms have passed.
How can I achive that?

EDIT:
I mean that although my program is not complicated and "heavy", it loops so many times a second that it uses all the available CPU making the system run slower.
Implement a timer. Under win32, the basic time function is timeGetTime, but it's not very accurate so there's also QueryPerformanceCounter+QueryPerformanceFrequency for high-quality timing.

You'd use these in your main loop to measure how long it's been since the loop last ran. If it's too soon, do something else, like calling Sleep.
Thank You.

Even sleep alone is enough to achive my goal...

This topic is closed to new replies.

Advertisement