This source is stable, and is fully tested on all supported platforms.
Please send bug reports or questions to the SDL mailing list:
http://www.libsdl.org/mailing-list.php
The latest stable release may be found on the SDL website.

## API Documentation

## SDL 1.2.16 Release Notes

SDL 1.2.16 is mostly multiple bug fixes since the previous version. Changes include:

> Audio, wav loader: security fixes for ADPCM decoding (CVE-2019-7572, CVE-2019-7573, CVE-2019-7574, CVE-2019-7575, CVE-2019-7576, CVE-2019-7577, CVE-2019-7578 -- bugs 4490, 4491, 4492, 4493, 4494, 4495, 4496, and 4522.)

> Video, bmp loader: security fixes for CVE-2019-7635, CVE-2019-7636, CVE-2019-7638, CVE-2019-13616 (bugs 4498, 4499, 4500, 4517 and 4538.)

> Video, blit: fix handling of alpha channel in Altivec accelerated blit functions (bug 1424.)

> Video, blit: correct vec_perm() application on little-endian 64-bit PowerPC (bug 4791. cf.: RedHat bug 1392465.)

> Video, blit: use fast path for RGB 565 -> 32-bit XRGB 8888

> Video, blit: fix RGBA<->RGBA blit broken with the optimization from bug 11 (bug 2976.)

> Video, blit, Linux: ARM assembly to address performance of blit and fill routines, thanks to Ben Avison (bug 4365.)

> Video: fix integer overflow in SDL_CalculatePitch (CVE-2019-7637, bug 4497.)

> Mouse: fix SDL_ResetMouse() using a bogus mouse button causing a negative shift (bug 3593.)

> Cdrom: fix SDL_CDResume() and SDL_CDStop() not returning failure when they should (bug 4108.)

> Unix, pthread: Fix SDL_SemWaitTimeout() returning -1 instead of SDL_MUTEX_TIMEDOUT upon timeout (bug 1426.)

> NetBSD: wscons support.

> NetBSD, audio: use AUDIO_GETBUFINFO when available.

> OpenBSD, audio: add sndio support.

> Haiku/BeOS, audio: fix error in buffer size setting (bug 1679.)

> OpenBSD: fix dynamic loading of X libs (bug 1434.)

> X11video: fix missing symbol X11_KeyToUnicode in .so file (bug 1390. not being an official SDL function, the use of X11_KeyToUnicode() is strongly discouraged.)

> X11video: fix compilation with libX11 >= 1.5.99.902 (bug 1769.)

> X11video: fix for XChangeProperty() crash (bug 1427.)

> X11video: fix SDL_EnableUNICODE sometimes dropping keyboard events completely (bug 2325.)

> X11video: fix no SDL_VIDEORESIZE event being generated when the window manager sets the window size (bug 1859.)

> X11video: fix X11_SetGammaRamp not checking the return value of XStoreColors (bugs 1979, 3770.)

> X11video: fix SDL_VIDEORESIZE events not received when resizing window from the corner (inverted logic in X11 ConfigureNotify, i.e. resize handling - bug 1430.)

> X11video: unblock SDL_WM_GrabInput() GrabNotViewable case (bug 1155.)

> Mac OS X: fix crash on any input in Quartz code (bug 2560.)

> Mac OS X: fix crash in Quartz gamma ramp code.

> Mac OS X: fix build for 10.9 Mavericks or newer (bug 2085.)

> Mac OS X, Quartz: fix cursor transparency (bug 4076.)

> Mac OS X, joystick: update to support Saitek p2500 gamepad (bug 2025)

> Mac OS X, main: updates for -psn_XXX command line arg for Finder launches in new macOS versions.

> Windows, video: fix other window positions/sizes when exiting fullscreen (bug 3315.)

> Windows, keyboard: reset deadkeys upon SDL_EnableUNICODE() or upon quit (bug 3332.)

> Windows: Visual Studio project file updates.

> OS/2: Watcom makefile updates.

> FreeBSD, joystick: compile fixes.

> BSD, joystick: increase the number of uhid devices to scan (bug 1561)

> Linux, evdev: ignore joystick axis events if they aren't in a sane range.

> Linux, joystick: fix Dualshock 3's motion sensors overwrite analog stick: protect against any axis that isn't reported by EVIOCGBIT but still sending EV_ABS events (bug 3193.)

