KappaDuck.Loki.Runtimes
1.0.0
dotnet add package KappaDuck.Loki.Runtimes --version 1.0.0
NuGet\Install-Package KappaDuck.Loki.Runtimes -Version 1.0.0
<PackageReference Include="KappaDuck.Loki.Runtimes" Version="1.0.0" />
<PackageVersion Include="KappaDuck.Loki.Runtimes" Version="1.0.0" />
<PackageReference Include="KappaDuck.Loki.Runtimes" />
paket add KappaDuck.Loki.Runtimes --version 1.0.0
#r "nuget: KappaDuck.Loki.Runtimes, 1.0.0"
#:package KappaDuck.Loki.Runtimes@1.0.0
#addin nuget:?package=KappaDuck.Loki.Runtimes&version=1.0.0
#tool nuget:?package=KappaDuck.Loki.Runtimes&version=1.0.0
Loki

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:
- Full API reference
samples/for runnable code covering common uses cases
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
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 |
|---|