Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. D
  3. SDL 2

SDL 2

BSL-1.0Dv1.4.2

Static and dynamic D language bindings for SDL3 and its official extension libraries, compatible with BetterC, @nogc, and nothrow.

Visit WebsiteGitHubGitHub
129 stars29 forks0 contributors

What is SDL 2?

BindBC-SDL is a set of bindings that allow the D programming language to interface with SDL3 (Simple DirectMedia Layer) and its official extension libraries. It provides both static and dynamic linking options, enabling developers to create cross-platform multimedia applications such as games, media players, and interactive simulations. The bindings solve the problem of accessing SDL's C API from D with minimal overhead and maximum compatibility.

Target Audience

D programmers developing multimedia applications, especially game developers and creators of real-time interactive software who need direct access to SDL's graphics, audio, and input APIs.

Value Proposition

Developers choose BindBC-SDL because it offers a direct, low-overhead binding to SDL3 with full support for D's advanced features like BetterC, @nogc, and nothrow, enabling high-performance, memory-safe applications while maintaining compatibility with existing SDL documentation and tutorials.

Overview

Static & dynamic D bindings to SDL and the SDL_* libraries, compatible with BetterC, @nogc, and nothrow. (Mirror)

Use Cases

Best For

  • Creating 2D games in D with SDL's rendering and input APIs
  • Building multimedia applications that require audio playback via SDL_mixer
  • Developing cross-platform graphical tools with SDL's windowing and event system
  • Writing performance-critical software that must compile without the D runtime (BetterC)
  • Integrating SDL_image for image loading and manipulation in D projects
  • Prototyping game engines or frameworks that need low-level graphics and input handling

Not Ideal For

  • Projects requiring SDL2 instead of SDL3, as it's a separate branch with potential maintenance differences
  • Teams preferring high-level game engines with built-in asset pipelines and UI toolkits
  • Developers unfamiliar with C interop or D's advanced features like BetterC and @nogc
  • Rapid prototyping where quick setup and minimal configuration are prioritized over low-level control

Pros & Cons

Pros

Direct C API Mapping

Provides a direct mapping to SDL3's C API, enabling seamless adaptation of existing SDL documentation and tutorials with minimal code changes, as highlighted in the README's reliance on official SDL resources.

Flexible Linking Options

Offers both static and dynamic bindings, allowing developers to choose based on deployment needs—static for minimal footprint or dynamic for runtime library loading—with configurations like staticBC for BetterC compatibility.

D Language Ergonomics

Includes D-style PascalCase.camelCase enums and struct fields alongside C-style variants, improving code readability and integration with D idioms, as configurable via version identifiers like SDL_D_Enums_Only.

Cross-Platform Support

Extends beyond common platforms to include special targets like Nintendo 3DS and Sony Vita via custom version identifiers, broadening the reach of D applications without custom bindings.

Memory and Exception Safety

Designed with @nogc and nothrow compatibility, making it suitable for real-time applications where garbage collection and exceptions are undesirable, as emphasized in the README's philosophy.

Cons

Complex Dynamic Loading

Dynamic bindings require manual library loading, error handling with BindBC-Loader, and version checks, adding boilerplate code and runtime failure points if not meticulously implemented.

Unstable Extension Libraries

Satellite libraries like SDL_mixer and SDL_net are based on pre-release commits, with the README noting that their APIs and version identifiers may change, leading to potential breaking changes and compatibility headaches.

Intricate Entry Point Setup

The entry point system using makeSDLMain is opt-in but complex, especially when integrating with DRuntime—the README warns it's not advised for inexperienced programmers and requires careful exception handling.

Manual Configuration Overhead

Requires explicit management of version identifiers, library names, and subConfigurations in dub files, which can be error-prone and tedious for projects using multiple SDL extensions or targeting specific versions.

Frequently Asked Questions

Quick Stats

Stars129
Forks29
Contributors0
Open Issues2
Last commit1 day ago
CreatedSince 2018

Tags

#sdl3#d-language#static-linking#dlang#game-development#dynamic-linking#cross-platform#sdl-mixer#graphics-programming#sdl-ttf#multimedia

Built With

D
D

Links & Resources

Website

Included in

D748
Auto-fetched 1 day ago

Related Projects

Godot-DGodot-D

D language bindings for the Godot Engine's GDNative API

Stars212
Forks21
Last commit2 years ago
BindBCBindBC

Bindings compatible with -betterC and @nogc, using bindbc-loader

Stars0
Forks0
Last commit
DerelictOrgDerelictOrg

A GitHub organization hosting all Derelict bindings including OpenGL and other multimedia/game related library bindings. (OpenGL 3, Bgfx, ENet, SDL 2, GLFW 3,OpenGLES, Free Image, Assimp3, libtheora, libogg, libvorbis, SFML 2, libpq, PhysicsFS, Open Dynamics Engine, Lua, DevIL, OpenAL, ALURE)

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub