"Godot, or to dog... is it even a question?"
This library lets your C# application code start and pump Godot's MainLoop - not the other way around.
2dog is a .NET/C# front-end for Godot Engine that inverts the traditional architecture. Instead of having Godot's process and scene tree drive your application, you now control Godot as a library.
Think of it like this: Godot is your loyal companion that follows your lead, learns new tricks, and does exactly what you tell it to. All this while still having all the capabilities of the full engine.
using twodog;
using var engine = new Engine("myapp", "./project");
using var godot = engine.Start();
// Load a scene
var scene = GD.Load<PackedScene>("res://game.tscn");
engine.Tree.Root.AddChild(scene.Instantiate());
// Run the main loop
while (!godot.Iteration())
{
// Your code here – every frame
}- 🎮 Full Godot Power – access the complete GodotSharp API: scenes, physics, rendering, audio, input – everything Godot can do
- 🔄 Inverted Control – your .NET process controls Godot, not the other way around
- 🧪 First-Class Testing – built-in xUnit fixtures for testing Godot code, run headless in CI/CD pipelines
- Godot as an embedded library (libgodot)
- Full GodotSharp API access
- Custom .NET-first project structure
- Three build configurations: Debug, Release, and Editor (with
TOOLS_ENABLED) - xUnit test fixtures (
GodotFixture,GodotHeadlessFixture) dotnet newproject templates- Headless mode for servers and CI/CD
Prerelease packages are now available on NuGet! Linux and Windows supported. macOS is WIP.
- .NET SDK 8.0 or later
- Godot Mono (for importing project assets)
# Install the template
dotnet new install 2dog.Templates::0.1.9-pre
# Create a new project (optionally with xUnit tests)
dotnet new 2dog --tests True -n MyGame
# Navigate into the project
cd MyGame
# Import assets with Godot
godot-mono --path MyGame/project --import
# Run tests
dotnet test
# Run the game
dotnet run --project MyGame
# Edit in Godot
godot-mono -e --path MyGame/projectdotnet add package 2dog --version 0.1.9-preIf you prefer to build everything locally instead of using NuGet packages:
- Clone and initialize submodules
git clone --recursive https://github.com/outfox/2dog
cd 2dog- Build Godot (requires Python with uv)
uv run poe build-godot- Build .NET packages
uv run poe buildYou can also run
uv run poe build-allto do steps 2 and 3 in one go.
- Run the demo
dotnet run --project demodotnet build -c Debug # Development with debug symbols
dotnet build -c Release # Optimized production build
dotnet build -c Editor # Editor tools with TOOLS_ENABLEDCurrently tested on Linux and Windows only. macOS support is WIP.
Full documentation at 2dog.dev
- Getting Started – installation and first project
- Core Concepts – architecture and design
- Build Configurations – Debug, Release, and Editor modes
- API Reference – Engine, GodotInstance, and more
- Testing with xUnit – test fixtures and CI/CD setup
- Project Templates – scaffolding new projects
Questions? Ideas? Want to teach 2dog new tricks?
Inspired by and built upon Ben Rog-Wilhelm's libgodot_example. You're the GOAT. Or a DIESEL HORSE. Same difference!