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
EngineExtensions.cs
6using Microsoft.Extensions.Logging;
7
8namespace Gondwana.WinForms;
9
13public static class EngineExtensions
14{
19 public static void InitializeWinFormsAudioFormats(this Engine engine)
20 {
21 NAudioEngineExtensions.UseNAudio(engine);
22 }
23
28 public static void InitializeXInputGamepadManager(this Engine engine)
29 {
30 Engine.Instance.Input.GamepadManager = XInputGamepadManager.Start();
31 }
32
39 public static void InitializeWinFormsKeyboardAdapter(this Engine engine, Control control)
40 {
41 Engine.Logger.LogInformation("Initializing WinFormsKeyboardAdapter...");
42
43 if (control == null)
44 {
45 Engine.Logger.LogError("WinFormsKeyboardAdapter initialization failed: Control cannot be null.");
46 throw new ArgumentNullException(nameof(control));
47 }
48
49 KeyboardEventPoller.Initialize(new WinFormsKeyboardAdapter(control));
50 }
51
59 public static void InitializeWinFormsMouseAdapter(this Engine engine, Control control, MouseEventConfiguration? mouseEventConfiguration = null)
60 {
61 Engine.Logger.LogInformation("Initializing WinFormsMouseAdapter...");
62
63 if (control == null)
64 {
65 Engine.Logger.LogError("WinFormsMousedAdapter initialization failed: Control cannot be null.");
66 throw new ArgumentNullException(nameof(control));
67 }
68
69 MouseEventPoller.Initialize(new WinFormsMouseAdapter(control), mouseEventConfiguration);
70 }
71}