$ show libsdl-org/sdl2-compat
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.
The LLM identified 1 files worth highlighting for reuse:
A self-contained Python script that orchestrates the entire release process for SDL-compatible libraries. It supports generating source archives (zip, tgz, txz), building for MSVC, MinGW, Android (AAR), and macOS DMGs. Uses dry-run, fast mode, and GitHub Actions output. The script is designed to be shared across multiple SDL projects (SDL2, SDL3, SDL_image, etc.) and is not specialized to this repository. It contains reusable abstractions: Executer (dry-run-aware subprocess wrapper), SectionPrinter (CI log grouping), Archiver (multi-format archive creation with symlink handling), ArchiveFileTree (file mapping with template variable substitution), SourceCollector (git archive + file timestamp extraction), and Releaser (orchestrator). This is a high-quality, extensible release automation pattern that could be extracted and adapted for other projects with minimal modification.