Fortran 2023 interface bindings to SDL3

Greetings,

SDL3 (Simple DirectMedia Layer 3) is a cross-platform C library for building games and multimedia applications. The latest version 3 was released in 2025 and can be seen as stable now. In comparison with its predecessor SDL2, it is a major clean-up and redesign intended to make the API more consistent, with better support for modern platforms.

In 2018, I started working on my (hand-written) interface bindings to SDL2 to create 2D/3D graphics in Fortran. While not complete, the bindings cover the important parts of SDL2, SDL2_image, SDL2_mixer, and SDL2_ttf.

For SDL3, I’m aiming for a complete and auto-generated coverage of the API in Fortran 2023, called fortran-sdl3 (requires SDL ≥ 3.4). After > 37,000 SLOC it’s still far from finished, but already sufficiently completed for creating small games or graphics demos (some are provided in the repo). I’ve tested the bindings on FreeBSD 15 and Debian 13. Windows and macOS should be supported, too (albeit with different linker libraries).

Maybe, some of you find it useful.

Screen Shots

10 Likes

Useful is an understatement. Thanks for keeping up the great work you do, creating bindings for multimedia libraries (in addition to your other great projects). I plan to re-implement and migrate some older projects to SDL3, so your work here will come in more than handy!

1 Like

SDL is a great library, it shows how to create an API. Simple, easy to use from any language, complete and stable. SDL3 is their third iteration in almost 30 years (extremely impressive!). When I am designing a new API, I often consult how SDL does it and learn from them.

I have used SDL3 GPU API, and it’s amazing. GPU APIs are notoriously complex (Vulkan, DirectX, etc.), and the SDL3 GPU API is simple, yet completely usable.

I don’t know the authors at all, but they have done an A+ job.

1 Like