> FreeBSD, cdrom: fix CDROM detection misbehaviour for 7.x and newer (bug 1529.)

> Solaris, audio: fix pulseaudio dynamic linking.

> Solaris, cpuinfo: fix asm syntax error causing build failures.

> Atari: multiple platform code updates.

> RISC OS: cleanups to platform code.

> RISC OS: fix thread starvation in fullscreen mode.

> RISC OS: fix returning from full-screen to 16M colour modes.

> RISC OS: fix receiving PreQuit messages.

> RISC OS: ensure the window size is consistent at different DPIs.

> RISC OS, video: add support for more pixel formats.

> RISC OS: mouse fixes. restore mouse palette when exiting while mouse is in focus. don't reset mouse focus when recreating the window.

> RISC OS: support Windows and Menu key input.

> RISC OS: implement SDL_WM_IconifyWindow()

> RISC OS: send SDL_APPACTIVE events when iconizing the window.

> RISC OS: support creating windows with the SDL_NOFRAME flag set.

> RISC OS: increase the number of supported joystick buttons.

> Configuration: fix library detection selecting wrong lib (bug 2795.)

> Configuration: fix detecting dynamic library support on powerpc64le (bug 3481.)

> SDL error: string formatting fixes to deal with nasty corner cases (bug 2049.)

> SDL_error: handle %lu, %li and %ld in format string (bug 3739.)

> stdlib: updated SDL_qsort() code.

> stdlib: use _strtoi64() and _strtoui64() when available for windows.

> headers, close_code.h: fix unbalanced #pragma pack(pop) for watcom builds (bug 3781.)

> headers, begin_code.h, close_code.h: updates to SDLCALL and DECLSPEC macros for OS/2.

> headers, endian: add Watcom inline asm for SDL_Swap16 and SDL_Swap32

> headers, config: updates to default windows and os2 config files.

> headers, SDL_syswm.h, SDL_stdinc.h: include system headers before packing alignment changes (bug 4149.)

## SDL 1.2.15 Release Notes

SDL 1.2.15 is a minor bug fix release.

### General Notes

> Fixed assembly register clobbering in CPU info routines

> Fixed memory stomp when using stretch blit on large images

> Fixed pixel corruption with overlapping blits

> SDL_JOYSTICK_DEVICE can be a colon separated list of joystick devices

> Disabled MMX blitters since they don't compile on modern compilers

### Unix Notes

> Fixed crash in joystick code on newer Linux kernels

> Fixed channel swizzling for ALSA target with 6-channel output

> Use the OpenGL GLX_EXT_swap_control extension if available

> XRandR support is disabled by default because it causes desktop reconfiguring. It can be enabled with the SDL_VIDEO_X11_XRANDR=1 environment variable, or by applying this patch: http://hg.libsdl.org/SDL/raw-rev/8ec3036098df

### Windows Notes

> Fixed SDL_GL_ACCELERATED_VISUAL handling

> Fixed application state handling with ALT-Tab

> Fixed occasional crash handling WM_ACTIVATEAPP in Direct X code

> Fixed UTF-8 decoding of Russian characters

### Mac OS X Notes

> Fixed building and running on Mac OS X 10.7 (Lion)

## SDL 1.2.14 Release Notes

SDL 1.2.14 is a significant bug fix release and a recommended update.

### General Notes

> Fixed flicker when resizing the SDL window

> Fixed crash in SDL_SetGammaRamp()

> Fixed freeze in SDL_memset() with 0 length when assembly code is disabled.

> Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys.

> Fixed audio quality problem when converting between 22050 Hz and 44100 Hz.

> Fixed a threading crash when a few threads are rapidly created and complete.

> Increased accuracy of alpha blending routines.

> Fixed crash loading BMP files saved with the scanlines inverted.

> Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event.

> Added doxygen documentation for the SDL API headers.

### Unix Notes

> Fixed potential memory corruption due to assembly bug with SDL_revcpy()

> Fixed crashes trying to detect SSE features on x86_64 architecture.

> Fixed assembly for GCC optimized 50% alpha blending blits.

> Added configure option --enable-screensaver, to allow enabling the screensaver by default.

> Use XResetScreenSaver() instead of disabling screensaver entirely.

