SDL3-CS C# Bindings

repository·master·Indexed 41 days ago

https://github.com/ppy/sdl3-cs

High-performance C# bindings for the SDL3 library family, including SDL_image, SDL_ttf, and SDL_mixer. Designed for .NET developers to leverage cross-platform multimedia capabilities across Windows, macOS, Linux, iOS, and Android.

Tokens
804
Snippets
3
Records
5
Agent score
2%

What's inside SDL3-CS

  1. Supported platforms for SDL3-CS bindings

    master

    The bindings support a wide range of platforms including Windows (x64, x86, arm64), macOS (arm64, x64), Linux (x64, x86, arm64, arm), iOS, and Android.

    Note: SDL3_mixer-CS requires API 24+ on Android.

  2. How to update SDL bindings

    master

    If you are maintaining the bindings and need to update them to a new upstream SDL version, follow these steps:

    1. Initialize submodules: git submodule update --init --recursive
    2. Check out the desired upstream commits in the submodules.
    3. Regenerate the C# bindings using Docker:
      • Build the generator image: docker build -t 'sdl-gen' .
      • Run the generator: docker run --rm -v .:/app -w /app -it sdl-gen
    4. Trigger the Build Native (.github/workflows/build.yml) GitHub workflow to generate the platform-specific binaries.
    git submodule update --init --recursive
    
    docker build -t 'sdl-gen' .
    docker run --rm -v .:/app -w /app -it sdl-gen
  3. Install SDL3-CS and related bindings via NuGet

    master

    SDL3-CS provides C# bindings for the SDL3 family of libraries. You can install the core SDL bindings or specific extension libraries using the dotnet add package command.

    Available packages:

    • Core SDL: ppy.SDL3-CS
    • SDL_image: ppy.SDL3_image-CS
    • SDL_ttf: ppy.SDL3_ttf-CS
    • SDL_mixer: ppy.SDL3_mixer-CS
    dotnet add package ppy.SDL3-CS
    dotnet add package ppy.SDL3_image-CS
    dotnet add package ppy.SDL3_ttf-CS
    dotnet add package ppy.SDL3_mixer-CS
  4. Install SDL3-CS bindings via NuGet

    master

    SDL3-CS provides C# bindings for the SDL3 family of libraries. You can install the specific bindings you need using the dotnet add package command.

    Depending on which SDL3 component you are using, install the corresponding package:

    • SDL: Core SDL3 functionality.
    • SDL_image: Image loading support.
    • SDL_ttf: TrueType font support.
    • SDL_mixer: Audio mixing support.
    dotnet add package ppy.SDL3-CS
    dotnet add package ppy.SDL3_image-CS
    dotnet add package ppy.SDL3_ttf-CS
    dotnet add package ppy.SDL3_mixer-CS
  5. Check platform support for SDL3-CS bindings

    master

    The SDL3-CS bindings support a wide range of platforms. Most packages support all listed architectures, while SDL3_mixer-CS has a specific requirement for Android.

    Productwin-x64win-x86win-arm64osx-arm64osx-x64linux-x64linux-x86linux-arm64linux-armiosandroid
    SDL3-CS✓✓✓✓✓✓✓✓✓✓✓
    SDL3_image-CS✓✓✓✓✓✓✓✓✓✓✓
    SDL3_ttf-CS✓✓✓✓✓✓✓✓✓✓✓
    SDL3_mixer-CS✓✓✓✓✓✓✓✓✓✓API 24+