Update bindings to b5a7b1ca89f4187641aa25e411e69448a56955f3

This commit is contained in:
hwsmm 2024-07-12 00:37:43 +09:00
parent 25defdb451
commit f12c0ae886
13 changed files with 278 additions and 102 deletions

View File

@ -67,6 +67,10 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
@ -79,6 +83,12 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
@ -115,6 +125,26 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetAudioStreamGain(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioStreamInputChannelMap(SDL_AudioStream* stream, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream* stream, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len);

View File

@ -33,7 +33,7 @@ namespace SDL
public partial struct SDL_CameraSpec
{
public SDL_PixelFormatEnum format;
public SDL_PixelFormat format;
public SDL_Colorspace colorspace;

View File

@ -62,7 +62,6 @@ namespace SDL
SDL_EVENT_WINDOW_FOCUS_GAINED,
SDL_EVENT_WINDOW_FOCUS_LOST,
SDL_EVENT_WINDOW_CLOSE_REQUESTED,
SDL_EVENT_WINDOW_TAKE_FOCUS,
SDL_EVENT_WINDOW_HIT_TEST,
SDL_EVENT_WINDOW_ICCPROF_CHANGED,
SDL_EVENT_WINDOW_DISPLAY_CHANGED,

View File

@ -336,12 +336,63 @@ namespace SDL
[NativeTypeName("#define SDLK_NUMLOCKCLEAR 0x40000053u")]
public const uint SDLK_NUMLOCKCLEAR = 0x40000053U;
[NativeTypeName("#define SDLK_KP_DIVIDE 0x40000054u")]
public const uint SDLK_KP_DIVIDE = 0x40000054U;
[NativeTypeName("#define SDLK_KP_MULTIPLY 0x40000055u")]
public const uint SDLK_KP_MULTIPLY = 0x40000055U;
[NativeTypeName("#define SDLK_KP_MINUS 0x40000056u")]
public const uint SDLK_KP_MINUS = 0x40000056U;
[NativeTypeName("#define SDLK_KP_PLUS 0x40000057u")]
public const uint SDLK_KP_PLUS = 0x40000057U;
[NativeTypeName("#define SDLK_KP_ENTER 0x40000058u")]
public const uint SDLK_KP_ENTER = 0x40000058U;
[NativeTypeName("#define SDLK_KP_1 0x40000059u")]
public const uint SDLK_KP_1 = 0x40000059U;
[NativeTypeName("#define SDLK_KP_2 0x4000005au")]
public const uint SDLK_KP_2 = 0x4000005aU;
[NativeTypeName("#define SDLK_KP_3 0x4000005bu")]
public const uint SDLK_KP_3 = 0x4000005bU;
[NativeTypeName("#define SDLK_KP_4 0x4000005cu")]
public const uint SDLK_KP_4 = 0x4000005cU;
[NativeTypeName("#define SDLK_KP_5 0x4000005du")]
public const uint SDLK_KP_5 = 0x4000005dU;
[NativeTypeName("#define SDLK_KP_6 0x4000005eu")]
public const uint SDLK_KP_6 = 0x4000005eU;
[NativeTypeName("#define SDLK_KP_7 0x4000005fu")]
public const uint SDLK_KP_7 = 0x4000005fU;
[NativeTypeName("#define SDLK_KP_8 0x40000060u")]
public const uint SDLK_KP_8 = 0x40000060U;
[NativeTypeName("#define SDLK_KP_9 0x40000061u")]
public const uint SDLK_KP_9 = 0x40000061U;
[NativeTypeName("#define SDLK_KP_0 0x40000062u")]
public const uint SDLK_KP_0 = 0x40000062U;
[NativeTypeName("#define SDLK_KP_PERIOD 0x40000063u")]
public const uint SDLK_KP_PERIOD = 0x40000063U;
[NativeTypeName("#define SDLK_APPLICATION 0x40000065u")]
public const uint SDLK_APPLICATION = 0x40000065U;
[NativeTypeName("#define SDLK_POWER 0x40000066u")]
public const uint SDLK_POWER = 0x40000066U;
[NativeTypeName("#define SDLK_KP_EQUALS 0x40000067u")]
public const uint SDLK_KP_EQUALS = 0x40000067U;
[NativeTypeName("#define SDLK_F13 0x40000068u")]
public const uint SDLK_F13 = 0x40000068U;
@ -420,6 +471,12 @@ namespace SDL
[NativeTypeName("#define SDLK_VOLUMEDOWN 0x40000081u")]
public const uint SDLK_VOLUMEDOWN = 0x40000081U;
[NativeTypeName("#define SDLK_KP_COMMA 0x40000085u")]
public const uint SDLK_KP_COMMA = 0x40000085U;
[NativeTypeName("#define SDLK_KP_EQUALSAS400 0x40000086u")]
public const uint SDLK_KP_EQUALSAS400 = 0x40000086U;
[NativeTypeName("#define SDLK_ALTERASE 0x40000099u")]
public const uint SDLK_ALTERASE = 0x40000099U;
@ -474,12 +531,60 @@ namespace SDL
[NativeTypeName("#define SDLK_CURRENCYSUBUNIT 0x400000b5u")]
public const uint SDLK_CURRENCYSUBUNIT = 0x400000b5U;
[NativeTypeName("#define SDLK_KP_LEFTPAREN 0x400000b6u")]
public const uint SDLK_KP_LEFTPAREN = 0x400000b6U;
[NativeTypeName("#define SDLK_KP_RIGHTPAREN 0x400000b7u")]
public const uint SDLK_KP_RIGHTPAREN = 0x400000b7U;
[NativeTypeName("#define SDLK_KP_LEFTBRACE 0x400000b8u")]
public const uint SDLK_KP_LEFTBRACE = 0x400000b8U;
[NativeTypeName("#define SDLK_KP_RIGHTBRACE 0x400000b9u")]
public const uint SDLK_KP_RIGHTBRACE = 0x400000b9U;
[NativeTypeName("#define SDLK_KP_TAB 0x400000bau")]
public const uint SDLK_KP_TAB = 0x400000baU;
[NativeTypeName("#define SDLK_KP_BACKSPACE 0x400000bbu")]
public const uint SDLK_KP_BACKSPACE = 0x400000bbU;
[NativeTypeName("#define SDLK_KP_A 0x400000bcu")]
public const uint SDLK_KP_A = 0x400000bcU;
[NativeTypeName("#define SDLK_KP_B 0x400000bdu")]
public const uint SDLK_KP_B = 0x400000bdU;
[NativeTypeName("#define SDLK_KP_C 0x400000beu")]
public const uint SDLK_KP_C = 0x400000beU;
[NativeTypeName("#define SDLK_KP_D 0x400000bfu")]
public const uint SDLK_KP_D = 0x400000bfU;
[NativeTypeName("#define SDLK_KP_E 0x400000c0u")]
public const uint SDLK_KP_E = 0x400000c0U;
[NativeTypeName("#define SDLK_KP_F 0x400000c1u")]
public const uint SDLK_KP_F = 0x400000c1U;
[NativeTypeName("#define SDLK_KP_XOR 0x400000c2u")]
public const uint SDLK_KP_XOR = 0x400000c2U;
[NativeTypeName("#define SDLK_KP_POWER 0x400000c3u")]
public const uint SDLK_KP_POWER = 0x400000c3U;
[NativeTypeName("#define SDLK_KP_PERCENT 0x400000c4u")]
public const uint SDLK_KP_PERCENT = 0x400000c4U;
[NativeTypeName("#define SDLK_KP_LESS 0x400000c5u")]
public const uint SDLK_KP_LESS = 0x400000c5U;
[NativeTypeName("#define SDLK_KP_GREATER 0x400000c6u")]
public const uint SDLK_KP_GREATER = 0x400000c6U;
[NativeTypeName("#define SDLK_KP_AMPERSAND 0x400000c7u")]
public const uint SDLK_KP_AMPERSAND = 0x400000c7U;
[NativeTypeName("#define SDLK_KP_DBLAMPERSAND 0x400000c8u")]
public const uint SDLK_KP_DBLAMPERSAND = 0x400000c8U;
@ -489,6 +594,21 @@ namespace SDL
[NativeTypeName("#define SDLK_KP_DBLVERTICALBAR 0x400000cau")]
public const uint SDLK_KP_DBLVERTICALBAR = 0x400000caU;
[NativeTypeName("#define SDLK_KP_COLON 0x400000cbu")]
public const uint SDLK_KP_COLON = 0x400000cbU;
[NativeTypeName("#define SDLK_KP_HASH 0x400000ccu")]
public const uint SDLK_KP_HASH = 0x400000ccU;
[NativeTypeName("#define SDLK_KP_SPACE 0x400000cdu")]
public const uint SDLK_KP_SPACE = 0x400000cdU;
[NativeTypeName("#define SDLK_KP_AT 0x400000ceu")]
public const uint SDLK_KP_AT = 0x400000ceU;
[NativeTypeName("#define SDLK_KP_EXCLAM 0x400000cfu")]
public const uint SDLK_KP_EXCLAM = 0x400000cfU;
[NativeTypeName("#define SDLK_KP_MEMSTORE 0x400000d0u")]
public const uint SDLK_KP_MEMSTORE = 0x400000d0U;
@ -510,6 +630,9 @@ namespace SDL
[NativeTypeName("#define SDLK_KP_MEMDIVIDE 0x400000d6u")]
public const uint SDLK_KP_MEMDIVIDE = 0x400000d6U;
[NativeTypeName("#define SDLK_KP_PLUSMINUS 0x400000d7u")]
public const uint SDLK_KP_PLUSMINUS = 0x400000d7U;
[NativeTypeName("#define SDLK_KP_CLEAR 0x400000d8u")]
public const uint SDLK_KP_CLEAR = 0x400000d8U;

View File

@ -101,7 +101,7 @@ namespace SDL
}
[NativeTypeName("int")]
public enum SDL_PixelFormatEnum : uint
public enum SDL_PixelFormat : uint
{
SDL_PIXELFORMAT_UNKNOWN,
SDL_PIXELFORMAT_INDEX1LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)),
@ -315,11 +315,9 @@ namespace SDL
public int refcount;
}
public unsafe partial struct SDL_PixelFormat
public partial struct SDL_PixelFormatDetails
{
public SDL_PixelFormatEnum format;
public SDL_Palette* palette;
public SDL_PixelFormat format;
[NativeTypeName("Uint8")]
public byte bits_per_pixel;
@ -343,16 +341,16 @@ namespace SDL
public uint Amask;
[NativeTypeName("Uint8")]
public byte Rloss;
public byte Rbits;
[NativeTypeName("Uint8")]
public byte Gloss;
public byte Gbits;
[NativeTypeName("Uint8")]
public byte Bloss;
public byte Bbits;
[NativeTypeName("Uint8")]
public byte Aloss;
public byte Abits;
[NativeTypeName("Uint8")]
public byte Rshift;
@ -366,11 +364,6 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte Ashift;
public int refcount;
[NativeTypeName("struct SDL_PixelFormat *")]
public SDL_PixelFormat* next;
[InlineArray(2)]
public partial struct _padding_e__FixedBuffer
{
@ -382,26 +375,21 @@ namespace SDL
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPixelFormatName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetPixelFormatName(SDL_PixelFormatEnum format);
public static extern byte* Unsafe_SDL_GetPixelFormatName(SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask);
public static extern int SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PixelFormatEnum SDL_GetPixelFormatEnumForMasks(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask);
public static extern SDL_PixelFormat SDL_GetPixelFormatForMasks(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PixelFormat* SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyPixelFormat(SDL_PixelFormat* format);
[return: NativeTypeName("const SDL_PixelFormatDetails *")]
public static extern SDL_PixelFormatDetails* SDL_GetPixelFormatDetails(SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Palette* SDL_CreatePalette(int ncolors);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPixelFormatPalette(SDL_PixelFormat* format, SDL_Palette* palette);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors);
@ -410,17 +398,17 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapRGB([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
public static extern uint SDL_MapRGB([NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapRGBA([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
public static extern uint SDL_MapRGBA([NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
public static extern void SDL_GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GetRGBA([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
public static extern void SDL_GetRGBA([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[NativeTypeName("#define SDL_ALPHA_OPAQUE 255")]
public const int SDL_ALPHA_OPAQUE = 255;

View File

@ -102,7 +102,7 @@ namespace SDL
public static extern int SDL_GetCurrentRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Texture* SDL_CreateTexture(SDL_Renderer* renderer, SDL_PixelFormatEnum format, int access, int w, int h);
public static extern SDL_Texture* SDL_CreateTexture(SDL_Renderer* renderer, SDL_PixelFormat format, int access, int w, int h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Texture* SDL_CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface);

View File

@ -347,6 +347,10 @@ namespace SDL
[return: NativeTypeName("Uint32")]
public static extern uint SDL_StepUTF8([NativeTypeName("const char **")] byte** pstr, [NativeTypeName("size_t *")] nuint* pslen);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UCS4ToUTF8", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_UCS4ToUTF8([NativeTypeName("Uint32")] uint codepoint, [NativeTypeName("char *")] byte* dst);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_sscanf([NativeTypeName("const char *")] byte* text, [NativeTypeName("const char *")] byte* fmt, __arglist);

View File

@ -28,10 +28,6 @@ using System.Runtime.InteropServices;
namespace SDL
{
public partial struct SDL_BlitMap
{
}
public enum SDL_ScaleMode
{
SDL_SCALEMODE_NEAREST,
@ -46,11 +42,15 @@ namespace SDL
SDL_FLIP_VERTICAL,
}
public partial struct SDL_SurfaceData
{
}
public unsafe partial struct SDL_Surface
{
public SDL_SurfaceFlags flags;
public SDL_PixelFormat* format;
public SDL_PixelFormat format;
public int w;
@ -61,28 +61,18 @@ namespace SDL
[NativeTypeName("void*")]
public IntPtr pixels;
[NativeTypeName("void*")]
public IntPtr reserved;
public int locked;
[NativeTypeName("void*")]
public IntPtr list_blitmap;
public SDL_Rect clip_rect;
public SDL_BlitMap* map;
public int refcount;
public SDL_SurfaceData* @internal;
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format);
public static extern SDL_Surface* SDL_CreateSurface(int width, int height, SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_CreateSurfaceFrom([NativeTypeName("void*")] IntPtr pixels, int width, int height, int pitch, SDL_PixelFormatEnum format);
public static extern SDL_Surface* SDL_CreateSurfaceFrom(int width, int height, SDL_PixelFormat format, [NativeTypeName("void*")] IntPtr pixels, int pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroySurface(SDL_Surface* surface);
@ -94,11 +84,14 @@ namespace SDL
public static extern int SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace* colorspace);
public static extern SDL_Colorspace SDL_GetSurfaceColorspace(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Palette* SDL_GetSurfacePalette(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockSurface(SDL_Surface* surface);
@ -118,13 +111,13 @@ namespace SDL
public static extern int SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceRLE(SDL_Surface* surface, int flag);
public static extern int SDL_SetSurfaceRLE(SDL_Surface* surface, SDL_bool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasRLE(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceColorKey(SDL_Surface* surface, int flag, [NativeTypeName("Uint32")] uint key);
public static extern int SDL_SetSurfaceColorKey(SDL_Surface* surface, SDL_bool enabled, [NativeTypeName("Uint32")] uint key);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasColorKey(SDL_Surface* surface);
@ -163,22 +156,19 @@ namespace SDL
public static extern SDL_Surface* SDL_DuplicateSurface(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_ConvertSurface(SDL_Surface* surface, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format);
public static extern SDL_Surface* SDL_ConvertSurface(SDL_Surface* surface, SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_ConvertSurfaceFormat(SDL_Surface* surface, SDL_PixelFormatEnum pixel_format);
public static extern SDL_Surface* SDL_ConvertSurfaceAndColorspace(SDL_Surface* surface, SDL_PixelFormat format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, SDL_Colorspace colorspace, SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_ConvertSurfaceFormatAndColorspace(SDL_Surface* surface, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props);
public static extern int SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertPixels(int width, int height, SDL_PixelFormatEnum src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormatEnum dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
public static extern int SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormatEnum src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormatEnum dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
public static extern int SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_FillSurfaceRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color);
@ -201,23 +191,28 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurfaceUncheckedScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapSurfaceRGB(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapSurfaceRGBA(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ReadSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[NativeTypeName("#define SDL_PREALLOC 0x00000001u")]
public const uint SDL_PREALLOC = 0x00000001U;
[NativeTypeName("#define SDL_SURFACE_PREALLOCATED 0x00000001u")]
public const uint SDL_SURFACE_PREALLOCATED = 0x00000001U;
[NativeTypeName("#define SDL_RLEACCEL 0x00000002u")]
public const uint SDL_RLEACCEL = 0x00000002U;
[NativeTypeName("#define SDL_SURFACE_LOCK_NEEDED 0x00000002u")]
public const uint SDL_SURFACE_LOCK_NEEDED = 0x00000002U;
[NativeTypeName("#define SDL_DONTFREE 0x00000004u")]
public const uint SDL_DONTFREE = 0x00000004U;
[NativeTypeName("#define SDL_SURFACE_LOCKED 0x00000004u")]
public const uint SDL_SURFACE_LOCKED = 0x00000004U;
[NativeTypeName("#define SDL_SIMD_ALIGNED 0x00000008u")]
public const uint SDL_SIMD_ALIGNED = 0x00000008U;
[NativeTypeName("#define SDL_SURFACE_USES_PROPERTIES 0x00000010u")]
public const uint SDL_SURFACE_USES_PROPERTIES = 0x00000010U;
[NativeTypeName("#define SDL_SURFACE_SIMD_ALIGNED 0x00000008u")]
public const uint SDL_SURFACE_SIMD_ALIGNED = 0x00000008U;
[NativeTypeName("#define SDL_PROP_SURFACE_COLORSPACE_NUMBER \"SDL.surface.colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_SURFACE_COLORSPACE_NUMBER => "SDL.surface.colorspace"u8;

View File

@ -39,7 +39,7 @@ namespace SDL
{
public SDL_DisplayID displayID;
public SDL_PixelFormatEnum format;
public SDL_PixelFormat format;
public int w;
@ -398,9 +398,6 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetWindowModalFor(SDL_Window* modal_window, SDL_Window* parent_window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetWindowInputFocus(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetWindowFocusable(SDL_Window* window, SDL_bool focusable);
@ -493,7 +490,7 @@ namespace SDL
public static extern int SDL_GL_SwapWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GL_DeleteContext([NativeTypeName("SDL_GLContext")] SDL_GLContextState* context);
public static extern int SDL_GL_DestroyContext([NativeTypeName("SDL_GLContext")] SDL_GLContextState* context);
[NativeTypeName("#define SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER \"SDL.video.wayland.wl_display\"")]
public static ReadOnlySpan<byte> SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER => "SDL.video.wayland.wl_display"u8;

View File

@ -111,8 +111,25 @@ namespace SDL
SDLK_DOWN = SDL3.SDLK_DOWN,
SDLK_UP = SDL3.SDLK_UP,
SDLK_NUMLOCKCLEAR = SDL3.SDLK_NUMLOCKCLEAR,
SDLK_KP_DIVIDE = SDL3.SDLK_KP_DIVIDE,
SDLK_KP_MULTIPLY = SDL3.SDLK_KP_MULTIPLY,
SDLK_KP_MINUS = SDL3.SDLK_KP_MINUS,
SDLK_KP_PLUS = SDL3.SDLK_KP_PLUS,
SDLK_KP_ENTER = SDL3.SDLK_KP_ENTER,
SDLK_KP_1 = SDL3.SDLK_KP_1,
SDLK_KP_2 = SDL3.SDLK_KP_2,
SDLK_KP_3 = SDL3.SDLK_KP_3,
SDLK_KP_4 = SDL3.SDLK_KP_4,
SDLK_KP_5 = SDL3.SDLK_KP_5,
SDLK_KP_6 = SDL3.SDLK_KP_6,
SDLK_KP_7 = SDL3.SDLK_KP_7,
SDLK_KP_8 = SDL3.SDLK_KP_8,
SDLK_KP_9 = SDL3.SDLK_KP_9,
SDLK_KP_0 = SDL3.SDLK_KP_0,
SDLK_KP_PERIOD = SDL3.SDLK_KP_PERIOD,
SDLK_APPLICATION = SDL3.SDLK_APPLICATION,
SDLK_POWER = SDL3.SDLK_POWER,
SDLK_KP_EQUALS = SDL3.SDLK_KP_EQUALS,
SDLK_F13 = SDL3.SDLK_F13,
SDLK_F14 = SDL3.SDLK_F14,
SDLK_F15 = SDL3.SDLK_F15,
@ -139,6 +156,8 @@ namespace SDL
SDLK_MUTE = SDL3.SDLK_MUTE,
SDLK_VOLUMEUP = SDL3.SDLK_VOLUMEUP,
SDLK_VOLUMEDOWN = SDL3.SDLK_VOLUMEDOWN,
SDLK_KP_COMMA = SDL3.SDLK_KP_COMMA,
SDLK_KP_EQUALSAS400 = SDL3.SDLK_KP_EQUALSAS400,
SDLK_ALTERASE = SDL3.SDLK_ALTERASE,
SDLK_SYSREQ = SDL3.SDLK_SYSREQ,
SDLK_CANCEL = SDL3.SDLK_CANCEL,
@ -157,11 +176,32 @@ namespace SDL
SDLK_DECIMALSEPARATOR = SDL3.SDLK_DECIMALSEPARATOR,
SDLK_CURRENCYUNIT = SDL3.SDLK_CURRENCYUNIT,
SDLK_CURRENCYSUBUNIT = SDL3.SDLK_CURRENCYSUBUNIT,
SDLK_KP_LEFTPAREN = SDL3.SDLK_KP_LEFTPAREN,
SDLK_KP_RIGHTPAREN = SDL3.SDLK_KP_RIGHTPAREN,
SDLK_KP_LEFTBRACE = SDL3.SDLK_KP_LEFTBRACE,
SDLK_KP_RIGHTBRACE = SDL3.SDLK_KP_RIGHTBRACE,
SDLK_KP_TAB = SDL3.SDLK_KP_TAB,
SDLK_KP_BACKSPACE = SDL3.SDLK_KP_BACKSPACE,
SDLK_KP_A = SDL3.SDLK_KP_A,
SDLK_KP_B = SDL3.SDLK_KP_B,
SDLK_KP_C = SDL3.SDLK_KP_C,
SDLK_KP_D = SDL3.SDLK_KP_D,
SDLK_KP_E = SDL3.SDLK_KP_E,
SDLK_KP_F = SDL3.SDLK_KP_F,
SDLK_KP_XOR = SDL3.SDLK_KP_XOR,
SDLK_KP_POWER = SDL3.SDLK_KP_POWER,
SDLK_KP_PERCENT = SDL3.SDLK_KP_PERCENT,
SDLK_KP_LESS = SDL3.SDLK_KP_LESS,
SDLK_KP_GREATER = SDL3.SDLK_KP_GREATER,
SDLK_KP_AMPERSAND = SDL3.SDLK_KP_AMPERSAND,
SDLK_KP_DBLAMPERSAND = SDL3.SDLK_KP_DBLAMPERSAND,
SDLK_KP_VERTICALBAR = SDL3.SDLK_KP_VERTICALBAR,
SDLK_KP_DBLVERTICALBAR = SDL3.SDLK_KP_DBLVERTICALBAR,
SDLK_KP_COLON = SDL3.SDLK_KP_COLON,
SDLK_KP_HASH = SDL3.SDLK_KP_HASH,
SDLK_KP_SPACE = SDL3.SDLK_KP_SPACE,
SDLK_KP_AT = SDL3.SDLK_KP_AT,
SDLK_KP_EXCLAM = SDL3.SDLK_KP_EXCLAM,
SDLK_KP_MEMSTORE = SDL3.SDLK_KP_MEMSTORE,
SDLK_KP_MEMRECALL = SDL3.SDLK_KP_MEMRECALL,
SDLK_KP_MEMCLEAR = SDL3.SDLK_KP_MEMCLEAR,
@ -169,6 +209,7 @@ namespace SDL
SDLK_KP_MEMSUBTRACT = SDL3.SDLK_KP_MEMSUBTRACT,
SDLK_KP_MEMMULTIPLY = SDL3.SDLK_KP_MEMMULTIPLY,
SDLK_KP_MEMDIVIDE = SDL3.SDLK_KP_MEMDIVIDE,
SDLK_KP_PLUSMINUS = SDL3.SDLK_KP_PLUSMINUS,
SDLK_KP_CLEAR = SDL3.SDLK_KP_CLEAR,
SDLK_KP_CLEARENTRY = SDL3.SDLK_KP_CLEARENTRY,
SDLK_KP_BINARY = SDL3.SDLK_KP_BINARY,

View File

@ -5,7 +5,7 @@ using System;
namespace SDL
{
using static SDL_PixelFormatEnum;
using static SDL_PixelFormat;
using static SDL_PixelType;
using static SDL_PackedOrder;
using static SDL_PackedLayout;
@ -15,30 +15,30 @@ namespace SDL
public static partial class SDL3
{
[Macro]
public static SDL_PixelFormatEnum SDL_DEFINE_PIXELFOURCC(byte A, byte B, byte C, byte D) => (SDL_PixelFormatEnum)SDL_FOURCC(A, B, C, D);
public static SDL_PixelFormat SDL_DEFINE_PIXELFOURCC(byte A, byte B, byte C, byte D) => (SDL_PixelFormat)SDL_FOURCC(A, B, C, D);
[Macro]
public static SDL_PixelFormatEnum SDL_DEFINE_PIXELFORMAT(int type, int order, int layout, int bits, int bytes)
=> (SDL_PixelFormatEnum)((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) |
((bits) << 8) | ((bytes) << 0));
public static SDL_PixelFormat SDL_DEFINE_PIXELFORMAT(int type, int order, int layout, int bits, int bytes)
=> (SDL_PixelFormat)((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) |
((bits) << 8) | ((bytes) << 0));
[Macro]
public static int SDL_PIXELFLAG(SDL_PixelFormatEnum X) => ((int)X >> 28) & 0x0F;
public static int SDL_PIXELFLAG(SDL_PixelFormat X) => ((int)X >> 28) & 0x0F;
[Macro]
public static SDL_PixelType SDL_PIXELTYPE(SDL_PixelFormatEnum X) => (SDL_PixelType)(((int)X >> 24) & 0x0F);
public static SDL_PixelType SDL_PIXELTYPE(SDL_PixelFormat X) => (SDL_PixelType)(((int)X >> 24) & 0x0F);
[Macro]
public static SDL_PackedOrder SDL_PIXELORDER(SDL_PixelFormatEnum X) => (SDL_PackedOrder)(((int)X >> 20) & 0x0F);
public static SDL_PackedOrder SDL_PIXELORDER(SDL_PixelFormat X) => (SDL_PackedOrder)(((int)X >> 20) & 0x0F);
[Macro]
public static SDL_PackedLayout SDL_PIXELLAYOUT(SDL_PixelFormatEnum X) => (SDL_PackedLayout)(((int)X >> 16) & 0x0F);
public static SDL_PackedLayout SDL_PIXELLAYOUT(SDL_PixelFormat X) => (SDL_PackedLayout)(((int)X >> 16) & 0x0F);
[Macro]
public static int SDL_BITSPERPIXEL(SDL_PixelFormatEnum X) => ((int)X >> 8) & 0xFF;
public static int SDL_BITSPERPIXEL(SDL_PixelFormat X) => ((int)X >> 8) & 0xFF;
[Macro]
public static int SDL_BYTESPERPIXEL(SDL_PixelFormatEnum X) =>
public static int SDL_BYTESPERPIXEL(SDL_PixelFormat X) =>
(SDL_ISPIXELFORMAT_FOURCC(X)
? ((((X) == SDL_PIXELFORMAT_YUY2) ||
((X) == SDL_PIXELFORMAT_UYVY) ||
@ -49,7 +49,7 @@ namespace SDL
: ((((int)X) >> 0) & 0xFF));
[Macro]
public static bool SDL_ISPIXELFORMAT_INDEXED(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_INDEXED(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) ||
@ -57,14 +57,14 @@ namespace SDL
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)));
[Macro]
public static bool SDL_ISPIXELFORMAT_PACKED(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_PACKED(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)));
[Macro]
public static bool SDL_ISPIXELFORMAT_ARRAY(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_ARRAY(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) ||
@ -73,7 +73,7 @@ namespace SDL
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)));
[Macro]
public static bool SDL_ISPIXELFORMAT_ALPHA(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_ALPHA(SDL_PixelFormat format) =>
((SDL_ISPIXELFORMAT_PACKED(format) &&
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) ||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) ||
@ -81,19 +81,19 @@ namespace SDL
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))));
[Macro]
public static bool SDL_ISPIXELFORMAT_10BIT(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_10BIT(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32) &&
(SDL_PIXELLAYOUT(format) == SDL_PACKEDLAYOUT_2101010)));
[Macro]
public static bool SDL_ISPIXELFORMAT_FLOAT(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_FLOAT(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)));
[Macro]
public static bool SDL_ISPIXELFORMAT_FOURCC(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_FOURCC(SDL_PixelFormat format) =>
((format != 0) && (SDL_PIXELFLAG(format) != 1));
[Macro]

View File

@ -4,4 +4,4 @@
# Fix errors with uint -> int conversion
--with-type
SDL_Colorspace=uint
SDL_PixelFormatEnum=uint
SDL_PixelFormat=uint

View File

@ -9,16 +9,15 @@ namespace SDL
[Typedef]
public enum SDL_SurfaceFlags : UInt32
{
SDL_PREALLOC = SDL3.SDL_PREALLOC,
SDL_RLEACCEL = SDL3.SDL_RLEACCEL,
SDL_DONTFREE = SDL3.SDL_DONTFREE,
SDL_SIMD_ALIGNED = SDL3.SDL_SIMD_ALIGNED,
SDL_SURFACE_USES_PROPERTIES = SDL3.SDL_SURFACE_USES_PROPERTIES,
SDL_SURFACE_PREALLOCATED = SDL3.SDL_SURFACE_PREALLOCATED,
SDL_SURFACE_LOCK_NEEDED = SDL3.SDL_SURFACE_LOCK_NEEDED,
SDL_SURFACE_LOCKED = SDL3.SDL_SURFACE_LOCKED,
SDL_SURFACE_SIMD_ALIGNED = SDL3.SDL_SURFACE_SIMD_ALIGNED
}
public static partial class SDL3
{
[Macro]
public static unsafe bool SDL_MUSTLOCK(SDL_Surface* S) => (((S)->flags & SDL_SurfaceFlags.SDL_RLEACCEL) != 0);
public static unsafe bool SDL_MUSTLOCK(SDL_Surface* S) => ((uint)S->flags & (SDL_SURFACE_LOCK_NEEDED | SDL_SURFACE_LOCKED)) == SDL_SURFACE_LOCK_NEEDED;
}
}