Highest resolution is invalid

I’m using SDL 1.2.14. WinXP has the idea that my monitor can go to
1920x1440 when it can really only go to 1920x1200. When I set it to
1920x1440 in the display settings the monitor can’t sync.

Naturally, SDL_ListModes reports 1920x1440 as an option.
Unfortunately, SDL_VideoModeOK also says that it is valid, so when I
try to go fullscreen I am choosing an invalid mode. Does anyone know
a more accurate way to figure out the maximum valid resolution?

Oh, and I have tried passing 0 for width and height to
SDL_SetVideoMode, but that just sets the fullscreen resolution to be
what my windowed resolution had been.–
Terry Welsh / mogumbo ‘at’ gmail.com
www.reallyslick.com / www.mogumbo.com

2009/10/26 Terry Welsh :

I’m using SDL 1.2.14. ?WinXP has the idea that my monitor can go to
1920x1440 when it can really only go to 1920x1200. ?When I set it to
1920x1440 in the display settings the monitor can’t sync.

This is not a problem with SDL. This is a problem with the way you
have configured your computer.

Make sure you have the correct monitor and refresh rate selected in
Display Properties>Settings>Advanced>Monitor (on XP). The software
that came with your video driver may also have some other way to
select which modes are made available.

To avoid this problem in your program, instead of picking an arbitrary
video mode from those available, load the dimensions and bit depth
from a configuration file or command line option, and use a sensible
default (640x480 or 800x600).

You could call SDL_GetVideoInfo() before setting up a video mode,
that way you can determine your desktop resolution (current_w and
current_h) and use it as your default fullscreen resolution.
http://www.libsdl.org/cgi/docwiki.cgi/SDL_VideoInfo

IMHO an app should never default to the highest available resolution,
because there is always a risk that the OS and/or display firmware may
add invalid resolutions to the list. This isn’t a limitation of SDL,
but rather of buggy display firmwares and confusing standards.On Mon, Oct 26, 2009 at 00:57, Terry Welsh wrote:

I’m using SDL 1.2.14. ?WinXP has the idea that my monitor can go to
1920x1440 when it can really only go to 1920x1200. ?When I set it to
1920x1440 in the display settings the monitor can’t sync.

Naturally, SDL_ListModes reports 1920x1440 as an option.
Unfortunately, SDL_VideoModeOK also says that it is valid, so when I
try to go fullscreen I am choosing an invalid mode. ?Does anyone know
a more accurate way to figure out the maximum valid resolution?

Oh, and I have tried passing 0 for width and height to
SDL_SetVideoMode, but that just sets the fullscreen resolution to be
what my windowed resolution had been.

Terry Welsh ?/ ?mogumbo ‘at’ gmail.com
www.reallyslick.com ?/ ?www.mogumbo.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  • SR

Right, this is not an SDL limitation. Sorry if I implied that it was;
not my intention. This is a Windows and/or monitor problem. Since
people playing my game might have the same problem I was hoping for a
nice SDL solution.

Your tip about SDL_GetVideoInfo() seems to do the trick. It lets me
make the default game resolution the same as my desktop resolution,
which is appropriate for my game. Thanks.–
Terry Welsh / mogumbo ‘at’ gmail.com
www.reallyslick.com / www.mogumbo.com

Message: 7
Date: Mon, 26 Oct 2009 13:49:15 -0400
From: Simon Roby <simon.roby at gmail.com>
To: SDL Development List
Subject: Re: [SDL] highest resolution is invalid
Message-ID:
? ? ? ?<3158703d0910261049r5f004984jb354436709525c93 at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

You could call SDL_GetVideoInfo() before setting up a video mode,
that way you can determine your desktop resolution (current_w and
current_h) and use it as your default fullscreen resolution.
http://www.libsdl.org/cgi/docwiki.cgi/SDL_VideoInfo

IMHO an app should never default to the highest available resolution,
because there is always a risk that the OS and/or display firmware may
add invalid resolutions to the list. This isn’t a limitation of SDL,
but rather of buggy display firmwares and confusing standards.

On Mon, Oct 26, 2009 at 00:57, Terry Welsh <@Terry_Welsh> wrote:

I’m using SDL 1.2.14. ?WinXP has the idea that my monitor can go to
1920x1440 when it can really only go to 1920x1200. ?When I set it to
1920x1440 in the display settings the monitor can’t sync.

Naturally, SDL_ListModes reports 1920x1440 as an option.
Unfortunately, SDL_VideoModeOK also says that it is valid, so when I
try to go fullscreen I am choosing an invalid mode. ?Does anyone know
a more accurate way to figure out the maximum valid resolution?

Oh, and I have tried passing 0 for width and height to
SDL_SetVideoMode, but that just sets the fullscreen resolution to be
what my windowed resolution had been.

Terry Welsh ?/ ?mogumbo ‘at’ gmail.com
www.reallyslick.com ?/ ?www.mogumbo.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org