From b253a810e02df97f52bec315da1a5e25517569e0 Mon Sep 17 00:00:00 2001 From: Caleb Cornett Date: Fri, 12 Jun 2020 22:37:18 -0400 Subject: [PATCH] Add padding to SDL_Event --- src/SDL2.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SDL2.cs b/src/SDL2.cs index 3a1dbef..95be33f 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -4822,7 +4822,7 @@ namespace SDL2 /* General event structure */ // C# doesn't do unions, so we do this ugly thing. */ [StructLayout(LayoutKind.Explicit)] - public struct SDL_Event + public unsafe struct SDL_Event { [FieldOffset(0)] public SDL_EventType type; @@ -4878,6 +4878,8 @@ namespace SDL2 public SDL_DollarGestureEvent dgesture; [FieldOffset(0)] public SDL_DropEvent drop; + [FieldOffset(0)] + private fixed byte padding[56]; } [UnmanagedFunctionPointer(CallingConvention.Cdecl)]