Gondwana.Templates
2.2.4
dotnet new install Gondwana.Templates::2.2.4
This package contains a .NET Template Package you can call from the shell/command line.
Gondwana Templates
dotnet new templates for the Gondwana Game Engine.
Install
dotnet new install Gondwana.Templates
Available Templates
| Template | Short name | Description |
|---|---|---|
| Gondwana WinForms Game | gondwana-winforms |
Starter Windows desktop game using Gondwana + WinForms |
| Gondwana Avalonia Game | gondwana-avalonia |
Starter cross-platform desktop game using Gondwana + Avalonia (Windows, macOS, Linux) |
| Gondwana Avalonia WASM Game | gondwana-wasm |
Starter cross-platform game using Gondwana + Avalonia, targeting both desktop and browser/WASM |
Usage
WinForms (Windows only)
dotnet new gondwana-winforms -n MyGame
cd MyGame
dotnet run
This scaffolds a ready-to-run WinForms project containing:
MyGame.csproj— targetsnet8.0-windowswith the four Gondwana packages pre-referencedProgram.cs—[STAThread]WinForms entry pointGameWindow.cs—Formwired to the engine lifecycle (OnLoad→ host,OnShown→Initialize,OnFormClosed→Dispose)GameHost.cs—WinFormsGameHostsubclass with// TODOoverride stubs for loading tilesheets, building the scene, and handling keyboard inputassets/README.txt— instructions for adding sprites and other asset files
Avalonia (Windows, macOS, Linux)
dotnet new gondwana-avalonia -n MyGame
cd MyGame
dotnet run
This scaffolds a ready-to-run Avalonia project containing:
MyGame.csproj— targetsnet8.0with the Gondwana andAvalonia.Desktoppackages pre-referencedProgram.cs— AvaloniaAppBuilderentry point usingUsePlatformDetect()App.cs—Applicationsubclass that creates the main window on startupGameWindow.cs—Windowwired to the engine lifecycle (OnOpened→ host +Initialize,OnClosed→Dispose)GameHost.cs—AvaloniaGameHostsubclass with// TODOoverride stubs for loading tilesheets, building the scene, and handling keyboard inputassets/README.txt— instructions for adding sprites and other asset files
Choosing a backbuffer
Both templates accept a --Backbuffer parameter to choose the rendering backend:
| Value | Description |
|---|---|
bitmap |
CPU-based bitmap backbuffer using SkiaSharp (default). Available for WinForms on Windows and Avalonia on Windows, macOS, and Linux. |
gpu |
GPU-accelerated OpenGL backbuffer. Requires an OpenGL-capable desktop target. |
# GPU-accelerated WinForms project
dotnet new gondwana-winforms -n MyGame --Backbuffer gpu
# GPU-accelerated Avalonia project
dotnet new gondwana-avalonia -n MyGame --Backbuffer gpu
Omitting --Backbuffer is equivalent to passing --Backbuffer bitmap.
When --Backbuffer gpu is used:
GameWindow.csusesWinFormGpuRenderSurfaceControl/AvaloniaGpuRenderSurfaceControlinstead of the bitmap variant.GameHost.csderives fromWinFormsGpuGameHost/AvaloniaGpuGameHostinstead ofWinFormsGameHost/AvaloniaGameHost.
Avalonia WASM (desktop + browser)
dotnet new gondwana-wasm -n MyGame
cd MyGame
dotnet run # run on desktop
Build and publish for browser:
dotnet workload install wasm-tools # one-time per machine
dotnet publish -f net8.0-browser -c Release
# Output: bin/Release/net8.0-browser/browser-wasm/AppBundle/
This scaffolds a project containing:
MyGame.csproj— multi-targetsnet8.0andnet8.0-browser;Avalonia.Desktop/Avalonia.BrowserandGondwana.Audio.Browserare applied conditionally; definesBROWSERconstant for the browser targetProgram.cs— desktop entry point (#if !BROWSER); usesUsePlatformDetect()andStartWithClassicDesktopLifetime()Program.Browser.cs— browser entry point (#if BROWSER); importsgondwana-audio.jsviaJSHost.ImportAsync, then starts Avalonia withStartBrowserAppAsync()App.cs— handles bothIClassicDesktopStyleApplicationLifetime(desktop) andISingleViewApplicationLifetime(WASM)GameWindow.cs— desktopWindow(compiled only whenBROWSERis not defined)GameView.cs— browser single-viewUserControlGameRenderSurface.cs— thin project-specific subclass ofAvaloniaBitmapRenderSurfaceControlGameHost.cs—AvaloniaGameHostsubclass with// TODOstubs showing both desktop and browser audio patternswwwroot/gondwana-audio.js— the Gondwana browser audio JS module, also shipped by theGondwana.Audio.BrowserNuGet package as a content fileassets/README.txt— instructions for adding sprites and other assets
Further reading
- Getting started (15-minute guide) — first-game-in-15-minutes.md
- Wiki — https://github.com/Isthimius/Gondwana/wiki
- API reference — https://isthimius.github.io/Gondwana/
- NuGet packages — https://www.nuget.org/packages/Gondwana
-
net8.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.