From d17be7fd2a3302f68b160a931fa378332ecedde4 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 4 Apr 2013 09:56:04 -0400 Subject: [PATCH] StructLayouts... --- src/SDL2.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/SDL2.cs b/src/SDL2.cs index 6801b7c..6ed8118 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -1529,6 +1529,7 @@ namespace SDL2 (byte) 'Y', (byte) 'V', (byte) 'Y', (byte) 'U' ); + [StructLayout(LayoutKind.Sequential)] public struct SDL_Color { public byte r; @@ -1537,6 +1538,7 @@ namespace SDL2 public byte a; } + [StructLayout(LayoutKind.Sequential)] public struct SDL_Palette { public int ncolors; @@ -1545,6 +1547,7 @@ namespace SDL2 public int refcount; } + [StructLayout(LayoutKind.Sequential)] public struct SDL_PixelFormat { public uint format; @@ -1748,7 +1751,18 @@ namespace SDL2 [StructLayout(LayoutKind.Sequential)] public struct SDL_Surface { - // TODO... + uint flags; + IntPtr format; // SDL_PixelFormat* + int w; + int h; + int pitch; + IntPtr pixels; // void* + IntPtr userdata; // void* + int locked; + IntPtr lock_data; // void* + SDL_Rect clip_rect; + IntPtr map; // SDL_BlitMap* + int refcount; } /* TODO: SDL_surface.h: