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.Input.Gamepad.SDL2.SdlGamepadAdapter Class Referencesealed

Provides a gamepad adapter implementation using SDL2 for cross-platform gamepad input support. More...

Inheritance diagram for Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter:
Gondwana.Input.Gamepad.IGamepadAdapter

Public Member Functions

 SdlGamepadAdapter (int deviceIndex)
 Initializes a new instance of the SdlGamepadAdapter class for the specified device.
void Poll ()
 Polls the gamepad for the current state of all buttons, analog sticks, and triggers.
void Dispose ()
 Releases all resources used by the SdlGamepadAdapter and closes the SDL gamepad controller.

Properties

string GamepadId [get]
 Gets the unique identifier for this gamepad.
IReadOnlyCollection< string > PressedButtons [get]
 Gets the collection of currently pressed button names.
GamepadStickState? LeftStick [get]
 Gets the current state of the left analog stick.
GamepadStickState? RightStick [get]
 Gets the current state of the right analog stick.
float LeftTrigger [get]
 Gets the current pressure value of the left trigger (0.0 to 1.0).
float RightTrigger [get]
 Gets the current pressure value of the right trigger (0.0 to 1.0).

Detailed Description

Provides a gamepad adapter implementation using SDL2 for cross-platform gamepad input support.

Definition at line 8 of file SdlGamepadAdapter.cs.

Constructor & Destructor Documentation

◆ SdlGamepadAdapter()

Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.SdlGamepadAdapter ( int deviceIndex)

Initializes a new instance of the SdlGamepadAdapter class for the specified device.

Parameters
deviceIndexThe SDL device index of the gamepad to open.
Exceptions
InvalidOperationExceptionThrown when the SDL gamepad controller cannot be opened at the specified index.

Definition at line 48 of file SdlGamepadAdapter.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.Dispose ( )

Releases all resources used by the SdlGamepadAdapter and closes the SDL gamepad controller.

Definition at line 110 of file SdlGamepadAdapter.cs.

◆ Poll()

void Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.Poll ( )

Polls the gamepad for the current state of all buttons, analog sticks, and triggers.

Definition at line 60 of file SdlGamepadAdapter.cs.

Property Documentation

◆ GamepadId

string Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.GamepadId
get

Gets the unique identifier for this gamepad.

Implements Gondwana.Input.Gamepad.IGamepadAdapter.

Definition at line 16 of file SdlGamepadAdapter.cs.

◆ LeftStick

GamepadStickState? Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.LeftStick
get

Gets the current state of the left analog stick.

Implements Gondwana.Input.Gamepad.IGamepadAdapter.

Definition at line 26 of file SdlGamepadAdapter.cs.

◆ LeftTrigger

float Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.LeftTrigger
get

Gets the current pressure value of the left trigger (0.0 to 1.0).

Implements Gondwana.Input.Gamepad.IGamepadAdapter.

Definition at line 36 of file SdlGamepadAdapter.cs.

◆ PressedButtons

IReadOnlyCollection<string> Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.PressedButtons
get

Gets the collection of currently pressed button names.

Implements Gondwana.Input.Gamepad.IGamepadAdapter.

Definition at line 21 of file SdlGamepadAdapter.cs.

◆ RightStick

GamepadStickState? Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.RightStick
get

Gets the current state of the right analog stick.

Implements Gondwana.Input.Gamepad.IGamepadAdapter.

Definition at line 31 of file SdlGamepadAdapter.cs.

◆ RightTrigger

float Gondwana.Input.Gamepad.SDL2.SdlGamepadAdapter.RightTrigger
get

Gets the current pressure value of the right trigger (0.0 to 1.0).

Implements Gondwana.Input.Gamepad.IGamepadAdapter.

Definition at line 41 of file SdlGamepadAdapter.cs.