SDL3-CS 3.4.2

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package SDL3-CS --version 3.4.2
                    
NuGet\Install-Package SDL3-CS -Version 3.4.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SDL3-CS" Version="3.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SDL3-CS" Version="3.4.2" />
                    
Directory.Packages.props
<PackageReference Include="SDL3-CS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SDL3-CS --version 3.4.2
                    
#r "nuget: SDL3-CS, 3.4.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SDL3-CS@3.4.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SDL3-CS&version=3.4.2
                    
Install as a Cake Addin
#tool nuget:?package=SDL3-CS&version=3.4.2
                    
Install as a Cake Tool

🚀 About

This is SDL3#, a C# wrapper for SDL3.

🔢 Version Compatibility

SDL3-CS Version SDL3 Version Minimum glibc (Linux) Notes
3.4.2.x 3.4.2 2.28 (Ubuntu 18.04+) Current stable
3.4.0.x 3.4.0 2.28 (Ubuntu 18.04+) Previous stable

Note: The version numbering scheme follows SDL3's versioning. For example, SDL3-CS version 3.4.2.x is designed for SDL3 version 3.4.2.

Building Native Libraries on Linux

If you're building native libraries in a custom environment (e.g., Docker, Steam Runtime SDK), ensure you're building against SDL3 version 3.4.2. The native packages (SDL3-CS.Native*) contain pre-built binaries for common platforms, but custom builds should match this version.

For more detailed version information, see VERSIONS.md.

📚 Documentation

For more information about SDL3, visit the SDL wiki.

📝 Installation

git clone https://github.com/edwardgushchin/SDL3-CS
cd SDL3-CS
dotnet build -c Release

or

dotnet add package SDL3-CS

Optional:

dotnet add package SDL3-CS.Native
dotnet add package SDL3-CS.Native.Image
dotnet add package SDL3-CS.Native.TTF
dotnet add package SDL3-CS.Native.Mixer

🎓 Examples

using SDL3;

namespace Create_Window;

internal static class Program
{
    [STAThread]
    private static void Main()
    {
        if (!SDL.Init(SDL.InitFlags.Video))
        {
            SDL.LogError(SDL.LogCategory.System, $"SDL could not initialize: {SDL.GetError()}");
            return;
        }

        if (!SDL.CreateWindowAndRenderer("SDL3 Create Window", 800, 600, 0, out var window, out var renderer))
        {
            SDL.LogError(SDL.LogCategory.Application, $"Error creating window and rendering: {SDL.GetError()}");
            return;
        }

        SDL.SetRenderDrawColor(renderer, 100, 149, 237, 0);

        var loop = true;

        while (loop)
        {

            while (SDL.PollEvent(out var e))
            {
                if ((SDL.EventType)e.Type == SDL.EventType.Quit)
                {
                    loop = false;
                }
            }

            SDL.RenderClear(renderer);
            SDL.RenderPresent(renderer);
        }

        SDL.DestroyRenderer(renderer);
        SDL.DestroyWindow(window);

        SDL.Quit();
    }
}

More examples can be found here.

✅ Readiness

Library Stage
SDL3 Ready
SDL_image Ready
SDL_mixer Ready
SDL_tff Ready
SDL_shadercross Ready

🤝 Feedback and Contributions

Do you have an idea or found a bug? Please open an issue or start a discussion.

Please note we have a code of conduct, please follow it in all your interactions with the project.

If you have any feedback, please reach out to us at eduardgushchin@yandex.ru.

We also have a chat in Telegram, where I am ready to answer any of your questions.

💻 Authors

See also the list of contributors who participated in this project.

📃 License

SDL3 and SDL3# are released under the zlib license. See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (11)

Showing the top 5 NuGet packages that depend on SDL3-CS:

Package Downloads
3DEngine

3D Game Engine - Vulkan - SDL3 - .NET 10 - C# 14

StreamLayout

Package Description

Brine2D.Audio.SDL

SDL3_mixer audio implementation for Brine2D. Provides sound effects and music playback via SDL3_mixer.

Brine2D.Rendering.SDL

SDL3 rendering implementation for Brine2D. Includes GPU renderer (alpha) and legacy renderer with texture loading, shader support, and TTF text rendering.

SdlVulkan.Renderer

Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on SDL3-CS:

Repository Stars
Valkirie/HandheldCompanion
ControllerService
Version Downloads Last Updated
3.5.0-preview.20260213-150035 833 2/13/2026
3.5.0-preview.20260205-181613 71 2/5/2026
3.5.0-preview.20260205-180437 67 2/5/2026
3.5.0-preview.20260205-174352 77 2/5/2026
3.5.0-preview.20260112-122507 224 1/12/2026
3.4.2 1,143 3/17/2026
3.3.7 6,810 1/12/2026
3.3.7-preview.20251222-111333 178 12/22/2025
3.3.6 2,004 12/22/2025
3.3.5-preview.20251213-114652 217 12/13/2025
3.3.5-preview.20251212-135925 111 12/12/2025
3.3.5-preview.20251212-134941 96 12/12/2025
3.3.3 758 12/12/2025
3.3.3-preview.20251204-144801 190 12/4/2025
3.3.3-preview.20251108-095121 175 11/8/2025
3.3.2.1 7,344 10/27/2025
3.3.2 371 10/26/2025
3.2.24.1 1,279 10/17/2025
3.2.24 854 10/5/2025
3.2.20 3,917 8/5/2025
Loading failed