Sign in to follow this  
DEALOS

Setting Max FPS

Recommended Posts

DEALOS    100
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
Kronojuice    100
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
DEALOS    100
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
Hodgman    51336
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this