> Removed the maximum window size limitation on X11.

> Fixed SDL_GL_SWAP_CONTROL on X11.

> Fixed setting the X11 window input hint.

> Fixed distorted X11 window icon for some visuals.

> Fixed detecting X11 libraries for dynamic loading on 64-bit Linux.

> SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control.

> Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11.

> The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen.

> Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console.
> Valid values are:

> - not set - Not rotating, no shadow.
> - "NONE" - Not rotating, but still using shadow.
> - "CW" - Rotating screen clockwise.
> - "UD" - Rotating screen upside down.
> - "CCW" - Rotating screen counter clockwise.

> Fixed DirectFB detection on some Linux distributions.

> Added code to use the PS3 SPE processors for YUV conversion on Linux.

> Updated ALSA support to the latest stable API

> ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.)

> Improved support for PulseAudio

> The Network Audio System support is now dynamically loaded at runtime.

> Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels.

> Fixed crash in SDL_Quit() when a joystick has been unplugged.

### Windows Notes

> Verified 100% compatibility with Windows 7.

> Prevent loss of OpenGL context when setting the video mode in response to a window resize event.

> Fixed video initialization with SDL_WINDOWID on Windows XP.

> Improved mouse input responsiveness for first-person-shooter games.

> IME messages are now generated for localized input.

> SDL_RWFromFile() takes a UTF-8 filename when opening a file.

> The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt.

> Fixed dynamic object loading on Windows CE.

### Mac OS X Notes

> SDL now builds on Mac OS X 10.6 (Snow Leopard).
> Eric Wing posted a good rundown on the numerous changes here: http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html

> The X11 video driver is built by default.

> Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target.

> Fixed setting the starting working directory in release builds.

## SDL 1.2.13 Release Notes

SDL 1.2.13 is a minor bug fix release.

### General Notes

> Fixed link error when building with Intel Compiler 10.

> Removed stray C++ comment from public headers.

### Unix Notes

> Fixed crash in SDL_SoftStretch() on secure operating systems.

> Fixed undefined symbol on X11 implementations without UTF-8 support.

> Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver.

> Scan for all joysticks on Linux instead of stopping at one that was removed.

> Fixed use of sdl-config arguments in sdl.m4

### Windows Notes

> Fixed crash when a video driver reports higher than 32 bpp video modes.

> Fixed restoring the desktop after setting a 24-bit OpenGL video mode.

> Fixed window titles on Windows 95/98/ME.

> Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons.

> Added support for quoted command line arguments.

### Mac OS X Notes

> SDL now builds on Mac OS X 10.5 (Leopard).

> Fixed high frequency crash involving text input.

> Fixed beeping when the escape key is pressed and UNICODE translation is enabled.

> Improved trackpad scrolling support.

> Fixed joystick hat reporting for certain joysticks.

## SDL 1.2.12 Release Notes

SDL 1.2.12 is a minor bug fix release.

### General Notes

> Added support for the PulseAudio sound server: http://www.pulseaudio.org/

> Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11.

> Fixed buffer overrun crash when resampling audio rates.

> Fixed audio bug where converting to mono was doubling the volume.

> Fixed off-by-one error in the C implementation of SDL_revcpy()

> Fixed compiling with Sun Studio.

> Support for AmigaOS has been removed from the main SDL code.

> Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code.

> Unofficial support for the S60/SymbianOS platform has been added.

> Unofficial support for the Nintendo DS platform has been added.

> Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only).

### Unix Notes

> Fixed detection of X11 DGA mouse support.

> Improved XIM support for asian character sets.

> The GFX_Display has been added to the X11 window information in SDL_syswm.h.

> Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels.

> Fixed hang or crash at startup if aRts can't access the hardware.

> Fixed relative mouse mode when the cursor starts outside the X11 window.

> Fixed accidental free of stack memory in X11 mouse acceleration code.

> Closed minor memory leak in XME code.

> Fixed TEXTRELs in the library to resolve some PIC issues.

### Windows Notes

> The GDI video driver makes better use of the palette in 8-bit modes.

> The windib driver now supports more mouse buttons with WM_XBUTTON events.

> On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed.

> Added support for UTF-8 window titles on Windows.

> Fixed joystick detection on Windows.

