SDL3-CS 3.3.2.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package SDL3-CS --version 3.3.2.1
                    
NuGet\Install-Package SDL3-CS -Version 3.3.2.1
                    
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.3.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SDL3-CS" Version="3.3.2.1" />
                    
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.3.2.1
                    
#r "nuget: SDL3-CS, 3.3.2.1"
                    
#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.3.2.1
                    
#: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.3.2.1
                    
Install as a Cake Addin
#tool nuget:?package=SDL3-CS&version=3.3.2.1
                    
Install as a Cake Tool

🚀 About

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

📚 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 was computed.  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.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

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.3.3-preview.20251108-095121 92 11/8/2025
3.3.2.1 3,418 10/27/2025
3.3.2 324 10/26/2025
3.2.24.1 1,230 10/17/2025
3.2.24 786 10/5/2025
3.2.20 2,583 8/5/2025
3.2.18 639 7/15/2025
3.2.16.7 249 7/10/2025
3.2.16.6 200 7/8/2025
3.2.16.5 173 7/8/2025
3.2.16.4 260 7/1/2025
3.2.16.3 289 6/20/2025
3.2.16.1 528 6/8/2025
3.2.16 208 6/7/2025
3.2.14.2 777 5/21/2025
3.2.14.1 216 5/19/2025
3.2.14 247 5/16/2025
3.2.12.4 273 5/14/2025
3.2.12.3 199 5/11/2025
3.2.12.2 157 5/9/2025
3.2.12.1 590 5/8/2025
3.2.12 191 5/8/2025
3.2.10 727 4/1/2025
3.2.8.3 334 3/12/2025
3.2.8.2 477 3/11/2025
3.2.8.1 286 3/7/2025
3.2.4.7 375 3/1/2025
3.2.4.6 519 2/18/2025

This is a preview of the upcoming 3.4 release!

           The API and ABI are still in progress, but we wanted to get this out so everyone can try out the new features and provide feedback.

           Please report any issues on GitHub:
           https://github.com/libsdl-org/SDL/issues

           Here are the highlights of this preview release:

           - Added SDL_CreateAnimatedCursor() to create animated color cursors
           - Added SDL_SetWindowProgressState(), SDL_SetWindowProgressValue(), SDL_GetWindowProgressState(), and SDL_GetWindowProgressValue() to show progress in the window's taskbar icon on Windows and Linux
           - Added SDL_GetGPUDeviceProperties() to get the properties of an SDL GPU device
           - Added SDL_GetPixelFormatFromGPUTextureFormat() and SDL_GetGPUTextureFormatFromPixelFormat()
           - Added SDL_CreateGPURenderer() and SDL_GetGPURendererDevice() to create a 2D renderer for use with GPU rendering.
           - Added SDL_CreateGPURenderState(), SDL_SetGPURenderStateFragmentUniforms(), SDL_SetGPURenderState(), and SDL_DestroyGPURenderState() to use fragment shaders with a GPU 2D renderer
           - Added support for YUV textures and HDR colorspaces to the GPU 2D renderer
           - Added support for textures with palettes, and SDL_GetTexturePalette() and SDL_SetTexturePalette() to interact with them
           - Added SDL_RenderTexture9GridTiled() to do tiled instead of stretched 9-grid texture rendering
           - Added SDL_GetDefaultTextureScaleMode() and SDL_SetDefaultTextureScaleMode() to set the texture scale mode for new textures
           - Added SDL_GetRenderTextureAddressMode() and SDL_SetRenderTextureAddressMode() to change the texture addressing mode
           - Added SDL_TEXTURE_ADDRESS_WRAP to allow wrapping of textures if the renderer has SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN set
           - Added SDL_LoadPNG(), SDL_LoadPNG_IO(), SDL_SavePNG(), and SDL_SavePNG_IO() to load and save PNG images
           - Added SDL_RotateSurface() to create a rotated copy of a surface
           - Added SDL_PutAudioStreamDataNoCopy() to do more efficient audio stream processing in some cases
           - Added SDL_PutAudioStreamPlanarData() to add planar audio data instead of interleaved data to an audio stream
           - Added SDL_HINT_AUDIO_DEVICE_RAW_STREAM to signal that the OS shouldn't do further audio processing, useful for applications that handle noise canceling, etc.
           - Added enhanced support for 8BitDo controllers
           - Added enhanced support for FlyDigi controllers
           - Added enhanced support for Hand Held Legend SInput controllers
           - Added SDL_hid_get_properties() to associate SDL properties with HID devices
           - Added SDL_SetRelativeMouseTransform() to add custom mouse input transformation
           - Added SDL_GetPenDeviceType() to determine whether a pen is on the screen or on a separate touchpad
           - Added SDL_GetEventDescription() to get an English description of an event, suitable for logging
           - Added verbose log output when the DEBUG_INVOCATION environment variable is set to "1"
           - Added SDL_AddAtomicU32()
           - Added SDL_GetSystemPageSize() to get the system page size
           
           Windows:

           - Added SDL_HINT_RENDER_DIRECT3D11_WARP to enable D3D11 software rasterization
           - SDL_HINT_AUDIO_DEVICE_STREAM_ROLE is used by the WASAPI audio driver to set the audio stream category
           - SDL_HINT_WINDOWS_GAMEINPUT is disabled by default
           
           Linux:

           - Added atomic support for KMSDRM
           - Added SDL_HINT_KMSDRM_ATOMIC to control whether KMSDRM will use atomic functionality
           
           Emscripten:

           - Added SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT for applications that don't want to be fullscreen, but would like to fill the window
           
           PlayStation 2:

           - Added the following hints to control the display parameters: SDL_HINT_PS2_GS_WIDTH, SDL_HINT_PS2_GS_HEIGHT, SDL_HINT_PS2_GS_PROGRESSIVE, SDL_HINT_PS2_GS_MODE