Skip to main content
GameDev.net gamedev.net
🔒 Locked

Frame rate cap

Started by marshdabeachy Feb 14, 2007 at 1:20 PM 0 replies 550+ views
Original Post
marshdabeachy
marshdabeachy
I've got a problem with my game only rendering at a maximum of 30 FPS. I know this is related to the vsync, and the game being unable to hit 60 FPS, so it gets halved, and I've also read that creating a triple buffer is supposed to fix this. I've set the number of backbuffers in the D3DPRESENT_PARAMETERS to 2, but it has absolute no impact on the framerate. I've also tried switching the presentation rate to immediate, which ups the framerate counter, but the game is still visibly hitchy, like it's still being updated at 30 FPS. How would I go about resolving this issue?
sirob
sirob
This could be one of many issue.

First off, setting the PresentationInterval to Immediate is correct if you want to see your application's real FPS. This will let it run as fast as it can.

Second, you might be doing something inefficient to prevent your application from getting over 30 FPS with VSync on (I'm assuming your monitor's refresh rate is higher than 30hz). To check this, try removing parts of your program by commenting them out, and see how the FPS changes. If, when running an empty loop that just clears the frame buffer, you still get a low FPS (under 100), something else might be going wrong.

If your empty loop runs quickly but full app does not, start adding back the sections you commented out and see where it takes the drop. It could be as simple as accidentally reloading the mesh every frame, or something like that.

In regards to general jumpyness in your app, make sure you're using Time-Based-Motion, and also that the timing method you use is suitably accurate. If you still have issues, even with high (but not ultra-high) FPS values, there might be some other error in the motion code somewhere.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.