• Advertisement
Sign in to follow this  

Setting Max FPS

This topic is 2854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ??

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Thank You.

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement