![]() |
Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
|
Provides a base class for hosting and managing the lifecycle of a Gondwana game application. More...
Public Member Functions | |
| void | Initialize (string? configPath=null, bool? autoSaveConfig=null, LogLevel logLevel=LogLevel.Warning) |
| Initializes the game host by configuring logging, platform services, input, game content, and the Gondwana engine. | |
| void | InitializeWithConfigurationStore (IEngineConfigurationStore configurationStore, bool? autoSaveConfig=null, LogLevel logLevel=LogLevel.Warning) |
| Initializes the game host using a caller-supplied configuration persistence store. | |
| void | Dispose () |
| Releases resources owned by the game host. | |
Protected Member Functions | |
| void | InitializeWidgetInput (RenderSurfaceHostBase renderSurfaceHost) |
| Initializes widget input routing for the supplied render surface host. | |
| virtual void | OnInitializing () |
| Runs before the host initialization sequence begins. | |
| void | ConfigureLogging (LogLevel logLevel) |
| Configures the logging level used by Gondwana. | |
| void | ConfigurePlatform () |
| Configures platform-specific services, adapters, and render infrastructure. | |
| void | ConfigureInput () |
| Configures keyboard, mouse, gamepad, and touch input. | |
| virtual void | ConfigureKeyboard () |
| Configures the keyboard input adapter. | |
| virtual void | ConfigureMouse () |
| Configures the mouse input adapter. | |
| virtual void | ConfigureGamepads () |
| Configures the gamepad manager. | |
| virtual void | ConfigureTouch () |
| Configures the touch input adapter. | |
| virtual void | OnInputConfigured () |
| Runs after all input devices have been configured. | |
| void | InitializeGameContent () |
| Initializes game-specific content, the scene graph, and scene objects. | |
| void | LoadContent () |
| Loads assets, tilesheets, and animation cycles. | |
| virtual void | LoadAssets () |
| Loads textures, sounds, and other game assets. | |
| virtual void | LoadTilesheets () |
| Loads tilesheet definitions. | |
| virtual void | LoadAnimationCycles () |
| Loads animation cycle definitions. | |
| void | CreateSceneGraph () |
| Creates the initial scene and its views. | |
| virtual void | OnSceneGraphCreated () |
| Runs after the scene graph has been created but before the scene is bound. | |
| virtual Scene | CreateInitialScene () |
| Creates the initial scene for the game. | |
| virtual void | CreateInitialViews () |
| Creates the initial views and viewports used to render the scene. | |
| virtual void | BindScene () |
| Binds the current scene to the platform render surface. | |
| virtual void | OnSceneBound () |
| Runs after the current scene has been bound to the render surface host. | |
| void | InitializeSceneObjects () |
| Creates sprites and direct drawings for the current scene. | |
| virtual void | CreateSprites () |
| Creates sprite objects for the current scene. | |
| virtual void | CreateDirectDrawings () |
| Creates direct drawings and widgets for the current scene. | |
| void | InitializeEngine (string? configPath, bool? autoSaveConfig) |
| Initializes the Gondwana engine using the default file-backed configuration store. | |
| void | InitializeEngine (string? configPath, bool? autoSaveConfig, IEngineConfigurationStore? configurationStore) |
| Initializes the Gondwana engine. | |
| virtual void | OnEngineInitialized () |
| Runs after the engine has been initialized but before it has been started. | |
| void | StartEngine () |
| Starts the engine using the synchronization context returned by GetSynchronizationContext. | |
| virtual void | StartEngineCore (SynchronizationContext syncContext) |
| Starts the engine using the supplied synchronization context. | |
| virtual ? SynchronizationContext | GetSynchronizationContext () |
| Gets the synchronization context used to start the engine. | |
| virtual void | OnEngineStarted () |
| Runs after the engine has been started. | |
| virtual void | OnInitialized () |
| Runs after the full host initialization sequence has completed. | |
| virtual void | UnhookEvents () |
| Unhooks custom event handlers during disposal. | |
| void | StopEngine () |
| Stops the engine during host disposal. | |
| virtual void | StopEngineCore () |
| Performs platform-specific engine shutdown work. | |
| void | DisposeEngine () |
| Disposes the engine instance. | |
| virtual void | OnDisposing () |
| Runs before managed resources are disposed. | |
| virtual void | OnDisposed () |
| Runs after managed resources have been disposed. | |
| void | EnsureNotInitialized () |
| Ensures that the host has not already been initialized. | |
| void | EnsureNotDisposed () |
| Ensures that the host has not been disposed. | |
Properties | |
| Engine | Engine [get] |
| Gets the singleton instance of the Gondwana engine. | |
| Scene? | Scene [get, protected set] |
| Gets the current active scene. | |
| WidgetInputRouter? | WidgetInputRouter [get] |
| Gets the widget input router, if widget input has been initialized. | |
Provides a base class for hosting and managing the lifecycle of a Gondwana game application.
Definition at line 13 of file GameHostBase.cs.
|
protectedvirtual |
Binds the current scene to the platform render surface.
Reimplemented in Gondwana.Avalonia.Hosting.AvaloniaBitmapGameHost, Gondwana.Avalonia.Hosting.AvaloniaGpuGameHost, Gondwana.Blazor.Hosting.BlazorGameHostBase, and Gondwana.WinForms.Hosting.WinFormsGameHostBase.
Definition at line 297 of file GameHostBase.cs.
|
protectedvirtual |
Configures the gamepad manager.
Reimplemented in Gondwana.Avalonia.Hosting.AvaloniaBitmapGameHost, Gondwana.Avalonia.Hosting.AvaloniaGpuGameHost, Gondwana.Blazor.Hosting.BlazorGameHostBase, and Gondwana.WinForms.Hosting.WinFormsGameHostBase.
Definition at line 190 of file GameHostBase.cs.
|
protected |
Configures keyboard, mouse, gamepad, and touch input.
Definition at line 163 of file GameHostBase.cs.
|
protectedvirtual |
Configures the keyboard input adapter.
Reimplemented in Gondwana.Avalonia.Hosting.AvaloniaBitmapGameHost, Gondwana.Avalonia.Hosting.AvaloniaGpuGameHost, Gondwana.Blazor.Hosting.BlazorGameHostBase, and Gondwana.WinForms.Hosting.WinFormsGameHostBase.
Definition at line 176 of file GameHostBase.cs.
|
protected |
Configures the logging level used by Gondwana.
| logLevel | The minimum log level to use. |
Definition at line 149 of file GameHostBase.cs.
|
protectedvirtual |
Configures the mouse input adapter.
Reimplemented in Gondwana.Avalonia.Hosting.AvaloniaBitmapGameHost, Gondwana.Avalonia.Hosting.AvaloniaGpuGameHost, Gondwana.Blazor.Hosting.BlazorGameHostBase, and Gondwana.WinForms.Hosting.WinFormsGameHostBase.
Definition at line 183 of file GameHostBase.cs.
|
abstractprotected |
Configures platform-specific services, adapters, and render infrastructure.
|
protectedvirtual |
Configures the touch input adapter.
Reimplemented in Gondwana.Avalonia.Hosting.AvaloniaBitmapGameHost, Gondwana.Avalonia.Hosting.AvaloniaGpuGameHost, Gondwana.Blazor.Hosting.BlazorGameHostBase, and Gondwana.WinForms.Hosting.WinFormsGameHostBase.
Definition at line 197 of file GameHostBase.cs.
|
protectedvirtual |
Creates direct drawings and widgets for the current scene.
Definition at line 327 of file GameHostBase.cs.
|
protectedvirtual |
Creates the initial scene for the game.
Definition at line 282 of file GameHostBase.cs.
|
protectedvirtual |
Creates the initial views and viewports used to render the scene.
Definition at line 290 of file GameHostBase.cs.
|
protected |
Creates the initial scene and its views.
| InvalidOperationException | Thrown when CreateInitialScene returns null. |
Definition at line 261 of file GameHostBase.cs.
|
protectedvirtual |
Creates sprite objects for the current scene.
Definition at line 320 of file GameHostBase.cs.
| void Gondwana.Hosting.GameHostBase.Dispose | ( | ) |
Releases resources owned by the game host.
Call from the hosting/UI thread, outside an engine callback. Background rendering is stopped and joined before cleanup hooks release native resources.
Definition at line 517 of file GameHostBase.cs.
|
protected |
Disposes the engine instance.
Definition at line 464 of file GameHostBase.cs.
|
protected |
Ensures that the host has not been disposed.
| ObjectDisposedException | Thrown when the host has already been disposed. |
Definition at line 505 of file GameHostBase.cs.
|
protected |
Ensures that the host has not already been initialized.
| InvalidOperationException | Thrown when the host has already been initialized. |
Definition at line 490 of file GameHostBase.cs.
|
protectedvirtual |
Gets the synchronization context used to start the engine.
null when unavailable.Reimplemented in Gondwana.Blazor.Hosting.BlazorGameHostBase.
Definition at line 418 of file GameHostBase.cs.
| void Gondwana.Hosting.GameHostBase.Initialize | ( | string? | configPath = null, |
| bool? | autoSaveConfig = null, | ||
| LogLevel | logLevel = LogLevel.Warning ) |
Initializes the game host by configuring logging, platform services, input, game content, and the Gondwana engine.
| configPath | Optional path to the engine configuration file. |
| autoSaveConfig | Optional value indicating whether configuration changes should be saved automatically. |
| logLevel | The minimum log level used by Gondwana. The default is LogLevel.Warning. |
| ObjectDisposedException | Thrown when the host has already been disposed. |
| InvalidOperationException | Thrown when the host has already been initialized or no synchronization context is available. |
|
protected |
Initializes the Gondwana engine using the default file-backed configuration store.
Retained for compatibility with derived hosts that call the pre-configuration-store overload.
| configPath | Optional path to the engine configuration file. |
| autoSaveConfig | Optional value indicating whether configuration changes should be saved automatically. |
|
protected |
Initializes the Gondwana engine.
| configPath | Optional path to the engine configuration file. |
| autoSaveConfig | Optional value indicating whether configuration changes should be saved automatically. |
| configurationStore | Optional configuration persistence store. When null, the default file-backed store is used. |
Definition at line 356 of file GameHostBase.cs.
|
protected |
Initializes game-specific content, the scene graph, and scene objects.
Definition at line 215 of file GameHostBase.cs.
|
protected |
Creates sprites and direct drawings for the current scene.
Definition at line 311 of file GameHostBase.cs.
|
protected |
Initializes widget input routing for the supplied render surface host.
| renderSurfaceHost | The render surface host whose widgets should receive keyboard, mouse, and touch input. |
Call this only after the render surface host and the desired input pollers have been created. Reinitializing widget input disposes the previously configured router.
| ArgumentNullException | Thrown when renderSurfaceHost is null. |
Definition at line 116 of file GameHostBase.cs.
| void Gondwana.Hosting.GameHostBase.InitializeWithConfigurationStore | ( | IEngineConfigurationStore | configurationStore, |
| bool? | autoSaveConfig = null, | ||
| LogLevel | logLevel = LogLevel::Warning ) |
Initializes the game host using a caller-supplied configuration persistence store.
| configurationStore | Configuration store owned by the engine after successful initialization. |
| autoSaveConfig | Optional override for the store's IEngineConfigurationStore.AutoSave setting. |
| logLevel | The minimum log level used by Gondwana. The default is LogLevel.Warning. |
Definition at line 70 of file GameHostBase.cs.
|
protectedvirtual |
Loads animation cycle definitions.
Definition at line 251 of file GameHostBase.cs.
|
protectedvirtual |
Loads textures, sounds, and other game assets.
Definition at line 237 of file GameHostBase.cs.
|
protected |
Loads assets, tilesheets, and animation cycles.
Definition at line 227 of file GameHostBase.cs.
|
protectedvirtual |
Loads tilesheet definitions.
Definition at line 244 of file GameHostBase.cs.
|
protectedvirtual |
Runs after managed resources have been disposed.
Reimplemented in Gondwana.Blazor.Hosting.BlazorGameHostBase.
Definition at line 480 of file GameHostBase.cs.
|
protectedvirtual |
Runs before managed resources are disposed.
Reimplemented in Gondwana.Avalonia.Hosting.AvaloniaGpuGameHost.
Definition at line 473 of file GameHostBase.cs.
|
protectedvirtual |
Runs after the engine has been initialized but before it has been started.
Definition at line 381 of file GameHostBase.cs.
|
protectedvirtual |
Runs after the engine has been started.
Definition at line 426 of file GameHostBase.cs.
|
protectedvirtual |
Runs after the full host initialization sequence has completed.
Definition at line 433 of file GameHostBase.cs.
|
protectedvirtual |
Runs before the host initialization sequence begins.
Definition at line 141 of file GameHostBase.cs.
|
protectedvirtual |
Runs after all input devices have been configured.
Platform hosts may override this hook to call InitializeWidgetInput(RenderSurfaceHostBase) once their render surface host is available.
Reimplemented in Gondwana.Avalonia.Hosting.AvaloniaBitmapGameHost, Gondwana.Avalonia.Hosting.AvaloniaGpuGameHost, Gondwana.Blazor.Hosting.BlazorGameHostBase, Gondwana.WinForms.Hosting.WinFormsGameHost, and Gondwana.WinForms.Hosting.WinFormsGpuGameHost.
Definition at line 208 of file GameHostBase.cs.
|
protectedvirtual |
Runs after the current scene has been bound to the render surface host.
Reimplemented in Gondwana.WinForms.Hosting.WinFormsGameHostBase.
Definition at line 304 of file GameHostBase.cs.
|
protectedvirtual |
Runs after the scene graph has been created but before the scene is bound.
Definition at line 274 of file GameHostBase.cs.
|
protected |
Starts the engine using the synchronization context returned by GetSynchronizationContext.
| InvalidOperationException | Thrown when no synchronization context is available. |
Definition at line 392 of file GameHostBase.cs.
|
protectedvirtual |
Starts the engine using the supplied synchronization context.
| syncContext | The synchronization context used by the engine. |
Reimplemented in Gondwana.Blazor.Hosting.BlazorGameHostBase.
Definition at line 408 of file GameHostBase.cs.
|
protected |
Stops the engine during host disposal.
Definition at line 447 of file GameHostBase.cs.
|
protectedvirtual |
Performs platform-specific engine shutdown work.
Reimplemented in Gondwana.Blazor.Hosting.BlazorGameHostBase.
Definition at line 456 of file GameHostBase.cs.
|
protectedvirtual |
Unhooks custom event handlers during disposal.
Definition at line 440 of file GameHostBase.cs.
|
get |
Gets the singleton instance of the Gondwana engine.
Definition at line 25 of file GameHostBase.cs.
|
getprotected set |
Gets the current active scene.
Definition at line 30 of file GameHostBase.cs.
|
getprotected |
Gets the widget input router, if widget input has been initialized.
Definition at line 35 of file GameHostBase.cs.