$ account libsdl-org
This repository implements a binary- and source-compatible compatibility layer for SDL2 on top of SDL3. It provides the complete SDL2 public headers (under include/SDL2/) and a shared library that intercepts all SDL2 API calls and translates them to the corresponding SDL3 functions. The core implementation resides in src/sdl2_compat.c and src/sdl2_compat.h, which perform type mapping, event conversion, and function dispatch. A sophisticated dynamic API mechanism in src/dynapi/ allows runtime overriding of exported symbols. The project also includes an extensive test suite (under test/) covering every major SDL2 subsystem, a reusable test framework (src/test/), and a comprehensive release automation script (build-scripts/build-release.py). The build system supports CMake, legacy Makefiles, Android NDK, and MSVC across Linux, Windows, macOS, and more. This is a library—not an end-user application—meant to ease the transition from SDL2 to SDL3 without modifying existing SDL2-based programs.