KappaDuck.Loki.Runtimes 1.0.0

Suggested Alternatives

KappaDuck.Quack.Runtimes

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package KappaDuck.Loki.Runtimes --version 1.0.0
                    
NuGet\Install-Package KappaDuck.Loki.Runtimes -Version 1.0.0
                    
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="KappaDuck.Loki.Runtimes" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KappaDuck.Loki.Runtimes" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="KappaDuck.Loki.Runtimes" />
                    
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 KappaDuck.Loki.Runtimes --version 1.0.0
                    
#r "nuget: KappaDuck.Loki.Runtimes, 1.0.0"
                    
#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 KappaDuck.Loki.Runtimes@1.0.0
                    
#: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=KappaDuck.Loki.Runtimes&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=KappaDuck.Loki.Runtimes&version=1.0.0
                    
Install as a Cake Tool

Loki Static Badge NuGet Version

A modern, fast and flexible .NET game framework using SDL3.

Overview

Loki is a AOT-first modern, simple and fast game framework for building games and interactive applications, built on top of SDL3 and its extensions (SDL_image, SDL_mixer, SDL_ttf). It targets .NET 11+ desktop, providing a clean and flexible API that hides the complexity of SDL.

Features

  • 2D rendering via the Renderer API and 3D rendering via the GPU API
  • Window and display management
  • Audio management
  • Input & events
  • Image and font loading
  • Native UI integration
  • Native AOT

Usage

Using the easy way with Game class

using KappaDuck.Loki;
using KappaDuck.Loki.Graphics;
using KappaDuck.Loki.Graphics.Rendering;

internal sealed class Pong : Game
{
    private Sprite _ball = null!;

    public Pong() : base("Pong", 1280, 720)
    {
    }

    protected override void Initialize()
    {
        Texture texture = Assets.Load("ball.png");
        _ball = new Sprite(texture);
    }

    protected override void Update(GameTime time)
    {
        // move things by time.Delta
    }

    protected override void Draw(GameTime time)
    {
        Renderer.Clear(Colors.Black);

        Renderer.Draw(_ball);
        Renderer.Present();
    }
}

// Program.cs
using Pong game = new();
game.Run();

Using your own loop

using KappaDuck.Loki;
using KappaDuck.Loki.Events;
using KappaDuck.Loki.Graphics;
using KappaDuck.Loki.Graphics.Rendering;
using KappaDuck.Loki.Input;
using KappaDuck.Loki.Windowing;

using Window window = new("Pong", 1280, 720);
using Renderer renderer = new(window);

using Texture texture = Texture.Load(renderer, "ball.png");
Sprite ball = new(texture);

while (window.IsOpen)
{
    while (window.Poll(out Event e))
    {
        if (e is QuitRequested or KeyPressed { Key: Key.Escape })
        {
            window.Close();
            return;
        }
    }

    renderer.Clear(Colors.Black);

    renderer.Draw(ball);
    renderer.Present();
}

More examples and documentation can be found at Documentation

The public API is still a prototype. Expect to have frequent changes.

Installation

Install Loki via NuGet:

dotnet package add KappaDuck.Loki -v 0.1.0

or via your .csproj:

<PackageReference Include="KappaDuck.Loki" Version="0.1.0">

You can also install via the NuGet Package Manager in Visual Studio or JetBrains Rider.

Loki is still in early development. Expect breaking changes and frequent updates. Always use the latest version for the best experience.

Beta packages

Pre-release versions are published to NuGet.org alongside stable releases. To install the latest beta:

dotnet package add KappaDuck.Loki --prerelease

Documentation

Full API documentation and samples are available:

Cross-platform support

Loki supports Windows and Linux thanks to SDL3's abstraction layer.

The framework may have platform-specific implementations or limitations depending on the underlying SDL support. Using platform-specific features will surface a compiler warning indicating the code may not be portable across all targets.

Android and WebAssembly (WASM) support is planned for a future milestone. macOS and iOS are not in scope.

SDL compatibility

SDL3 native libraries are bundled via KappaDuck.Loki.Runtimes. The table below shows the SDL versions included in each release of both packages.

During active development, KappaDuck.Loki references the pre-release version of KappaDuck.Loki.Runtimes. When a stable release of KappaDuck.Loki is published, it switches to the corresponding production version of KappaDuck.Loki.Runtimes.

Loki Runtimes SDL3 SDL_image SDL_ttf SDL_mixer
source 0.1.0-beta.1 3.4.14 3.4.4 3.2.2 3.2.4

Development & Sandbox

You can build Loki from source and experiment quickly using the included sandbox project.

Prerequisites

Setup

1. Clone the repository

git clone https://github.com/KappaDuck/loki.git
cd loki

2. Create an entry point in the sandbox

The sandbox project requires at least one .cs file to compile. All .cs files inside src/Loki.Sandbox/ are listed in .gitignore, so create any file you like there. A simple starting point:

using KappaDuck.Loki;
using KappaDuck.Loki.Events;
using KappaDuck.Loki.Input;
using KappaDuck.Loki.Windowing;

using Window window = new("Sandbox", 1920, 1080) { Resizable = true };

while (window.IsOpen)
{
    while (window.Poll(out Event e))
    {
        if (e is QuitRequested or KeyPressed { Key: Key.Escape })
        {
            window.Close();
            return;
        }
    }
}

3. Build

dotnet build

4. Run the tests

dotnet test

Loki.Sandbox

The repository includes a dedicated sandbox project at src/Loki.Sandbox/ for experimenting without touching the main source. It references KappaDuck.Loki directly so changes are reflected immediately.

To run your sandbox:

cd sandbox/Loki.Sandbox
dotnet run

or simply run in your IDE

AI disclosure

AI tools assisted with two things in this project: documentation (XML doc comments, README, CONTRIBUTING guidelines) and design exploration (prototyping API shapes, exploring implementation approaches, and thinking through architecture decisions). Everything is reviewed by the author and no generated-AI code will be in the code source.

Credits

Built with inspiration from

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has 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