Sdl3Sharp.linux-x64 0.0.1-test9

This is a prerelease version of Sdl3Sharp.linux-x64.
dotnet add package Sdl3Sharp.linux-x64 --version 0.0.1-test9
                    
NuGet\Install-Package Sdl3Sharp.linux-x64 -Version 0.0.1-test9
                    
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="Sdl3Sharp.linux-x64" Version="0.0.1-test9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sdl3Sharp.linux-x64" Version="0.0.1-test9" />
                    
Directory.Packages.props
<PackageReference Include="Sdl3Sharp.linux-x64" />
                    
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 Sdl3Sharp.linux-x64 --version 0.0.1-test9
                    
#r "nuget: Sdl3Sharp.linux-x64, 0.0.1-test9"
                    
#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 Sdl3Sharp.linux-x64@0.0.1-test9
                    
#: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=Sdl3Sharp.linux-x64&version=0.0.1-test9&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sdl3Sharp.linux-x64&version=0.0.1-test9&prerelease
                    
Install as a Cake Tool

SDL3#

SDL3# Banner

GitHub Release NuGet Version SDL Native Library

About

SDL3# provides hand-crafted C# language bindings for SDL3.

In contrast to the promoted C# bindings (SDL3-CS), SDL3# is entirely hand-crafted, with no auto-generation of API code based on the native library.
Every part of the API is deliberately designed to feel native to C#, translating SDL's functionality into idiomatic, well thought-out counterparts that existing C# users should feel right at home with.
It makes heavy use of modern C# features to provide an API that is expressive and comfortable to work with from managed code, while still exposing the full breadth of SDL's functionality.

This project is a work in progress and is not yet complete or usable in production. The public .NET API is subject to change at any time and in any form without prior notice. Use at your own risk.

Building

For instructions on how to build the project from source, see BUILDING.md.

Usage

Requirements

  • C# 14 or later
  • .NET 10 or later

Adding SDL3# as a dependency

Via your IDE

(Example: Visual Studio)

Open the NuGet Package Manager, search for Sdl3Sharp, check "Include prerelease", and install the latest version.

Via .csproj
<PackageReference Include="Sdl3Sharp" Version="*-*" />
Via a file-based C# app

Add the following directive at the top of your file:

#:package Sdl3Sharp@*-*

Choosing a package variant

The default Sdl3Sharp package includes pre-built native SDL3 binaries for all supported platforms and is the easiest way to get started.

If you only need to target specific platforms, you can reference the corresponding RID-specific packages instead, for example Sdl3Sharp.win-x64 or Sdl3Sharp.linux-x64, rather than pulling in binaries for every platform.

If you do not want any native binaries bundled at all, reference Sdl3Sharp.Core instead. In that case you are responsible for providing the native SDL3 and libffi binaries yourself, placed alongside the resulting executable of your application.

Examples

Hello World
MessageBox.TryShowSimple(MessageBoxFlags.Information, "Hello World", "Hello World from SDL3#!");
Rendering a triangle
using var sdl = new Sdl(static builder => builder
    .SetAppName("Simple SDL3# Triangle example")
    .InitializeSubSystems(SubSystems.Video)
);

return sdl.Run(new App(), args);

class App : AppBase
{
    private Window mWindow = default!;
    private Renderer mRenderer = default!;

    protected override AppResult OnInitialize(Sdl sdl, string[] args)
    {
        if (!Window.TryCreateWithRenderer("Hello World", 800, 600, out mWindow!, out mRenderer!))
        {
            return Failure;
        }

        return Continue;
    }

    protected override AppResult OnIterate(Sdl sdl)
    {
        mRenderer.DrawColorFloat = (0, 0, 0, 1);
        mRenderer.TryClear();

        mRenderer.TryRenderGeometry([
            new Vertex(position: (400, 150), color: (1, 0, 0, 1), texCoord: default),
            new Vertex(position: (200, 450), color: (0, 1, 0, 1), texCoord: default),
            new Vertex(position: (600, 450), color: (0, 0, 1, 1), texCoord: default)
        ]);

        mRenderer.TryRenderPresent();

        return Continue;
    }

    protected override AppResult OnEvent(Sdl sdl, ref Event @event)
    {
        if (@event.Type is EventType.WindowCloseRequested)
        {
            return Success;
        }

        return Continue;
    }

    protected override void OnQuit(Sdl sdl, AppResult result)
    {
        mRenderer?.Dispose();
        mRenderer = default!;

        mWindow?.Dispose();
        mWindow = default!;
    }
}

The example above makes use of the AppBase lifetime model, where SDL3# manages the main loop for you. You implement OnInitialize, OnIterate, and OnEvent as callbacks, and SDL3# takes care of the rest.

If you prefer to manage the main loop yourself, you can do so: you still initialize SDL via new Sdl(...) and pump events on your own, without using AppBase at all.

A note on AI usage

In the spirit of transparency, and in line with the contributing guidelines, here is an overview of how AI was used in this project:

  • Documentation. AI was used to help write and improve documentation. The content itself comes from the author, but AI was used to clarify and clean up the writing.
  • API design. AI was used as a sounding board for API design decisions. Sometimes the options to consider came from the author, sometimes the AI had useful proposals to offer. All decisions were ultimately made by the author.
  • Infrastructural documents. AI was used to help write project documents such as this README.md, the BUILDING.md, the CONTRIBUTING.md, and the CODE_OF_CONDUCT.md.
  • Code review. AI was used to review some of the author's code, and occasionally this turned out to be fruitful, catching bugs that might otherwise have been overlooked.
  • Functional code. No AI was used to write any functional code. All code in this project was written by the author.

License

SDL3# is licensed under the MIT License. See NOTICE.md for third-party notices.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Sdl3Sharp.linux-x64:

Package Downloads
Sdl3Sharp

SDL3# - SDL bindings for C#/.NET - "Meta" package - just references all of the native binary packages and by transitivity the "Core" package

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-test9 19 3/12/2026
0.0.1-test8 63 2/14/2026
0.0.1-test7 59 2/13/2026
0.0.1-test6 243 12/19/2025
0.0.1-test5 336 12/7/2025
0.0.1-test4 251 12/4/2025
0.0.1-test3 288 11/14/2025
0.0.1-test2 256 10/22/2025
0.0.1-test1 262 10/21/2025