SDL_ListModes() undocumented behaviour

Using SDL with XFree86 under Linux, I’ve noticed that SDL_ListModes()
can return -1. It seems to do so in the case where any dimensions would
be acceptable.
The docs mention returning NULL (if no modes are available with the
specified pixelformat) but not -1.

Is this an intended (but as-yet undocumented) behaviour?
Or is it just an extra feature of the X11 code?

Ben.–
Ben Campbell (Antipodean Straggler)
Programmer, Creature Labs
ben.campbell at creaturelabs.com
www.creaturelabs.com

Using SDL with XFree86 under Linux, I’ve noticed that SDL_ListModes()
can return -1. It seems to do so in the case where any dimensions would
be acceptable.
The docs mention returning NULL (if no modes are available with the
specified pixelformat) but not -1.

Is this an intended (but as-yet undocumented) behaviour?
Or is it just an extra feature of the X11 code?

Neither, it’s indented but misdocumented. The html docs say:

 Returns NULL if there are no dimensions available for a
 particular format, or if any dimension is okay
 for the given format.

but this should probably be

 Returns NULL if there are no dimensions available for a
 particular format, or (SDL_Rect **)-1 if any dimension is okay
 for the given format.

I imagine other windowed targets behave similarly.

(Martin, remember to fix this in the new docs, please!)

but this should probably be

Returns NULL if there are no dimensions available for a
particular format, or (SDL_Rect **)-1 if any dimension is okay
for the given format.

I imagine other windowed targets behave similarly.

(Martin, remember to fix this in the new docs, please!)
Yes mother!

:slight_smile:

MartinOn Mon, 19 Jun 2000, Mattias Engdegard wrote:

Bother! said Pooh, as Quark cheated him.

Ben Campbell wrote:

Using SDL with XFree86 under Linux, I’ve noticed that SDL_ListModes()
can return -1. It seems to do so in the case where any dimensions would
be acceptable.
The docs mention returning NULL (if no modes are available with the
specified pixelformat) but not -1.

Is this an intended (but as-yet undocumented) behaviour?
Or is it just an extra feature of the X11 code?

for greates documentation see SDL headers–
Linux = "The Tecnological Evolution"
Linux + Overclock = “The Art of Racing”