Fullscreen refresh on win32

Windows has a terrible default for fullscreen 3D apps of 60mhz refresh
rate. This can be fixed by the user by going into his driver’s
control panel and forcing the refresh rate higher. However, this not a
very user friendly way about it, and in any case SDL contains no code
that could figure out this that condition has afflicted the user.

So the question is, could SDL fix this for the user? It is possible
under Windows to request a higher refresh rate. The danger is of
course that if the user has an old monitor, and you request a too high
refresh rate, the monitor could be damaged. However, I believe there
might be a way around that: Check before switching what refresh rate
the user’s desktop runs in, and if our fullscreen dimensions are equal
or less than those of the desktop, use the higher refresh rate of 60
and the desktop rate.

Since most users run their desktops in the same or higher resolution
as their games, and driver installs usually set the desktop refresh to
something sane, this should fix this problem for most users.

Thoughts?

An alternative is to add an SDL_GL_GetAttribute(SDL_GL_REFRESH_RATE)
option so that programs can bitch at their users at their own
convenience.

  • Per

However, I believe there
might be a way around that: Check before switching what refresh rate
the user’s desktop runs in, and if our fullscreen dimensions are
equal or less than those of the desktop, use the higher refresh rate
of 60 and the desktop rate.

I like that idea. If people run their desktop at 60 Hz (some don’t
seem to mind, really!), then there’s probably not much point in using
higher refresh rates for games. (Well, there is the latency issue…)

Either way, it seems sensible to assume that the desktop refresh rate
is good enough and still safe.

[…]

An alternative is to add an SDL_GL_GetAttribute(SDL_GL_REFRESH_RATE)
option so that programs can bitch at their users at their own
convenience.

That interface is strictly intended for OpenGL attributes, AFAIK.
Short of a proper API extension in SDL 1.3 or 2.0, I’d rather see
another environment variable - which has the handy side effect of
being usable even with applications that don’t explicitly support the
feature.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Sunday 06 March 2005 17.06, Per Inge Mathisen wrote: