View Full Version : DirectX Window FPS
mmakrzem
11-10-2005, 04:14 AM
I found some code that allows me to create a DirectX9c (oct 2005 release) window and in the title bar I display the frames per second that I am render at.
I notice that the rate caps at around 70FPS. HOWEVER when I make my window out of focus by selecting another window then my rate jumps up to past 200 FPS.
why is that? Is there a way that I can allow my game to run at a higher rate while it is in focus?
digriz
11-10-2005, 04:50 AM
It's locking the the framerate to the monitor refresh. You can bypass this.
Look up D3DPRESENT_DONOTWAIT in the documentation. I think's what you need.
PeterM
11-10-2005, 12:01 PM
To disable vsync, I think it's actually the PresentationInterval member of the D3DPRESENT_PARAMETERS structure that you want to set to D3DPRESENT_INTERVAL_IMMEDIATE when you create your device.
Also remember that this can often be overridden by you, or the user, in the Display control panel.
Ska Software
11-10-2005, 03:40 PM
I'd still cap it at 60 fps (I know, no one asked me) for consistency's sake. It seems to me that if you're getting 400 fps there may be a little bit of a resolution skew.
gosub
11-10-2005, 11:12 PM
It's completely dependant on the way it was written. I've noticed that the DirectX SDK has some buggy examples, so that might be it. If you want to see a C# example, try this:
http://gosub.com/OpenSource/DirectXControl/DirectXControl.htm
100 FPS in windowed mode, and 60FPS (or whatever the monitor refresh rate is on your system) in full screen mode.
-Jeremy
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.