Fullscreen Refresh Rate

I am again!

My platform is PC / WinXP Pro (Athlon XP 1600+ / GeForce 2 Ti)

I have 60Hz (I saw that from monitor OSD) in res 640 x 480 (my card/monitor supports 120Hz)

This is the code:---------------
if (SDL_Init(SDL_INIT_VIDEO)) {SDL_Quit(); exit(0);}
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if (!(screen = SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN | SDL_HWSURFACE | SDL_RESIZABLE | SDL_OPENGL))) {SDL_Quit(); exit(0);}

What is wrong?

<- Chameleon ->
http://tassadar.physics.auth.gr/~chameleon/
cham_gss at hotmail.NOSPAM.com

I think it’s a known problem with nvidia drivers on Win2K/WinXP. Search in google for “nvidia refresh fix” and you will find an app that will fix your problem.

I hope it works.

El Sun, 9 Feb 2003 12:32:27 +0200
"<- Chameleon ->" <cham_gss at hotmail.com> escribi?:> I am again!

My platform is PC / WinXP Pro (Athlon XP 1600+ / GeForce 2 Ti)

I have 60Hz (I saw that from monitor OSD) in res 640 x 480 (my card/monitor supports 120Hz)

This is the code:

if (SDL_Init(SDL_INIT_VIDEO)) {SDL_Quit(); exit(0);}
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if (!(screen = SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN | SDL_HWSURFACE | SDL_RESIZABLE | SDL_OPENGL))) {SDL_Quit(); exit(0);}

What is wrong?

<- Chameleon ->
http://tassadar.physics.auth.gr/~chameleon/
cham_gss at hotmail.NOSPAM.com

Actually, this is not a bug, or “known problem” with NVidia drivers.
This is due to an architectural change that Microsoft made with how
refresh rates are treated under Windows XP. As a workaround, NVidia in
their latest driver series provides a “refresh rate override” section
for Direct3D in their control panel that lets you override the refresh
rate for any supported resolution.

Caution though, it lets you use refresh rates that you monitor may not
support :)On Sun, 2003-02-09 at 14:10, Wil-Wal wrote:

I think it’s a known problem with nvidia drivers on Win2K/WinXP. Search in google for “nvidia refresh fix” and you will find an app that will fix your problem.

I hope it works.

No, this happens in Win2K, too.

The problem is that SDL isn’t specifying a refresh rate when it calls
ChangeDisplaySettings.

However, there’s no safe way to determine the maximum available refresh
rate; some systems (probably in particular those with non-PnP monitors)
think they have refresh rates available that they don’t, so you can’t
just pull the maximum value from the mode enum.

It’s a pretty safe bet, however, that you can use the desktop refresh
rate in any mode whose resolution and bit depth is (both) less than or
equal to it. (For example, if the desktop is 1024x768, 16bpp, 85Hz,
then you should be able to get 800x600, 16bpp, 85hz, too.)

Currently, the copy of SDL I’m using has a hack to let me specify the
desired refresh, and this can be set by the user, with a default of
"default" that leaves it alone (often resulting in 60Hz). If setting
the video mode fails, it unsets the refresh and tries again. I’ll
soon be adding the above trick to the SDL code, which will make it use
the above trick to try to get a higher refresh for the default setting.On Sun, Feb 09, 2003 at 06:58:09PM -0600, Shawn wrote:

I think it’s a known problem with nvidia drivers on Win2K/WinXP. Search in google for “nvidia refresh fix” and you will find an app that will fix your problem.

I hope it works.

Actually, this is not a bug, or “known problem” with NVidia drivers.
This is due to an architectural change that Microsoft made with how
refresh rates are treated under Windows XP. As a workaround, NVidia in
their latest driver series provides a “refresh rate override” section
for Direct3D in their control panel that lets you override the refresh
rate for any supported resolution.


Glenn Maynard

Ooops, did I fail to mention that this is also an issue with Win2k
because of the same architectural change. The change is this, if you
remember “Win9x” had an “optimal” refresh rate option that it used all
the time unless you specifically selected a different one. However,
starting with Win2k, and XP Microsoft now uses a specific refresh rate,
this changed how the default refresh rate was selected for DirectX based
programs.

To sum up, Microsoft changed how the “default” refresh rate was
determined with Win2k and XP.

That is the real issue in a way…On Sun, 2003-02-09 at 19:19, Glenn Maynard wrote:

On Sun, Feb 09, 2003 at 06:58:09PM -0600, Shawn wrote:

I think it’s a known problem with nvidia drivers on Win2K/WinXP. Search in google for “nvidia refresh fix” and you will find an app that will fix your problem.

I hope it works.

Actually, this is not a bug, or “known problem” with NVidia drivers.
This is due to an architectural change that Microsoft made with how
refresh rates are treated under Windows XP. As a workaround, NVidia in
their latest driver series provides a “refresh rate override” section
for Direct3D in their control panel that lets you override the refresh
rate for any supported resolution.

No, this happens in Win2K, too.

That may be the cause. The issue is that SDL needs to explicitly set the
refresh rate when it calls ChangeDisplaySettings. :slight_smile: (At least for the
OpenGL code path, which is the only one I’m familiar with.)

(It’s all well and good that there are tools like ReForce and driver
settings in some drivers to handle this, but it’s always better to have
more generic, automatic fixes for things like this, since you can’t tell
your average user to fiddle around with driver settings …)On Sun, Feb 09, 2003 at 08:28:21PM -0600, Shawn wrote:

Ooops, did I fail to mention that this is also an issue with Win2k
because of the same architectural change. The change is this, if you
remember “Win9x” had an “optimal” refresh rate option that it used all
the time unless you specifically selected a different one. However,
starting with Win2k, and XP Microsoft now uses a specific refresh rate,
this changed how the default refresh rate was selected for DirectX based
programs.

To sum up, Microsoft changed how the “default” refresh rate was
determined with Win2k and XP.

That is the real issue in a way…


Glenn Maynard

Currently, the copy of SDL I’m using has a hack to let me specify the
desired refresh, and this can be set by the user, with a default of
"default" that leaves it alone (often resulting in 60Hz). If setting
the video mode fails, it unsets the refresh and tries again. I’ll
soon be adding the above trick to the SDL code, which will make it use
the above trick to try to get a higher refresh for the default setting.

Go ahead and submit a patch when you do.

Thanks Glenn! :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Win2k, XP are the only two platforms affected by this issue AFAIK. So to
me, this is a Win32 specific hack, since AFAIK other platforms are not
effected by this “wondrous behavior.” Perhaps a win32 dev should send in
a patch that selects the highest “safe” refresh rate reported by windows
and use that?On Sun, 2003-02-09 at 21:20, Glenn Maynard wrote:

That may be the cause. The issue is that SDL needs to explicitly set the
refresh rate when it calls ChangeDisplaySettings. :slight_smile: (At least for the
OpenGL code path, which is the only one I’m familiar with.)