Jump to content
  • Advertisement
Sign in to follow this  
anders211

FPS still the same no matter what presentation parameters are

This topic is 1056 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

Hi

2 years ago I could force my project to run on 60 FPS (refresh rate of the screen) or even real maximum FPS.

Unfortunately I completely forgot what parameters were changed to manipulate frames per seconds. Here are my presentation parameters:

 

 D3DPRESENT_PARAMETERS d3dpp;
   ZeroMemory(&d3dpp, sizeof(d3dpp));
   d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
   d3dpp.Windowed = false;
   d3dpp.BackBufferFormat =  D3DFMT_X8R8G8B8; 
   d3dpp.EnableAutoDepthStencil = TRUE; //w??cz bufor Z
   d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; 
   d3dpp.BackBufferCount = 1; 
   d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
   d3dpp.MultiSampleQuality = 0;
   d3dpp.hDeviceWindow = hWnd;
d3dpp.BackBufferWidth = 1680;
d3dpp.BackBufferHeight = 1050;   
d3dpp.Flags = 0; //D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;    
d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;    
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; //ONE,TWO,THREE,FOURS,IMMEDIATE,D3DPRESENT_INTERVAL_DEFAULT (reduces by half)
  

I might swear that in order to have refresh rate of the screen (60FPS) I used:

d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; 

and in order to have real FPS (for example 500) I changed second one to D3DPRESENT_INTERVAL_IMMEDIATE

However whatever parameter is I have now FPS between 63 and 64. It also doesn't depend on amount of draw calls. I now nothing draw on the scene and still I have 63-64. What might be the rootcause? I don't have also any limitation/conditions in message loop. For those 2 years I didn't exchange graphic card, however I reinstalled many time windows, so maybe the rootcause is placed in some graphic card settings???

Edited by anders211

Share this post


Link to post
Share on other sites
Advertisement

You can read about the different parameters here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb172588%28v=vs.85%29.aspx

With all D3D structs/classes/functions you can search for them on MSDN to get pretty good documentation. I usually use Google with "D3DPRESENT_PARAMETERS msdn" for example, which always finds the docs. Same can be done for other Windows functions and structures.

Your FullScreen_RefreshRateInHz should just be a integer ("D3DPRESENT_RATE_DEFAULT" is an enum that happens to have the value of an accepted integer).

It should be D3DPRESENT_INTERVAL_IMMEDIATE that unlocks framerate. Make sure you check your NVidia/AMD/Intel control panel 3D settings though, they usually have a "VSync" option that can be set as "let the application decide", "no" or "yes". If it's on Yes then the driver will override your present parameters and always lock the framerate, whereas No means always allow maximum framerate.

If you're on a laptop you might want to also check for integrated vs discrete GPU in the graphics settings, if the laptop has both and selects the integrated to save power.

Edited by Erik Rufelt

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!