| 1 |
====================== |
| 2 |
sdl2-compat for Debian |
| 3 |
====================== |
| 4 |
|
| 5 |
sdl2-compat is a compatible reimplementation of the SDL 2 interface |
| 6 |
using SDL 3. It has now replaced "classic" SDL2, similar to what was |
| 7 |
previously done in other OS distributions like Arch and Fedora. |
| 8 |
|
| 9 |
sdl2-compat can be combined with sdl12-compat (the `libsdl1.2debian` |
| 10 |
package) to run SDL 1.2 games on SDL 3, but if possible please port those |
| 11 |
games to SDL 2 or SDL 3 instead. |
| 12 |
|
| 13 |
Installation and use |
| 14 |
==================== |
| 15 |
|
| 16 |
sdl2-compat has now taken over the libsdl2-2.0-0 package name from |
| 17 |
"classic" SDL 2 and will be installed by default as a dependency of |
| 18 |
SDL 2 games. |
| 19 |
|
| 20 |
Please do not depend on the transitional packages libsdl2-compat or |
| 21 |
libsdl2-compat-shim, which will be removed later. |
| 22 |
|
| 23 |
If a game exhibits regressions with sdl2-compat, it can be forced to |
| 24 |
use "classic" SDL 2 by installing the libsdl2-classic package, and then |
| 25 |
using a command like: |
| 26 |
|
| 27 |
$ SDL_DYNAMIC_API='/usr/$LIB/sdl2-classic/libSDL2-2.0.so.0' \ |
| 28 |
openarena |
| 29 |
|
| 30 |
If there are regressions with sdl2-compat which can be worked around by |
| 31 |
using "classic" SDL 2, please report that as a bug in the sdl2-compat |
| 32 |
source package: see "Testing and reporting bugs", below. |
| 33 |
|
| 34 |
Checking which SDL you are using |
| 35 |
-------------------------------- |
| 36 |
|
| 37 |
If the environment variable SDL2COMPAT_DEBUG_LOGGING is set to 1, |
| 38 |
like this: |
| 39 |
|
| 40 |
$ SDL2COMPAT_DEBUG_LOGGING=1 \ |
| 41 |
openarena |
| 42 |
|
| 43 |
or |
| 44 |
|
| 45 |
$ SDL2COMPAT_DEBUG_LOGGING=1 \ |
| 46 |
SDL_DYNAMIC_API='/usr/$LIB/sdl2-classic/libSDL2-2.0.so.0' \ |
| 47 |
openarena |
| 48 |
|
| 49 |
then you should see output like this for sdl2-compat: |
| 50 |
|
| 51 |
sdl2-compat 2.32.66, built on Apr 4 2026 at 15:21:29, talking to SDL3 3.4.4 |
| 52 |
sdl2-compat: This app appears to be named: ioquake3 |
| 53 |
SDL_DYNAMIC_API: Not overridden |
| 54 |
|
| 55 |
or like this for "classic" SDL 2: |
| 56 |
|
| 57 |
sdl2-compat 2.32.66, built on Apr 4 2026 at 15:21:29, talking to SDL3 3.4.4 |
| 58 |
sdl2-compat: This app appears to be named: ioquake3 |
| 59 |
SDL_DYNAMIC_API: Library replaced by SDL 2.32.10 (SDL-release-2.32.10-0-g5d2495703 (Debian 2.32.10+dfsg-6+b1)) |
| 60 |
|
| 61 |
Wayland |
| 62 |
======= |
| 63 |
|
| 64 |
On Wayland, some SDL 2 games don't work correctly with the native Wayland |
| 65 |
video driver, which became the default in SDL 3. |
| 66 |
|
| 67 |
Please report this to the game's developer or packager as a bug. If a game |
| 68 |
only supports X11 and does not support native Wayland, an easy way that a game |
| 69 |
developer can signal this to SDL is with code similar to this near the |
| 70 |
beginning of main(), before calling SDL_Init(): |
| 71 |
|
| 72 |
#ifdef SDL_VIDEO_DRIVER_X11 |
| 73 |
SDL_SetHintWithPriority(SDL_HINT_VIDEODRIVER, "x11", SDL_HINT_OVERRIDE); |
| 74 |
#endif |
| 75 |
|
| 76 |
As a workaround for this bug you can set environment variable |
| 77 |
SDL_VIDEODRIVER=x11, which forces all SDL 2 games to use X11 (possibly |
| 78 |
via Xwayland). |
| 79 |
|
| 80 |
sdl2-compat has a table of "quirks" for games and apps that cannot |
| 81 |
easily be fixed, which can be applied automatically based on the name of |
| 82 |
the executable. One of the most common quirks is to do the equivalent of |
| 83 |
`SDL_VIDEODRIVER=x11` automatically. |
| 84 |
If a game that cannot easily be fixed (for example a proprietary game) |
| 85 |
needs this workaround, please report this as a bug in sdl2-compat: |
| 86 |
|
| 87 |
* upstream: https://github.com/libsdl-org/sdl2-compat/issues/new |
| 88 |
* and/or in Debian: as bugs in `src:sdl2-compat` |
| 89 |
|
| 90 |
so that the game can be added to the table of quirks. |
| 91 |
|
| 92 |
Testing and reporting bugs |
| 93 |
========================== |
| 94 |
|
| 95 |
Please report bugs for any regressions when compared with "classic" SDL2: |
| 96 |
|
| 97 |
* upstream: https://github.com/libsdl-org/sdl2-compat/issues/new |
| 98 |
* and/or in Debian: as bugs in `src:sdl2-compat`, or as bugs in the game |
| 99 |
with an "affects" on `src:sdl2-compat` if it appears to be a game bug |
| 100 |
|
| 101 |
Please provide details of the game version, the sdl2-compat version, |
| 102 |
and the SDL3 version. SDL2COMPAT_DEBUG_LOGGING=1 will tell you everything |
| 103 |
except the game version. |
| 104 |
|
| 105 |
If you are using a Wayland environment, please specify which one. |
| 106 |
"Wayland" is not enough information: we'll need something more like |
| 107 |
"GNOME Shell 48.4" or "sway 1.11". |
| 108 |
|
| 109 |
If a game doesn't work in native Wayland, please try it with |
| 110 |
`SDL_VIDEODRIVER=x11` as a workaround, and mention in your bug report |
| 111 |
whether that workaround helped or not. |
| 112 |
|
| 113 |
There will often be a newer version of SDL3 and/or sdl2-compat available |
| 114 |
in experimental, which might have additional bug fixes. If you can, |
| 115 |
trying that version is also helpful. Versions in experimental are often |
| 116 |
upstream snapshots that have only been lightly tested, so there might be |
| 117 |
regressions - please report those too! |
| 118 |
|
| 119 |
See `HOW_TO_TEST_GAMES.md` in the source package for more details. |
| 120 |
|
| 121 |
Compiling games |
| 122 |
=============== |
| 123 |
|
| 124 |
sdl2-compat has now taken over the libsdl2-dev package name from |
| 125 |
"classic" SDL 2 and will be installed by default as a build-dependency of |
| 126 |
SDL 2 games. |
| 127 |
|
| 128 |
Please do not build-depend on the transitional package libsdl2-compat-dev, |
| 129 |
which will be removed later. |