-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It targets desktop (Windows, Linux, macOS) via explicit WinForms and Avalonia adapters, and web support via Blazor.
It is a code-first engine with no editor or scene GUI required. Developers own the game loop and rendering pipeline directly. Gondwana uses a component-based, code-first architecture with explicit scene, rendering, input, audio, and hosting subsystems. It is not a traditional Entity Component System; instead, it favors object-oriented engine primitives and composable rendering/game components.
| Technology | Role |
|---|---|
| .NET 8 / C# | Primary language and runtime |
| SkiaSharp | Cross-platform 2D rendering (GPU + bitmap backbuffers) |
| NAudio | Audio playback and mixing |
| LibVLCSharp | Experimental video playback |
| SDL2 | Optional gamepad input (via Gondwana.Input.SDL2) |
| WinForms | Desktop host adapter for Windows |
| Avalonia | Cross-platform desktop host adapter for Win / Mac / Linux |
| Blazor / WebAssembly | Browser-based host adapter |
| Nerdbank.GitVersioning | Deterministic versioning from version.json
|
The solution (Gondwana.sln) is composed of multiple focused projects.
The main engine library. Contains:
- Engine.cs — Central game loop (timing, input polling, scene updates, rendering)
- EngineManagers.cs, EngineDispatcher.cs — Lifecycle and dispatch
- Backbuffers (
BitmapBackbuffer,GpuBackbuffer) RefreshQueueRenderSurfaceHost- Views / Camera / Viewport
SceneSceneLayerSceneLayerTile- Hierarchical scene graph
- Sprites
- Tilesheets
- Animations
- Collision shapes
- Direct drawables:
DirectImageDirectRectangleTextBlockDirectParticles
- Coordinates, overhang, tiles
- Keyboard, mouse, and gamepad polling abstractions
-
MovementController- Follow
- Integrated
- Scripted modes
- Easing functions
AudioResourceManagerPlatformAudioFactory- Stereo panning
- High-resolution timing
- Scheduled callbacks
- Bounding-volume detection
- Kinematic physics
- Configuration
- Extensibility
- Logging
- SkiaSharp integration
-
Gondwana.Hosting/
-
GameHostBase— base class for platform hosts
-
-
Gondwana.WinForms/
- WinForms-specific rendering surface
- Input wiring
- Audio integration
-
Gondwana.WinForms.Hosting/
- WinForms hosting glue
-
Gondwana.Avalonia/
- Avalonia-specific rendering surface
- Cross-platform host integration
- Input and presentation wiring for Avalonia applications
-
Gondwana.Avalonia.Hosting/
- Avalonia hosting glue
- Connects Avalonia application lifecycle to the Gondwana engine loop
-
Gondwana.Blazor/
- Blazor/WebAssembly-specific rendering surface
- Browser canvas presentation support
- JavaScript interop for browser-hosted rendering
-
Gondwana.Blazor.Hosting/
- Blazor hosting glue
- Connects Blazor application lifecycle to the Gondwana engine loop
-
Gondwana.Audio.Midi/
- MIDI file reading and synthesis
- Bundled
.sf2soundfont support
-
Gondwana.Input.SDL2/
- SDL2-based gamepad input provider
-
Gondwana.Video/
- Video playback via LibVLCSharp (
VlcVideoPlayer)
- Video playback via LibVLCSharp (
-
Demos/Gondwana.CoordinateTest— Coordinate system test demo -
Demos/Gondwana.ParticleTest— Particle system demo -
Demos/Slider,Demos/Spot— Additional sample games/demos
Each engine cycle:
-
Dirty-region tracking
State changes enqueue world-space dirty rectangles into the affectedSceneLayer'sRefreshQueue. -
View rendering
ViewRendereriterates activeViewinstances in Z-order.
Each applies its Camera/Viewport transform and redraws the affected regions into a backbuffer. -
Composition & presentation
- Sprites and tiles are drawn from cached tilesheets
- Animations advance
- Final backbuffer is presented by the active platform host
- WinForms, Avalonia, and Blazor hosts each handle presentation through their own adapter layer
-
Timers & input
- High-resolution timers advance simulation time
- Input adapters poll keyboard, mouse, and gamepad
- Scene state is updated accordingly
Gondwana’s render path is intentionally explicit.
For bitmap backbuffers, Gondwana uses dirty-region redraw: only changed regions are redrawn, rather than blindly repainting the full frame.
For GPU-backed backbuffers, rendering is delegated through GPU-backed Skia surfaces. The GPU path may favor full-surface redraw or GPU-side optimization instead of the bitmap dirty-rectangle path.
-
World-space first
All logic uses world coordinates; camera/viewport transforms occur only at render time. -
Dirty-region rendering
Bitmap backbuffers redraw only changed regions, not the full screen. -
GPU-aware rendering
GPU-backed surfaces use a different optimization path than bitmap-backed surfaces. -
Layered scenes with parallax
AScenecontains multipleSceneLayers, each with independent refresh tracking and parallax settings. -
View-centric rendering
Multiple cameras/viewports are first-class: split-screen, HUD layers, minimaps, and alternate views are all natural fits. -
Platform adapters at the edges
Core engine logic is platform-agnostic. WinForms, Avalonia, and Blazor support live in separate adapter projects. -
Host glue stays separate
Platform-specific hosting concerns are isolated in.Hostingprojects, keeping the core adapters cleaner. -
Deterministic ordering
Stable sorting for Z-order, layers, and drawables ensures predictable rendering.
The project uses Nerdbank.GitVersioning.
- Canonical version is defined in
version.json - Automatically applied via
Directory.Build.props - Do not hard-code
<Version>or<FileVersion>in.csprojfiles
- New here? → Make Your First Game in 1 Hour
- Want the mental model? → Engine Architecture Overview