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
AvaloniaGpuGameHost.cs
3
5
16public abstract class AvaloniaGpuGameHost : GameHostBase
17{
22
29 {
30 RenderSurface = renderSurface ?? throw new ArgumentNullException(nameof(renderSurface));
31 }
32
36 protected override void ConfigurePlatform()
37 {
39 }
40
44 protected override void ConfigureKeyboard()
45 {
46 Engine.Instance.InitializeAvaloniaKeyboardAdapter(RenderSurface);
48 }
49
53 protected override void ConfigureMouse()
54 {
55 Engine.Instance.InitializeAvaloniaMouseAdapter(RenderSurface);
57 }
58
62 protected override void ConfigureGamepads()
63 {
65 }
66
70 protected override void ConfigureTouch()
71 {
72 Engine.Instance.InitializeAvaloniaTouchAdapter(RenderSurface);
74 }
75
79 protected override void BindScene()
80 {
81 RenderSurface.Host.Bind(Scene!, false);
82 }
83
85 protected override void OnDisposing()
86 {
87 RenderSurface.Dispose();
88 base.OnDisposing();
89 }
90
94 protected virtual void OnConfigurePlatform() { }
95
99 protected virtual void OnKeyboardAdapterInitialized() { }
100
104 protected virtual void OnMouseAdapterInitialized() { }
105
109 protected virtual void OnGamepadManagerInitialized() { }
110
115 protected virtual void OnTouchAdapterInitialized() { }
116
120 protected sealed override void OnInputConfigured()
121 {
122 base.OnInputConfigured();
123
125 }
126}
override void ConfigurePlatform()
Configures Avalonia-specific platform features.
virtual void OnKeyboardAdapterInitialized()
Called after the keyboard adapter has been initialized. Override to perform additional keyboard setup...
virtual void OnConfigurePlatform()
Provides a hook for configuring platform-specific settings during initialization.
override void BindScene()
Binds the current scene to the GPU render surface host.
override void ConfigureTouch()
Configures the touch adapter for the Avalonia GPU render surface.
virtual void OnMouseAdapterInitialized()
Called after the mouse adapter has been initialized. Override to perform additional mouse setup.
virtual void OnGamepadManagerInitialized()
Called after the gamepad manager has been initialized. Override to perform additional gamepad setup.
AvaloniaGpuGameHost(AvaloniaGpuRenderSurfaceControl renderSurface)
Initializes a new instance of the AvaloniaGpuGameHost class.
override void ConfigureGamepads()
Configures gamepad support. Override to provide platform-specific gamepad integration.
override void ConfigureKeyboard()
Configures the keyboard adapter for the Avalonia render surface.
AvaloniaGpuRenderSurfaceControl RenderSurface
Gets the GPU render surface control used for displaying game content.
override void OnInputConfigured()
Called after input is configured during engine startup to initialize widget input for the render surf...
virtual void OnTouchAdapterInitialized()
Called after the touch adapter has been initialized. Override to perform additional touch setup,...
override void ConfigureMouse()
Configures the mouse adapter for the Avalonia render surface.
override void OnDisposing()
Runs before managed resources are disposed.
An Avalonia OpenGlControlBase that displays game frames produced by the Gondwana engine using GPU-acc...
Provides a base class for hosting and managing the lifecycle of a Gondwana game application.
Scene? Scene
Gets the current active scene.
void InitializeWidgetInput(RenderSurfaceHostBase renderSurfaceHost)
Initializes widget input routing for the supplied render surface host.
Engine Engine
Gets the singleton instance of the Gondwana engine.