> Improved performance with Win32 file I/O.

> Fixed HBITMAP leak in GAPI driver.

### Mac OS X Notes

> Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X.

> Fixed YUV overlay crash inside Quicktime on Intel Mac OS X.

> Fixed blitting alignment in Altivec alpha blit functions.

> Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X.

> Fixed joystick calibration code on Mac OS X.

> Fixed mouse jitter when multiple motion events are queued up in Mac OS X.

> Fixed changing the cursor in fullscreen mode on Mac OS X.

### Mac OS Classic Notes

> Added support for gamma ramps to both toolbox and DrawSprocket video drivers.

### BeOS Notes

> Implemented mouse grabbing and mouse relative mode on BeOS.

## SDL 1.2.11 Release Notes

SDL 1.2.11 is a minor bug fix release.

### Unix Notes

> Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX.

> Fixed building SDL with Xinerama disabled.

> Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen().

> Added pkgconfig configuration support.

### Windows Notes

> Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL.

> The Win32 window positioning code works properly for windows with menus.

> DirectSound audio quality has been improved on certain sound cards.

> Fixed 5.1 audio channel ordering on Windows and Mac OS X.

> Plugged a couple of minor memory leaks in the windib video driver.

> Fixed type collision with stdint.h when building with gcc on Win32.

> Fixed building with the Digital Mars Compiler on Win32.

### Mac OS X Notes

> The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above.

## SDL 1.2.10 Release Notes

SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes.

### API enhancements

- If SDL_OpenAudio() is passed zero for the desired format fields, the following environment variables will be used to fill them in:

      		SDL_AUDIO_FREQUENCY
      		SDL_AUDIO_FORMAT
      		SDL_AUDIO_CHANNELS
      		SDL_AUDIO_SAMPLES

  If an environment variable is not specified, it will be set to a reasonable default value.
- SDL_SetVideoMode() now accepts 0 for width or height and will use the current video mode (or the desktop mode if no mode has been set.)
- Added current_w and current_h to the SDL_VideoInfo structure, which is set to the desktop resolution during video intialization, and then set to the current resolution when a video mode is set.
- SDL_GL_LoadLibrary() will load the system default OpenGL library if it is passed NULL as a parameter.
- Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
- Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
- SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms.
- Added SDL_GetKeyRepeat() to query the key repeat settings.
- Added the "dummy" audio driver, which can be used to emulate audio output without a sound card.
- Added SDL_config.h, with defaults for various build environments.

### General Notes

> The SDL website now has an RSS feed!

> The SDL development source code is now managed with Subversion.

> SDL now uses the Bugzilla bug tracking system, hosted by icculus.org.

> SDL is licensed under version 2.1 of the GNU Lesser General Public License.

> The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform.

> SDL_opengl.h has been updated with the latest glext.h from http://oss.sgi.com/projects/ogl-sample/registry/

> Alex Volkov contributed highly optimized RGB <-> RGBA blitters.

### Unix Notes

> The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed.

> The XiG XME extension code is now included in the X11 video driver by default.

> XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1.

> Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0.

> XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file.

> SDL windows are no longer transparent in X11 compositing systems like XGL.

> The mouse is properly released by the X11 video driver if the fullscreen window loses focus.

> The X11 input driver now uses XIM to handle international input.

> The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3.

> Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver.

> The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images.

> The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling.

> The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back.

> The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings.

> The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse.

> The SVGAlib video driver now has support for banked (non-linear) video modes.

> A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details.

> Many patches have been incorporated from *BSD ports.

### Windows Notes

> The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx".

> SDL has been ported to 64-bit Windows.

> Dmitry Yakimov contributed a GAPI video driver for Windows CE.

> The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3.

> Dialog boxes are now shown when SDL is in windowed OpenGL mode.

> The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes.

> An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored.

> Window positions are retained when switching between fullscreen and windowed modes.

> ToUnicode() is used, when available, for improved handling of international keyboard input.

> The PrtScrn is now treated normally with both key down and key up events.

> Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications.

> Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting.

> An MCI error when playing the last track on a CD-ROM has been fixed.

> OpenWatcom projects for building SDL have been provided by Marc Peter.

### Mac OS X Notes

> SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details.

> The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed.

> Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker.

> Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs.

### OS/2 Notes

> Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details.