SDL_VideoModeOK(), SDL_ListModes() behaviour

Hi everyone,
well, this may be somewhat related to a former thread “[SDL] [PATCH]
SDL_VideoModeOK() vs. SDL_FULLSCREEN” started by Ryan C. Gordon about a
year ago (Mon Feb 23 22:47:22 2004) which I came across during my
investigations on the following problem:

I am currently getting into sdl in order to develop a little game (I am
a sdl newb).
For testing purposes I called the function SDL_VideoModeOK() with a
resolution of 40000x40000. My gfx hardware (geforce2) should not be able
to handle that resolution and when calling SDL_SetVideoMode() I get an
error message “No video mode large enough for 40000x40000”.

But: According to SDL_VideoModeOK() this resolution is supported. I took
a look at the sdl sourcecode (I am using 1.2.8 but checked current cvs
sources as well) and found out that the function SDL_VideoModeOK() (in
SDL_video.c) seems to use SDL_ListModes().

I used a debugger to check the return value of SDL_ListModes(): It
returns -1 on my system. This means that any size is supported on my
hardware… thus SDL_VideoModeOK() marks the requested resolution as

from the source (SDL_video.c, ll. 397-400):

if (sizes == (SDL_Rect *)NEGATIVE_ONE) {
Any size supported at this bit-depth */
supported = 1;

But obviously it is not supported at all: SDL_SetVideoMode() fails.

If SDL_VideoModeOK() considers a video mode as supported shouldn’t this
mode be usable by SDL_SetVideoMode()?

Well, after reading about Ryan C. Gordon’s posting in the mailing list
archives it seems that he experienced the same problem and wrote a patch
for it. Might be a fairly dumb question but I am a newbie to unix/open
source programming and don’t quite understand those diffs:
Is his patch already merged to the common sourcecode or do I have to do
it myself somehow?

However, thanks for your attention.

Sascha Hoffmann