mirror of
https://github.com/Ryujinx/SDL2-CS.git
synced 2025-01-25 18:01:08 +00:00
Fix SDL_GameControllerButtonBind layout
This commit is contained in:
parent
bd3b64fe32
commit
0f768e1c18
22
src/SDL2.cs
22
src/SDL2.cs
|
@ -5282,19 +5282,23 @@ namespace SDL2
|
||||||
public int hat_mask;
|
public int hat_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This struct has a union in it, hence the Explicit layout. */
|
// FIXME: I'd rather this somehow be private...
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
[StructLayout(LayoutKind.Explicit)]
|
||||||
|
public struct INTERNAL_GameControllerButtonBind_union
|
||||||
|
{
|
||||||
|
[FieldOffset(0)]
|
||||||
|
public int button;
|
||||||
|
[FieldOffset(0)]
|
||||||
|
public int axis;
|
||||||
|
[FieldOffset(0)]
|
||||||
|
public INTERNAL_GameControllerButtonBind_hat hat;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct SDL_GameControllerButtonBind
|
public struct SDL_GameControllerButtonBind
|
||||||
{
|
{
|
||||||
/* Note: enum size is 4 bytes. */
|
|
||||||
[FieldOffset(0)]
|
|
||||||
public SDL_GameControllerBindType bindType;
|
public SDL_GameControllerBindType bindType;
|
||||||
[FieldOffset(4)]
|
public INTERNAL_GameControllerButtonBind_union value;
|
||||||
public int button;
|
|
||||||
[FieldOffset(4)]
|
|
||||||
public int axis;
|
|
||||||
[FieldOffset(4)]
|
|
||||||
public INTERNAL_GameControllerButtonBind_hat hat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerAddMapping", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerAddMapping", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
|
Loading…
Reference in a new issue