Refresh rate defaults to 60hz on fullscreen apps

Hi guys. I’m looking for some advice on making sure that a fullscreen
SDL application is using the maximum refresh rate that the adapter
allows. For some reason, when my app goes fullscreen (1280x1024), it
defaults to the lowest refresh rate of 60Hz. Even when a similar desktop
setting uses the optimum frequency.

I understand that this might be outside SDL’s control for portability
reasons, but I’d be interested in knowing if anyone could offer some
Win32 advice to ensure that the maximum refresh available is being used.

I can use a 3rd party tool like PowerStrip to ensure that the maximum
refresh is used for all applications, but I don’t want this to be a
problem affecting other people who download and run the code.

Thanks,
Nick

( also, is it possible to search the mailing list? I have a sense this
refresh rate question has probably been asked before. )

Nick Anderson wrote:

Hi guys. I’m looking for some advice on making sure that a fullscreen
SDL application is using the maximum refresh rate that the adapter
allows. For some reason, when my app goes fullscreen (1280x1024), it
defaults to the lowest refresh rate of 60Hz. Even when a similar
desktop setting uses the optimum frequency.

I understand that this might be outside SDL’s control for portability
reasons, but I’d be interested in knowing if anyone could offer some
Win32 advice to ensure that the maximum refresh available is being used.

To my knowledge, this is controlled by DirectX (if using DX, of course)
or Windows itself when using WinDIB. I am, however, not the utmost
authority on the topic of refresh rates.

I can use a 3rd party tool like PowerStrip to ensure that the maximum
refresh is used for all applications, but I don’t want this to be a
problem affecting other people who download and run the code.

Thanks,
Nick

( also, is it possible to search the mailing list? I have a sense this
refresh rate question has probably been asked before. )

It most certainly is, though not like you’d assume, I think. Go to
http://www.google.com and format your search there by prepending your
search query with “site:http://www.devolution.com/pipermail/sdl/
(without the quotes, of course). This has always proven quite useful to
me, and eliminates the need of having a bloated mailing list website.
Alternately, you can download the gzip’ed text and search using your
favorite text editor after decompressing the archive.

-Elden

Nick Anderson wrote:

Hi guys. I’m looking for some advice on making sure that a fullscreen
SDL application is using the maximum refresh rate that the adapter
allows. For some reason, when my app goes fullscreen (1280x1024), it
defaults to the lowest refresh rate of 60Hz. Even when a similar desktop
setting uses the optimum frequency.

I understand that this might be outside SDL’s control for portability
reasons, but I’d be interested in knowing if anyone could offer some
Win32 advice to ensure that the maximum refresh available is being used.

I can use a 3rd party tool like PowerStrip to ensure that the maximum
refresh is used for all applications, but I don’t want this to be a
problem affecting other people who download and run the code.

Thanks,
Nick

( also, is it possible to search the mailing list? I have a sense this
refresh rate question has probably been asked before. )

Maybe a proper driver for your monitor would help? I don’t think there
is an SDL function to change the refresh rate!

Simon Parzer

(sorry if this posts twice, I changed my email address…)

You’re right, there is no function to specify or change the refresh rate…
And it seems kind of unpredictable whether you will get an 85hz, 60hz, or
anything else… It seems that SDL does not actually go off of the hardware
specs, but what the operating system reports as the specs(in XP’s case, this
limits all resolutions to 85hz max, even though my monitor & card can do

100hz at my current screen resolution) This has been a frustrating problem
for a while - has ANYONE ever figured out how to ensure a certain refresh
rate? (env. variables, or anything?)> ----- Original Message -----
From: s_parz@yahoo.de (Simon Parzer)
To:
Sent: Friday, October 14, 2005 10:34 AM
Subject: [SDL] Re: Refresh rate defaults to 60hz on fullscreen apps.

Nick Anderson wrote:

Hi guys. I’m looking for some advice on making sure that a fullscreen SDL
application is using the maximum refresh rate that the adapter allows.
For some reason, when my app goes fullscreen (1280x1024), it defaults to
the lowest refresh rate of 60Hz. Even when a similar desktop setting uses
the optimum frequency.

I understand that this might be outside SDL’s control for portability
reasons, but I’d be interested in knowing if anyone could offer some
Win32 advice to ensure that the maximum refresh available is being used.

I can use a 3rd party tool like PowerStrip to ensure that the maximum
refresh is used for all applications, but I don’t want this to be a
problem affecting other people who download and run the code.

Thanks,
Nick

( also, is it possible to search the mailing list? I have a sense this
refresh rate question has probably been asked before. )

Maybe a proper driver for your monitor would help? I don’t think there is
an SDL function to change the refresh rate!

Simon Parzer


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

David Olsen wrote:

… CUT …
has ANYONE ever figured out how to ensure a certain refresh
rate? (env. variables, or anything?)

Easy. Follow the two steps:

  1. Download a driver for your monitor
  2. Download RefreshLock (http://www.pagehosting.co.uk/rl/)

RefreshLock is a little tool that fixes the refresh rate problem under
WinXP. It works best when you have a driver for your monitor, because
the standard windows driver (Plug & Play Monitor) possibly doesn’t
enable all refresh rates available on your CRT.

Simon Parzer

Thanks for the info everyone.

I remembered from Win32 coding a while back that there is a GDI function
called ChangeDisplaySettings() which has a variable DEVMODE, who’s
members include {DWORD dmDisplayFrequency}. It’s possible that SDL is
switching to a GDI emulation mode when going fullscreen. I need to do my
housekeeping and check to see what video mode it’s actually chosen. When
DirectX is used to set the display mode, I believe it goes through a
process (in order) of checking refresh rates in the registry for the
device, and then other more compatible methods etc.

Simon: That little app worked a treat. I’ll probably mention the refresh
issue in a README for anything I end up releasing. Thanks.
Elden: I didn’t know Google could do url-restricted searches. Cheers for
the info!

  • Nick