API Reference
The 2dog API is deliberately small. Use twodog.Engine to own one Godot instance, or use the fixture classes when xUnit owns the process.
twodog
| Type | Use it to |
|---|---|
Engine | Configure, start, run, and stop embedded Godot |
Engine is the normal entry point from the 2dog.engine package.
Godot
| Type | Use it to |
|---|---|
GodotInstance | Access the borrowed compatibility handle returned by Engine.Start() |
2dog adds GodotInstance to the GodotSharp API. Use the Godot class reference for nodes, resources, scenes, and other engine types.
twodog.Testing
| Type | Use it to |
|---|---|
FixtureBase | Build a fixture with custom Godot arguments |
Fixture | Run tests with rendering enabled |
HeadlessFixture | Run headless tests, including CI |
These fixtures ship in 2dog.engine and do not depend on a specific test framework.
twodog.Testing.Xunit
| Type | Use it to |
|---|---|
RenderingCollection | Share a rendered fixture across an xUnit collection |
HeadlessCollection | Share a headless fixture across an xUnit collection |
The collection definitions ship in 2dog.xunit and compile into the consuming test assembly so xUnit can discover them.
Lifetime at a Glance
using var engine = new twodog.Engine("MyGame", args: args);
engine.Start();
while (!engine.Iteration())
{
// One frame has completed.
}Engine owns the instance. Use RequestQuit() for graceful shutdown; Completion completes and Exited fires after teardown on every platform. Desktop Dispose() is synchronous; browser callers await DisposeAsync() or Completion. Start a new Engine only after completion. See Single Godot Instance.