Graphix-CS 3.4.16.1

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

Graphix-CS

Graphix-CS is a packaging fork of SDL3-CS, based on upstream v3.4.16.0 (c1d1cb0da632cb51799da6989f6e48c52f2a539e). The binding and generator source, namespace SDL3, class SDL, and assembly SDL3-CS.dll are unchanged. Original authorship and the zlib license are preserved.

Install Graphix-CS 3.4.16.1 from NuGet.org. Normal restore requires no GitHub authentication, Actions artifact or local package feed. See the fork README for build verification and provenance. Do not reference both Graphix-CS and SDL3-CS in one application.

The package contains no native runtime. Cerneala supplies Graphix.Native 3.4.16-graphix.3 separately for Windows, Linux and macOS on x64 and ARM64. The other native package families and platform tables below refer to the upstream SDL3-CS project; they are not renamed by this fork. Do not combine Graphix.Native with another provider of the same SDL3 native libraries.

Package Versions

This package uses managed package version Graphix-CS 3.4.16.1. The package revision updates public distribution documentation; it does not change the upstream binding/generator source or managed assembly version.

Package family Version
Graphix-CS 3.4.16.1
Graphix.Native (separate desktop runtime) 3.4.16-graphix.3
SDL3-CS.<Platform> 3.4.16.0
SDL3-CS.<Platform>.Image 3.4.6.9
SDL3-CS.<Platform>.Mixer 3.2.4.11
SDL3-CS.<Platform>.TTF 3.2.2.11
SDL3-CS.<Platform>.Shadercross 3.0.0.11

Documentation

Supported Platforms

The managed wrapper targets .NET 7, .NET 8, .NET 9, and .NET 10.

The included callback generator requires a Roslyn 5.9-compatible compiler, such as .NET SDK 10.0.400, even when the application targets an older .NET runtime. Roslyn 5.6 compiler hosts reject this generator with CS9057.

Platform family Native package suffix Supported RIDs / ABIs Notes
Windows Windows win-x86, win-x64, win-arm64 Dynamic SDL libraries for desktop Windows apps.
Linux Linux linux-x64, linux-arm64 Built against glibc 2.28 or newer.
macOS MacOS osx-x64, osx-arm64 Dynamic SDL libraries for Intel and Apple Silicon macOS apps.
Android Android android-arm, android-arm64, android-x86, android-x64 Includes the SDL Android bridge in SDL3-CS.Android.
iOS iOS ios-arm64, iossimulator-arm64, iossimulator-x64 Static native assets are linked through package buildTransitive targets.
tvOS tvOS tvos-arm64, tvossimulator-arm64, tvossimulator-x64 Static native assets are linked through package buildTransitive targets.

Installation

Install the managed wrapper and the Graphix desktop runtime from NuGet.org:

dotnet add package Graphix-CS --version 3.4.16.1
dotnet add package Graphix.Native --version 3.4.16-graphix.3

Alternatively, choose the upstream native package family that matches your target platform instead of Graphix.Native. For a Windows desktop app using that alternative:

dotnet add package SDL3-CS.Windows
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

Replace Windows with Linux, MacOS, Android, iOS, or tvOS.

Platform SDL SDL_image SDL_ttf SDL_mixer SDL_shadercross
Windows SDL3-CS.Windows SDL3-CS.Windows.Image SDL3-CS.Windows.TTF SDL3-CS.Windows.Mixer SDL3-CS.Windows.Shadercross
Linux SDL3-CS.Linux SDL3-CS.Linux.Image SDL3-CS.Linux.TTF SDL3-CS.Linux.Mixer SDL3-CS.Linux.Shadercross
macOS SDL3-CS.MacOS SDL3-CS.MacOS.Image SDL3-CS.MacOS.TTF SDL3-CS.MacOS.Mixer SDL3-CS.MacOS.Shadercross
Android SDL3-CS.Android SDL3-CS.Android.Image SDL3-CS.Android.TTF SDL3-CS.Android.Mixer SDL3-CS.Android.Shadercross
iOS SDL3-CS.iOS SDL3-CS.iOS.Image SDL3-CS.iOS.TTF SDL3-CS.iOS.Mixer SDL3-CS.iOS.Shadercross
tvOS SDL3-CS.tvOS SDL3-CS.tvOS.Image SDL3-CS.tvOS.TTF SDL3-CS.tvOS.Mixer SDL3-CS.tvOS.Shadercross

Android applications use MainActivity : Org.Libsdl.App.SDLActivity, override GetLibraries(), and run SDL from the managed Main() override.

Managed Main Callbacks

For SDL's callback-based application lifecycle, implement SDL.IMainCallbacks<TSelf> and apply [SDL.GenerateMain] to the partial application class:

using SDL3;

[SDL.GenerateMain]
internal sealed partial class Game : SDL.IMainCallbacks<Game>
{
    public static SDL.AppResult AppInit(out Game? appState, string[] args)
    {
        appState = new Game();
        return SDL.AppResult.Continue;
    }

    public SDL.AppResult AppIterate() => SDL.AppResult.Continue;

    public SDL.AppResult AppEvent(ref SDL.Event @event) =>
        (SDL.EventType)@event.Type == SDL.EventType.Quit
            ? SDL.AppResult.Success
            : SDL.AppResult.Continue;

    public void AppQuit(SDL.AppResult result)
    {
    }
}

Graphix-CS supplies the unchanged SDL3-CS source generator through the package's analyzer assets. It creates the entry point and delegates to SDL.RunMainCallbacks<TApp>, which owns the managed/native state lifetime and contains managed exceptions until SDL returns control to the caller.

Example

using SDL3;

namespace CreateWindow;

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 renderer: {SDL.GetError()}");
            return;
        }

        SDL.SetRenderDrawColor(renderer, 100, 149, 237, 255);
        SDL.RenderClear(renderer);
        SDL.RenderPresent(renderer);

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

Feedback and Contributions

Open an issue or start a discussion for bugs, ideas, and questions.

See the repository README for the full project overview.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.4.16.1 110 9/7/2026