README
author Patrice Mandin <patmandin@gmail.com>
Thu, 19 Jan 2006 21:28:52 +0000
changeset 1257 448a9a64537b
parent 702 61b7f5eed0e8
child 1276 ca3718c215af
permissions -rw-r--r--
[PATCH] SDL_GetVideoMode() does not find best mode, part 2

Following commit 1.51, I come accross a problem when SDL must choose between
several video modes that could suit the one asked.

If I ask 320x240 with this list:
768x480 768x240 640x400 640x200 384x480 384x240 320x400 320x200

The smallest selectables modes are 384x240 and 320x400. And SDL choose the later
in this list, but 384x240 is more suitable. So I added a check to compare
the pixel count (surface) of modes, and select the one which has the smallest
pixel count.

In my example, 384x240 has 92160 pixels, and 320x400 has 128000 pixels. So now
SDL will choose 384x240 for the asked 320x240 mode.
     1 
     2                          Simple DirectMedia Layer
     3 
     4                                   (SDL)
     5 
     6                                 Version 1.2
     7 
     8 ---
     9 http://www.libsdl.org/
    10 
    11 This is the Simple DirectMedia Layer, a general API that provides low
    12 level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
    13 and 2D framebuffer across multiple platforms.
    14 
    15 SDL is written in C, but works with C++ natively, and has bindings to
    16 several other languages, including Ada, C#, Eiffel, Java, Lua, ML,
    17 Objective C, Perl, PHP, Pike, Python, and Ruby.
    18 
    19 The current version supports Linux, Windows, BeOS, MacOS, MacOS X,
    20 FreeBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.  The code contains
    21 support for Windows CE, AmigaOS, Dreamcast, Atari, NetBSD, AIX, OSF/Tru64,
    22 RISC OS, and SymbianOS, but these are not officially supported.
    23 
    24 This library is distributed under GNU LGPL version 2, which can be
    25 found in the file  "COPYING".  This license allows you to use SDL
    26 freely in commercial programs as long as you link with the dynamic
    27 library.
    28 
    29 The best way to learn how to use SDL is to check out the header files in
    30 the "include" subdirectory and the programs in the "test" subdirectory.
    31 The header files and test programs are well commented and always up to date.
    32 More documentation is available in HTML format in "./docs/index.html"
    33 
    34 The test programs in the "test" subdirectory are in the public domain.
    35 
    36 Frequently asked questions are answered online:
    37 	http://www.libsdl.org/faq.php
    38 
    39 If you need help with the library, or just want to discuss SDL related
    40 issues, you can join the developers mailing list:
    41 	http://www.libsdl.org/mailing-list.php
    42 
    43 Enjoy!
    44 	Sam Lantinga				(slouken@libsdl.org)
    45