SDL-1.3 reports only 1 available display mode and other video bugs, and SDL-1.3 documentation plug

When using the X11 driver at least, SDL-1.3 reports only the desktop
mode through SDL_GetNumDisplayModes and SDL_GetDisplayMode. This of
course affects all of the other mode functions.

Also, all mode query functions always report 0 for refresh_rate and
SDL_GetFullscreenMode reports 0 for width and height as well by
default.

SDL_GetClosestDisplayMode uses SDL_GetNumDisplayModes and
SDL_GetDisplayMode, so it only ever reports one mode or fails, except
that the resulting mode has whatever refresh_rate value was passed in.

I expect SDL_SetFullscreenMode is also affected by this.

The dummy video driver doesn’t work either. SDL_VideoInit(“dummy”, 0)
returns non-zero (this is after checking with SDL_GetNumVideoDrivers
and SDL_GetVideoDriver to make sure it’s compiled in).

I could see how some of this might be caused by the operating system
instead of bugs in SDL, so if some of these are working for you please
let me know.
I’m using Linux Mint 7 Gloria x64, which is based on Ubuntu Jaunty
Jackalope 9.04, on an AMD Athlon 64 with nVidia C51G (GeForce 6100).

I’ve attached a batch of test programs you can use to test this stuff.
These are the same programs I’ve used as example code in the SDL-1.3
API documentation ( http://www.libsdl.org/cgi/docwiki.cgi/SDL-1.3/API
).
If it matters, consider them public domain or CC0.
If anyone else wants to work on documenting SDL, please do.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: closestmode.c
Type: text/x-csrc
Size: 979 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090730/879d7e7c/attachment.c
-------------- next part --------------
A non-text attachment was scrubbed…
Name: displaytest.c
Type: text/x-csrc
Size: 943 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090730/879d7e7c/attachment-0001.c
-------------- next part --------------
A non-text attachment was scrubbed…
Name: drivertest.c
Type: text/x-csrc
Size: 705 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090730/879d7e7c/attachment-0002.c
-------------- next part --------------
A non-text attachment was scrubbed…
Name: drivertest2.c
Type: text/x-csrc
Size: 300 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090730/879d7e7c/attachment-0003.c
-------------- next part --------------
A non-text attachment was scrubbed…
Name: modetest.c
Type: text/x-csrc
Size: 794 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090730/879d7e7c/attachment-0004.c

See bug 702 for the reason.

Here is a run of your displaytest.c in my system, which has SDL 1.3
with the patch from bug 702 applied.

gcc sdl-config --cflags --libs -o displaytest displaytest.c
./displaytest
Currently using display 0.

Enumerating modes for display 0
Mode 0: 1680x1050 50Hz 24 bpp
Mode 0: 1440x900 52Hz 24 bpp
Mode 0: 1440x900 51Hz 24 bpp
Mode 0: 1400x1050 53Hz 24 bpp
Mode 0: 1280x1024 55Hz 24 bpp
Mode 0: 1280x1024 54Hz 24 bpp
Mode 0: 1280x960 56Hz 24 bpp
Mode 0: 1280x800 58Hz 24 bpp
Mode 0: 1280x800 57Hz 24 bpp
Mode 0: 1280x720 60Hz 24 bpp
Mode 0: 1280x720 59Hz 24 bpp
Mode 0: 1152x864 61Hz 24 bpp
Mode 0: 1024x768 64Hz 24 bpp
Mode 0: 1024x768 63Hz 24 bpp
Mode 0: 1024x768 62Hz 24 bpp
Mode 0: 832x624 65Hz 24 bpp
Mode 0: 800x600 70Hz 24 bpp
Mode 0: 800x600 69Hz 24 bpp
Mode 0: 800x600 68Hz 24 bpp
Mode 0: 800x600 67Hz 24 bpp
Mode 0: 800x600 66Hz 24 bpp
Mode 0: 720x576 71Hz 24 bpp
Mode 0: 720x480 72Hz 24 bpp
Mode 0: 700x525 73Hz 24 bpp
Mode 0: 640x512 74Hz 24 bpp
Mode 0: 640x480 79Hz 24 bpp
Mode 0: 640x480 78Hz 24 bpp
Mode 0: 640x480 77Hz 24 bpp
Mode 0: 640x480 76Hz 24 bpp
Mode 0: 640x480 75Hz 24 bpp
Mode 0: 576x432 80Hz 24 bpp
Mode 0: 512x384 83Hz 24 bpp
Mode 0: 512x384 82Hz 24 bpp
Mode 0: 512x384 81Hz 24 bpp
Mode 0: 416x312 84Hz 24 bpp
Mode 0: 400x300 88Hz 24 bpp
Mode 0: 400x300 87Hz 24 bpp
Mode 0: 400x300 86Hz 24 bpp
Mode 0: 400x300 85Hz 24 bpp
Mode 0: 320x240 91Hz 24 bpp
Mode 0: 320x240 90Hz 24 bpp
Mode 0: 320x240 89Hz 24 bpp
42 modes.

1 displays.

PS. The mode number is zero as your code used the screen number (i) as the
mode parameter instead of the j. After that change it will work correctly.On Thursday 30 July 2009 11:04:18 Kenneth Bull wrote:

When using the X11 driver at least, SDL-1.3 reports only the desktop
mode through SDL_GetNumDisplayModes and SDL_GetDisplayMode. This of
course affects all of the other mode functions.

Also, all mode query functions always report 0 for refresh_rate and
SDL_GetFullscreenMode reports 0 for width and height as well by
default.

SDL_GetClosestDisplayMode uses SDL_GetNumDisplayModes and
SDL_GetDisplayMode, so it only ever reports one mode or fails, except
that the resulting mode has whatever refresh_rate value was passed in.

I expect SDL_SetFullscreenMode is also affected by this.

The dummy video driver doesn’t work either. SDL_VideoInit(“dummy”, 0)
returns non-zero (this is after checking with SDL_GetNumVideoDrivers
and SDL_GetVideoDriver to make sure it’s compiled in).

I could see how some of this might be caused by the operating system
instead of bugs in SDL, so if some of these are working for you please
let me know.
I’m using Linux Mint 7 Gloria x64, which is based on Ubuntu Jaunty
Jackalope 9.04, on an AMD Athlon 64 with nVidia C51G (GeForce 6100).

I’ve attached a batch of test programs you can use to test this stuff.
These are the same programs I’ve used as example code in the SDL-1.3
API documentation ( http://www.libsdl.org/cgi/docwiki.cgi/SDL-1.3/API
).
If it matters, consider them public domain or CC0.
If anyone else wants to work on documenting SDL, please do.

2009/7/30 Sami N??t?nen <sn.ml at keijukammari.fi>:

See bug 702 for the reason.

PS. The mode number is zero as your code used the screen number (i) as the
mode parameter instead of the j. After that change it will work correctly.

Thanks. I’ll correct that in the wiki.
Anyone know why this patch hasn’t been applied to Trunk yet?

Yep, I have to do some research on various fullscreen options before I
enable that code.On Thu, Jul 30, 2009 at 7:56 PM, Kenneth Bull wrote:

2009/7/30 Sami N??t?nen <sn.ml at keijukammari.fi>:

See bug 702 for the reason.

PS. The mode number is zero as your code used the screen number (i) as
the
mode parameter instead of the j. After that change it will work
correctly.

Thanks. I’ll correct that in the wiki.
Anyone know why this patch hasn’t been applied to Trunk yet?


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC