60 frames per second?

Started by
3 comments, last by rjackets 18 years, 5 months ago
Hi all. I have a (hopefully) quick question: I initially learned the DX API using C#, but then once I had the basics down I switched to C/C++. It was a rather simple switch and, personally, I find I perfer the freedom C/C++ gives me. However, in C# my fps counter gave me very high render rates (around 3000) when there was nothing being drawn. Obviously it went down substantially once I started drawing stuff. Nonetheless, with a simple low-poly scene I was still getting around 700-800fps. Now, however, in C++, I am running at a very consistent 60fps. I thought maybe this might be due to some sort of interaction with the refresh rate of my monitor. However, even when I switch the render call down to a basic loop it still gives the same. It is not linked with the WM_PAINT call or anything either. Thoughts?
Advertisement
Is it a Release or Debug build?
you have v-sync enabled. when you render the scene your app will hang until the monitor is ready to display the next frame. if you change the refresh rate of your monitor to, say, 120hz (assuming it's not an LCD) then you'll get 120FPS. google around or search the site for info on how to disable vsync if you want to.

-me
Check you present parameters for your device.

You probably have something like:

d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;

And You are wanting to have D3DPRESENT_INTERVAL_IMMEDIATE instead.

Not that the way you have it is a bad thing, because the default is updating with your refresh rate and preventing frame tearing.
Visit My Beginner DirectX Tutorials - www.experimentsingameprogramming.com
Ah! Perfect. Thanks for that. Running at a nice 500fps now. I think I will include an option to enable/disable v-sync.

This topic is closed to new replies.

Advertisement