Jump to content
  • Advertisement
Sign in to follow this  
MrD 588

30FPS on FRAPS

This topic is 3908 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 recently just created a Window and set it up to use D3D similar to the tutorial here, but when I use FRAPS to see what the FPS of the program is, it comes back between 30 - 37FPS. This stays the same in Debug and Release mode and is also the same on my main computer (Core2Duo 2.4GHz, GeForce 8800GTS 640MB) and my laptop (Centrino 1.7GHz, Intel Integrated) which seems strange to me. So, I went and checked out some other tutorial programs from here, just in case it was something specific to that tutorial, but these bore the same results. I'm just wondering if that's normal behaviour for DirectX or whether something is wrong, or whether FRAPS just won't calculate the FPS correctly for some reason. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Its been a while since I last used FRAPS, but I was pretty sure it forced a 30hz limit so that it could do correct video encoding.

Maybe if you disable any video streaming/recording it'll increase in speed.

Also, remember that the D3DPRESENTPARAMETERS9 tend to be taken as hints by the driver and FRAPS could somehow be overriding it to force a different presentation interval...

hth
Jack

Share this post


Link to post
Share on other sites
Well FRAPS only limits FPS down to 30 when actually recording, since I'm not doing that, it should run at maximum. In fact, if I do record, it locks it down to a solid 30FPS instead of one which fluctuates between 30 - 37FPS.

When playing games FRAPS normally works fine and the framerates are in the hundreds (unless I have VSync on) but on all the tutorials from those two sites, the max FPS I have seen is 40.

Share this post


Link to post
Share on other sites
    while(TRUE)
{
DWORD starting_point = GetTickCount();
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
break;

TranslateMessage(&msg);
DispatchMessage(&msg);
}
render_frame();
while ((GetTickCount() - starting_point) < 25);
}

Look at the first and last lines of the loop from the above code. The function render_frame won't be called faster than every 25 ms and 1/25ms = 40 fps. The highest fps you will get is 40 fps.

Share this post


Link to post
Share on other sites
Right, one set of code I was using didn't have that, and when I compiled it with a full rebuild its framerate went up to 60FPS so it looks that for that one, it was a case of Visual Studio being weird.

In the case of that tutorial code, I removed the limit and the FPS on that went up to 60FPS as well. 60Hz is the refresh rate of my monitor, but I wasn't aware I had VSync on...

[Edited by - MrDoom on January 12, 2008 10:49:18 AM]

Share this post


Link to post
Share on other sites
You asked for vsync, even if your weren't aware of it. The tutorial zeros out the present params, and only fills in a few items. A 0 present interval means D3DPRESENT_INTERVAL_DEFAULT.

According to the docs, "Windowed mode supports D3DPRESENT_INTERVAL_DEFAULT, D3DPRESENT_INTERVAL_IMMEDIATE, and D3DPRESENT_INTERVAL_ONE. D3DPRESENT_INTERVAL_DEFAULT and the D3DPRESENT_INTERVAL_ONE are nearly equivalent".

Share this post


Link to post
Share on other sites
490FPS, that's better!

I was flicking through the Preset Params options in Visual Studio and thought it might be something like that.

I'll just add a VSync bool to my Settings and then if it's true, set "PresentationInterval" to "D3DPRESENT_INTERVAL_DEFAULT", and if it's false, set it to "D3DPRESENT_INTERVAL_IMMEDIATE".

Thanks for your help.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!