Archived

This topic is now archived and is closed to further replies.

How Can I set the refresh rate for the Monitor ?

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

Disanling Vsync and then limiting frames is not the same thing as changing the refresh rate... I have 75 FPS constantly, with Vsync Disabled 120 FPS. On other`s people CPU they have about 50-60 FPS so the first time I thought that they`re CPU is slower but it`s not that though.. and disabling the Vsync won`t solve the preoblem... Setting the refresh rate will actually be a frame limiter...

Share this post


Link to post
Share on other sites
Are you blind ?
I said that on others CPU they have a lower FPS because the refresh rate is lower !!!!!!
At 50-60 FPS and he only had
Adapter Default
Optimal
60 Hz
and it was set on optimal....
I ment FUNCTIONS !!!!!!!!
Like SetMonitorRefreshRate(60);

Share this post


Link to post
Share on other sites
Use the dmDisplayFrequency member of the DEVMODE structure you pass to ChangeDisplaySettings(...).

Eg.


  
DEVMODE DevMode;
DevMode.dmSize = sizeof(DevMode);
DevMode.dmPelsWidth = 800;
DevMode.dmPelsHeight = 600;
DevMode.dmBitsPerPel = 32;
DevMode.dmDisplayFrequency = 60; // SET DISPLAY TO 60Hz

DevMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;

ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN);


Of course, you should change the resolution/fullscreen etc. as you need.

I''m unsure as to whether or not it actually works though, my driver''s OpenGL VSync setting doesn''t seem to change anything .

Share this post


Link to post
Share on other sites
and remmember that not all monitors supports heigh frequencies. so you will need to ask the user if he sees anything... and if not you should fallback into the original frqncy...

Nevermind...

Share this post


Link to post
Share on other sites
if you change the refresh rate of the monitor to one that is unsupported prepare for doom. i don''t know how to check supported refresh rates myself but you should find out how to do that before you go crazy setting people''s refresh rates.

also, LCD monitors don''t support anything above 60Hz (60FPS).

-me

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Palidine
i don''t know how to check supported refresh rates


ChangeDisplaySettings() with the CDS_TEST flag...?

Share this post


Link to post
Share on other sites
quote:

ChangeDisplaySettings() with the CDS_TEST flag...?


But what if the wrong monitor driver was installed... would the flag CDS_TEST work at all cases?

Share this post


Link to post
Share on other sites
ok ok ok

this is some code I ripped from my generic setup window for most of the apps I use... it lists all avaliable resolutions..
it's using mfc class's, but is still applicable.
the avaliable video modes are listed in a combo box.. (m_ModeControl)

this is pretty rough code. but it works.


    
DEVMODE devmodes[512];
int n = 0;
while (EnumDisplaySettings(NULL, n, &devmodes[n]))
{
if (ChangeDisplaySettings(&devmodes[n], CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
{
CString a;
a+=devmodes[n].dmPelsWidth;
a+=" x ";
a+=devmodes[n].dmPelsHeight;
a+=" - ";
a+=devmodes[n].dmBitsPerPel;
a+="bit ";
a+=devmodes[n].dmDisplayFrequency;
a+="Hz";

m_ModeControl.InsertString(n,a);
}
n++;
}


[edited by - RipTorn on July 25, 2002 3:56:39 AM]

Share this post


Link to post
Share on other sites