SDL3-CS
3.4.10.1
See the version list below for details.
dotnet add package SDL3-CS --version 3.4.10.1
NuGet\Install-Package SDL3-CS -Version 3.4.10.1
<PackageReference Include="SDL3-CS" Version="3.4.10.1" />
<PackageVersion Include="SDL3-CS" Version="3.4.10.1" />
<PackageReference Include="SDL3-CS" />
paket add SDL3-CS --version 3.4.10.1
#r "nuget: SDL3-CS, 3.4.10.1"
#:package SDL3-CS@3.4.10.1
#addin nuget:?package=SDL3-CS&version=3.4.10.1
#tool nuget:?package=SDL3-CS&version=3.4.10.1
SDL3-CS
Modern C# bindings for SDL3 and its companion libraries.
SDL3-CS gives .NET applications direct access to SDL3 APIs and pairs the managed wrapper with platform-specific native runtime packages for Windows, Linux, macOS, Android, iOS, and tvOS.
🚀 About
The project provides:
- managed C# bindings for SDL3, SDL_image, SDL_ttf, SDL_mixer, and SDL_shadercross;
- platform-specific native NuGet packages named
SDL3-CS.{Platform}andSDL3-CS.{Platform}.{Addon}; - Android SDLActivity bridge bindings for managed Android applications;
- examples and release checks that validate package layout and wrapper metadata.
Use SDL3-CS when you want low-level SDL3 access from modern .NET while keeping native runtime deployment predictable across supported platforms.
🔢 Versioning and Native Compatibility
SDL3-CS package versions follow the native SDL component versions. The first three version segments identify the upstream native component version. The final segment is the SDL3-CS package revision.
| Component | Package pattern | Native target | Package line |
|---|---|---|---|
| SDL3 managed bindings | SDL3-CS |
SDL 3.4.10 |
3.4.10.x |
| SDL3 native runtime | SDL3-CS.{Platform} |
SDL 3.4.10 |
3.4.10.x |
| SDL_image native runtime | SDL3-CS.{Platform}.Image |
SDL_image 3.4.4 |
3.4.4.x |
| SDL_ttf native runtime | SDL3-CS.{Platform}.TTF |
SDL_ttf 3.2.2 |
3.2.2.x |
| SDL_mixer native runtime | SDL3-CS.{Platform}.Mixer |
SDL_mixer 3.2.4 |
3.2.4.x |
| SDL_shadercross native runtime | SDL3-CS.{Platform}.Shadercross |
SDL_shadercross 3.0.0 |
3.0.0.x |
{Platform} is one of Windows, Linux, MacOS, Android, iOS, or tvOS.
Published NuGet packages can lag behind a release branch while native packages are being assembled. The NuGet package page is authoritative for what is currently published.
📚 Documentation
Project documentation is intended to live in the SDL3-CS Wiki. If the wiki link redirects to the repository home page, use VERSIONS.md, the examples, and the release documentation in the repository until the wiki content is published.
For upstream SDL API documentation, see the official SDL3 Wiki.
🧭 Supported Platforms
The managed SDL3-CS wrapper targets .NET 7, .NET 8, .NET 9, and .NET 10.
Official native package families are built for the following release targets:
| Platform family | Package suffix | Supported RIDs / ABIs |
|---|---|---|
| Windows | Windows |
win-x86, win-x64, win-arm64 |
| Linux | Linux |
linux-x64, linux-arm64 |
| macOS | MacOS |
osx-x64, osx-arm64 |
| Android | Android |
android-arm, android-arm64, android-x86, android-x64 |
| iOS | iOS |
ios-arm64, iossimulator-arm64, iossimulator-x64 |
| tvOS | tvOS |
tvos-arm64, tvossimulator-arm64, tvossimulator-x64 |
Other platforms can use the managed bindings if the application supplies compatible SDL native libraries manually.
📝 Installation
Install the managed bindings:
dotnet add package SDL3-CS
Add the native package for your target platform:
dotnet add package SDL3-CS.Windows
Replace Windows with Linux, MacOS, Android, iOS, or tvOS.
Optional SDL companion libraries use the same platform suffix:
dotnet add package SDL3-CS.Windows.Image
dotnet add package SDL3-CS.Windows.TTF
dotnet add package SDL3-CS.Windows.Mixer
dotnet add package SDL3-CS.Windows.Shadercross
Android applications should reference SDL3-CS.Android and use MainActivity : Org.Libsdl.App.SDLActivity with a managed Main() override. The Android package includes the SDL Java bridge bindings and ABI-specific libSDL3.so files.
🎓 Example
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, 255);
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 in SDL3-CS.Examples.
🤝 Feedback and Contributions
Found a bug or have an idea? Open an issue or start a discussion.
Please follow the Code of Conduct in all project interactions.
You can contact the maintainer at eduardgushchin@yandex.ru or join the Telegram chat for questions and feedback.
📃 License
SDL3 and SDL3# are released under the zlib license. See LICENSE for details.
| Product | Versions 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. |
-
net10.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (13)
Showing the top 5 NuGet packages that depend on SDL3-CS:
| Package | Downloads |
|---|---|
|
3DEngine
3D Game Engine - Vulkan - SDL3 - .NET 10 - C# 14 |
|
|
Bliss
A fast, Cross-platform .NET 10 C# 14 Render Framework. |
|
|
StreamLayout
Package Description |
|
|
SdlVulkan.Renderer
Package Description |
|
|
Brine2D.Audio.SDL
SDL3_mixer audio implementation for Brine2D. Provides sound effects and music playback via SDL3_mixer. |
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 | 3,045 | 2/13/2026 |
| 3.5.0-preview.20260205-181613 | 101 | 2/5/2026 |
| 3.5.0-preview.20260205-180437 | 116 | 2/5/2026 |
| 3.5.0-preview.20260205-174352 | 107 | 2/5/2026 |
| 3.5.0-preview.20260112-122507 | 259 | 1/12/2026 |
| 3.4.10.1 | 0 | 6/13/2026 |
| 3.4.2 | 5,101 | 3/17/2026 |
| 3.3.7 | 6,924 | 1/12/2026 |
| 3.3.7-preview.20251222-111333 | 199 | 12/22/2025 |
| 3.3.6 | 2,066 | 12/22/2025 |
| 3.3.5-preview.20251213-114652 | 234 | 12/13/2025 |
| 3.3.5-preview.20251212-135925 | 127 | 12/12/2025 |
| 3.3.5-preview.20251212-134941 | 116 | 12/12/2025 |
| 3.3.3 | 783 | 12/12/2025 |
| 3.3.3-preview.20251204-144801 | 208 | 12/4/2025 |
| 3.3.3-preview.20251108-095121 | 193 | 11/8/2025 |
| 3.3.2.1 | 7,415 | 10/27/2025 |
| 3.3.2 | 397 | 10/26/2025 |
| 3.2.24.1 | 1,413 | 10/17/2025 |
| 3.2.24 | 894 | 10/5/2025 |