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.
Loading...
Searching...
No Matches
Gondwana.Blazor.Hosting.BlazorGameHost Class Referenceabstract

Provides a base class for Gondwana Blazor games rendered through the CPU-backed bitmap path. More...

Inheritance diagram for Gondwana.Blazor.Hosting.BlazorGameHost:
Gondwana.Blazor.Hosting.BlazorGameHostBase Gondwana.Hosting.GameHostBase

Protected Member Functions

 BlazorGameHost (BlazorBitmapRenderSurfaceComponent renderSurface, IJSRuntime jsRuntime)
 Initializes a new instance of BlazorGameHost.
override void BindSceneCore (Scene scene)
Protected Member Functions inherited from Gondwana.Blazor.Hosting.BlazorGameHostBase
 BlazorGameHostBase (IJSRuntime jsRuntime)
 Initializes a new instance of BlazorGameHostBase.
void BindSceneCore (Scene scene)
 Binds a scene to the concrete typed render-surface host.
override void ConfigurePlatform ()
override void ConfigureKeyboard ()
 Configures the keyboard input adapter.
override void ConfigureMouse ()
 Configures the mouse input adapter.
override void ConfigureGamepads ()
 Configures the gamepad manager.
override void ConfigureTouch ()
 Configures the touch input adapter.
override void BindScene ()
 Binds the current scene to the platform render surface.
override? SynchronizationContext GetSynchronizationContext ()
 Gets the synchronization context used to start the engine.
Returns
The synchronization context, or null when unavailable.

override void StartEngineCore (SynchronizationContext syncContext)
 Starts the engine using the supplied synchronization context.
Parameters
syncContextThe synchronization context used by the engine.

override void StopEngineCore ()
 Performs platform-specific engine shutdown work.
override void OnInputConfigured ()
 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.
override void OnDisposed ()
 Runs after managed resources have been disposed.
virtual void OnConfigurePlatform ()
 Provides a hook for configuring additional Blazor platform settings.
virtual void OnKeyboardAdapterInitialized ()
 Called after the Blazor keyboard adapter is initialized.
virtual void OnMouseAdapterInitialized ()
 Called after the Blazor mouse adapter is initialized.
virtual void OnConfigureGamepads ()
 Provides a hook for configuring browser gamepad support.
virtual void OnTouchAdapterInitialized ()
 Called after the Blazor touch adapter is initialized.
virtual void OnBlazorDisposed ()
 Runs after Blazor interop resources have been released.
Protected Member Functions inherited from Gondwana.Hosting.GameHostBase
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.
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 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 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.
void DisposeEngine ()
 Disposes the engine instance.
virtual void OnDisposing ()
 Runs before managed resources are disposed.
void EnsureNotInitialized ()
 Ensures that the host has not already been initialized.
void EnsureNotDisposed ()
 Ensures that the host has not been disposed.

Properties

BlazorBitmapRenderSurfaceComponent RenderSurface [get]
 Gets the bitmap render surface used for displaying game content.
override BlazorRenderSurfaceComponentBase RenderSurfaceComponent [get]
override RenderSurfaceHostBase RenderSurfaceHost [get]
Properties inherited from Gondwana.Blazor.Hosting.BlazorGameHostBase
BlazorRenderSurfaceComponentBase RenderSurfaceComponent [get]
 Gets the concrete Blazor component that supplies DOM input events.
RenderSurfaceHostBase RenderSurfaceHost [get]
 Gets the render-surface host used for scene binding and widget input.
virtual bool RenderSurfaceDrivesBrowserFrames [get]
 Gets a value indicating whether the render surface itself supplies the browser animation callback that drives the timer-driven engine.
Properties inherited from Gondwana.Hosting.GameHostBase
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.

Additional Inherited Members

Public Member Functions inherited from Gondwana.Blazor.Hosting.BlazorGameHostBase
void ConfigureLogicalResolution (int logicalWidth, int logicalHeight)
 Establishes a minimum logical game size from the first usable Blazor canvas dimensions.
void OnAnimationFrame ()
 Advances the timer-driven bitmap path from Gondwana's browser animation loop.
Public Member Functions inherited from Gondwana.Hosting.GameHostBase
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.

Detailed Description

Provides a base class for Gondwana Blazor games rendered through the CPU-backed bitmap path.

This type preserves the original Blazor hosting API. Use BlazorGpuGameHost with BlazorGpuRenderSurfaceComponent for WebGL-backed rendering.

Definition at line 15 of file BlazorGameHost.cs.

Constructor & Destructor Documentation

◆ BlazorGameHost()

Gondwana.Blazor.Hosting.BlazorGameHost.BlazorGameHost ( BlazorBitmapRenderSurfaceComponent renderSurface,
IJSRuntime jsRuntime )
protected

Initializes a new instance of BlazorGameHost.

Parameters
renderSurfaceThe bitmap render surface component.
jsRuntimeThe JavaScript runtime used to drive browser animation frames.

Definition at line 25 of file BlazorGameHost.cs.

Member Function Documentation

◆ BindSceneCore()

override void Gondwana.Blazor.Hosting.BlazorGameHost.BindSceneCore ( Scene scene)
sealedprotected

Definition at line 40 of file BlazorGameHost.cs.

Property Documentation

◆ RenderSurface

BlazorBitmapRenderSurfaceComponent Gondwana.Blazor.Hosting.BlazorGameHost.RenderSurface
get

Gets the bitmap render surface used for displaying game content.

Definition at line 18 of file BlazorGameHost.cs.

◆ RenderSurfaceComponent

override BlazorRenderSurfaceComponentBase Gondwana.Blazor.Hosting.BlazorGameHost.RenderSurfaceComponent
getsealedprotected

Definition at line 34 of file BlazorGameHost.cs.

◆ RenderSurfaceHost

override RenderSurfaceHostBase Gondwana.Blazor.Hosting.BlazorGameHost.RenderSurfaceHost
getsealedprotected

Definition at line 37 of file BlazorGameHost.cs.