sdl2-compat
brew install sdl2-compat
v2.32.70
Zlib
C shared library providing SDL2-compatible API and ABI while using SDL3 backend.
Why you might care
Drop-in replacement for SDL2 in existing binaries and source builds, letting old SDL2 code run on SDL3 without modification. Useful for maintaining legacy game/multimedia projects without rewriting against SDL3 directly. Requires SDL3 at runtime.
13.7k
30-day installs · #299
13.7k
90-day · #684
13.7k
365-day · #1272
199
★ GitHub stars · updated 2d ago
Runtime dependencies
Build dependencies
Links
- https://github.com/libsdl-org/sdl2-compat
- GitHub: libsdl-org/sdl2-compat
- Brew formula source: Formula/s/sdl2-compat.rb
Blurb generated by claude-haiku-4-5 on today.
Raw metadata
{
"aliases": [
"sdl2"
],
"alternatives": [
"SDL2",
"SDL3",
"SFML"
],
"build_dependencies": [
"cmake"
],
"categories": [
"library",
"binding"
],
"caveats": null,
"conflicts_with": [],
"dependencies": [
"sdl3"
],
"deprecated": 0,
"deprecation_reason": null,
"desc": "SDL2 compatibility layer that uses SDL3 behind the scenes",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:40:47+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "sdl2-compat",
"github_default_branch": "main",
"github_last_commit_at": "2026-06-18T14:07:58Z",
"github_readme_excerpt": "# Simple DirectMedia Layer (SDL) sdl2-compat\n\nhttps://www.libsdl.org/\n\nThis is the Simple DirectMedia Layer, a general API that provides low\nlevel access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,\nand 2D framebuffer across multiple platforms.\n\nThis code is a compatibility layer; it provides a binary and source\ncompatible API for programs written against SDL2, but it uses SDL3\nbehind the scenes. If you are writing new code, please target SDL3\ndirectly and do not use this layer.\n\nIf you absolutely must have the real SDL2 (\"SDL 2 Classic\"), please use\nthe `SDL2` branch at https://github.com/libsdl-org/SDL, which occasionally\ngets bug fixes (and eventually, no new formal releases). But we strongly\nencourage you not to do that.\n\n# How to use:\n\n- Build the library. This will need access to SDL3\u0027s headers,\n[CMake](https://cmake.org/) and the build tools of your choice. Once built, you\nwill have a drop-in replacement that can be used with any existing binary\nthat relies on SDL2. You can copy this library over the existing SDL2 build,\nor force it to take priority over a system copy with LD_LIBRARY_PATH, etc.\nAt runtime, sdl2-compat needs to be able to find a copy of SDL3, so plan to\ninclude it with the library if necessary.\n\n- If you want to build an SDL2 program from source code, we have included\ncompatibility headers, so that sdl2-compat can completely replace SDL2\nat all points. Note that sdl2-compat itself does not use these headers,\nso if you just want the library, you don\u0027t need them.\n\n# Building the library:\n\nThese are quick-start instructions; there isn\u0027t anything out of the ordinary\nhere if you\u0027re used to using CMake. \n\nYou\u0027ll need to use CMake to build sdl2-compat. Download at\n[cmake.org](https://cmake.org/) or install from your package manager\n(`sudo apt-get install cmake` on Ubuntu, etc).\n\nPlease refer to the [CMake documentation](https://cmake.org/documentation/)\nfor complete details, as platform and build tool details vary.\n\nYou\u0027ll need a copy",
"github_repo": "libsdl-org/sdl2-compat",
"github_stars": 199,
"github_topics": [],
"homepage": "https://github.com/libsdl-org/sdl2-compat",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 13661,
"installs_365d": 13673,
"installs_90d": 13679,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "Zlib",
"llm_generated_at": "2026-06-20T23:44:00+00:00",
"llm_model": "claude-haiku-4-5",
"name": "sdl2-compat",
"oldnames": [],
"one_liner": "C shared library providing SDL2-compatible API and ABI while using SDL3 backend.",
"optional_dependencies": [],
"rank_30d": 299,
"rank_365d": 1272,
"rank_90d": 684,
"raw_hash": "ebad28bd0a2c7585",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/s/sdl2-compat.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "2.32.70",
"versioned_formulae": [],
"why_use_this": "Drop-in replacement for SDL2 in existing binaries and source builds, letting old SDL2 code run on SDL3 without modification. Useful for maintaining legacy game/multimedia projects without rewriting against SDL3 directly. Requires SDL3 at runtime."
}