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
XInput.cs
1using System.Runtime.InteropServices;
2
4
8internal static class XInput
9{
16 [DllImport("xinput1_4.dll", EntryPoint = "XInputGetState")]
17 internal static extern int GetState(int dwUserIndex, out XINPUT_STATE pState);
18
22 [StructLayout(LayoutKind.Sequential)]
23 internal struct XINPUT_STATE
24 {
28 public uint dwPacketNumber;
29
33 public XINPUT_GAMEPAD Gamepad;
34 }
35
39 [StructLayout(LayoutKind.Sequential)]
40 internal struct XINPUT_GAMEPAD
41 {
45 public ushort wButtons;
46
50 public byte bLeftTrigger;
51
55 public byte bRightTrigger;
56
60 public short sThumbLX;
61
65 public short sThumbLY;
66
70 public short sThumbRX;
71
75 public short sThumbRY;
76 }
77
81 [Flags]
82 internal enum XInputButtons : ushort
83 {
87 A = 0x1000,
88
92 B = 0x2000,
93
97 X = 0x4000,
98
102 Y = 0x8000,
103
107 DPadUp = 0x0001,
108
112 DPadDown = 0x0002,
113
117 DPadLeft = 0x0004,
118
122 DPadRight = 0x0008,
123
127 Start = 0x0010,
128
132 Back = 0x0020,
133
137 LeftShoulder = 0x0100,
138
142 RightShoulder = 0x0200,
143
147 LeftThumb = 0x0040,
148
152 RightThumb = 0x0080,
153 }
154}