From 818375b78e8c7f73de8a8a1a17d752e03baaf514 Mon Sep 17 00:00:00 2001 From: Peterino2 Date: Thu, 22 Jan 2026 16:58:31 -0800 Subject: [PATCH] Fix memory leaks in parser - Add defer and errdefer to free comment allocations in parseStructField - Add defer to free comment allocation in parseMultiFieldLine - Add manual free calls on all early return paths - Ensure all allocated comments are properly freed even on error or null returns --- lib/sdl3/parser/src/patterns.zig | 30 ++++- lib/sdl3/parser/test_audio.json | 81 +++++++++++++ lib/sdl3/parser/test_gpu.json | 189 +++++++++++++++++++++++++++++ lib/sdl3/parser/test_keyboard.json | 46 +++++++ lib/sdl3/parser/test_video.json | 143 ++++++++++++++++++++++ 5 files changed, 484 insertions(+), 5 deletions(-) create mode 100644 lib/sdl3/parser/test_audio.json create mode 100644 lib/sdl3/parser/test_gpu.json create mode 100644 lib/sdl3/parser/test_keyboard.json create mode 100644 lib/sdl3/parser/test_video.json diff --git a/lib/sdl3/parser/src/patterns.zig b/lib/sdl3/parser/src/patterns.zig index ff119d4..17f32ce 100644 --- a/lib/sdl3/parser/src/patterns.zig +++ b/lib/sdl3/parser/src/patterns.zig @@ -666,6 +666,8 @@ pub const Scanner = struct { // Extract inline comment var comment: ?[]const u8 = null; + errdefer if (comment) |c| self.allocator.free(c); + var field_part = no_semi; if (std.mem.indexOf(u8, no_semi, "/**<")) |comment_start| { field_part = std.mem.trimRight(u8, no_semi[0..comment_start], "; \t"); @@ -688,6 +690,7 @@ pub const Scanner = struct { // This is a multi-field declaration like "int x, y" // We'll return just the first field and rely on a helper to get the rest // For now, return null and let the caller handle it with parseMultiFieldLine + if (comment) |c| self.allocator.free(c); return null; } @@ -710,13 +713,19 @@ pub const Scanner = struct { var parts_count: usize = 0; while (tokens.next()) |token| { if (token.len > 0 and !std.mem.eql(u8, token, "const")) { - if (parts_count >= 8) return null; + if (parts_count >= 8) { + if (comment) |c| self.allocator.free(c); + return null; + } parts_list[parts_count] = token; parts_count += 1; } } - if (parts_count < 2) return null; // Need at least type and name + if (parts_count < 2) { + if (comment) |c| self.allocator.free(c); + return null; // Need at least type and name + } const name = parts_list[parts_count - 1]; const type_parts = parts_list[0..parts_count - 1]; @@ -726,10 +735,19 @@ pub const Scanner = struct { var fbs = std.io.fixedBufferStream(&type_buf); const writer = fbs.writer(); for (type_parts, 0..) |part, i| { - if (i > 0) writer.writeByte(' ') catch return null; - writer.writeAll(part) catch return null; + if (i > 0) writer.writeByte(' ') catch { + if (comment) |c| self.allocator.free(c); + return null; + }; + writer.writeAll(part) catch { + if (comment) |c| self.allocator.free(c); + return null; + }; } - writer.writeAll(bracket_part) catch return null; + writer.writeAll(bracket_part) catch { + if (comment) |c| self.allocator.free(c); + return null; + }; const type_str = fbs.getWritten(); @@ -784,6 +802,7 @@ pub const Scanner = struct { } } + if (comment) |c| self.allocator.free(c); return null; } @@ -809,6 +828,7 @@ pub const Scanner = struct { comment = try self.allocator.dupe(u8, std.mem.trim(u8, comment_text, " \t")); } } + defer if (comment) |c| self.allocator.free(c); const field_trimmed = std.mem.trim(u8, field_part, " \t"); diff --git a/lib/sdl3/parser/test_audio.json b/lib/sdl3/parser/test_audio.json new file mode 100644 index 0000000..f99e2fc --- /dev/null +++ b/lib/sdl3/parser/test_audio.json @@ -0,0 +1,81 @@ +{ + "header": "SDL_audio.h", + "opaque_types": [ + {"name": "SDL_AudioStream"} + ], + "typedefs": [ + {"name": "SDL_AudioDeviceID", "underlying_type": "Uint32"} + ], + "function_pointers": [ + {"name": "SDL_AudioStreamCallback", "return_type": "void", "parameters": [{"name": "userdata", "type": "void *"}, {"name": "stream", "type": "SDL_AudioStream *"}, {"name": "additional_amount", "type": "int"}, {"name": "total_amount", "type": "int"}]}, + {"name": "SDL_AudioPostmixCallback", "return_type": "void", "parameters": [{"name": "userdata", "type": "void *"}, {"name": "spec", "type": "const SDL_AudioSpec *"}, {"name": "buffer", "type": "float *"}, {"name": "buflen", "type": "int"}]} + ], + "enums": [ + {"name": "SDL_AudioFormat", "values": [{"name": "SDL_AUDIO_S16", "value": "SDL_AUDIO_S16LE"}, {"name": "SDL_AUDIO_S32", "value": "SDL_AUDIO_S32LE"}, {"name": "SDL_AUDIO_F32", "value": "SDL_AUDIO_F32LE"}]} + ], + "structs": [ + {"name": "SDL_AudioSpec", "fields": [{"name": "format", "type": "SDL_AudioFormat", "comment": "Audio data format"}, {"name": "channels", "type": "int", "comment": "Number of channels: 1 mono, 2 stereo, etc"}, {"name": "freq", "type": "int", "comment": "sample rate: sample frames per second"}]} + ], + "unions": [ + ], + "flags": [ + ], + "functions": [ + {"name": "SDL_GetNumAudioDrivers", "return_type": "int", "parameters": []}, + {"name": "SDL_GetAudioDriver", "return_type": "const char *", "parameters": [{"name": "index", "type": "int"}]}, + {"name": "SDL_GetCurrentAudioDriver", "return_type": "const char *", "parameters": []}, + {"name": "SDL_GetAudioPlaybackDevices", "return_type": "SDL_AudioDeviceID *", "parameters": [{"name": "count", "type": "int *"}]}, + {"name": "SDL_GetAudioRecordingDevices", "return_type": "SDL_AudioDeviceID *", "parameters": [{"name": "count", "type": "int *"}]}, + {"name": "SDL_GetAudioDeviceName", "return_type": "const char *", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_GetAudioDeviceFormat", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "spec", "type": "SDL_AudioSpec *"}, {"name": "sample_frames", "type": "int *"}]}, + {"name": "SDL_GetAudioDeviceChannelMap", "return_type": "int *", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "count", "type": "int *"}]}, + {"name": "SDL_OpenAudioDevice", "return_type": "SDL_AudioDeviceID", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "spec", "type": "const SDL_AudioSpec *"}]}, + {"name": "SDL_IsAudioDevicePhysical", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_IsAudioDevicePlayback", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_PauseAudioDevice", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_ResumeAudioDevice", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_AudioDevicePaused", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_GetAudioDeviceGain", "return_type": "float", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_SetAudioDeviceGain", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "gain", "type": "float"}]}, + {"name": "SDL_CloseAudioDevice", "return_type": "void", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]}, + {"name": "SDL_BindAudioStreams", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "streams", "type": "SDL_AudioStream * const *"}, {"name": "num_streams", "type": "int"}]}, + {"name": "SDL_BindAudioStream", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_UnbindAudioStreams", "return_type": "void", "parameters": [{"name": "streams", "type": "SDL_AudioStream * const *"}, {"name": "num_streams", "type": "int"}]}, + {"name": "SDL_UnbindAudioStream", "return_type": "void", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_GetAudioStreamDevice", "return_type": "SDL_AudioDeviceID", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_CreateAudioStream", "return_type": "SDL_AudioStream *", "parameters": [{"name": "src_spec", "type": "const SDL_AudioSpec *"}, {"name": "dst_spec", "type": "const SDL_AudioSpec *"}]}, + {"name": "SDL_GetAudioStreamProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_GetAudioStreamFormat", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "src_spec", "type": "SDL_AudioSpec *"}, {"name": "dst_spec", "type": "SDL_AudioSpec *"}]}, + {"name": "SDL_SetAudioStreamFormat", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "src_spec", "type": "const SDL_AudioSpec *"}, {"name": "dst_spec", "type": "const SDL_AudioSpec *"}]}, + {"name": "SDL_GetAudioStreamFrequencyRatio", "return_type": "float", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_SetAudioStreamFrequencyRatio", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "ratio", "type": "float"}]}, + {"name": "SDL_GetAudioStreamGain", "return_type": "float", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_SetAudioStreamGain", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "gain", "type": "float"}]}, + {"name": "SDL_GetAudioStreamInputChannelMap", "return_type": "int *", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "count", "type": "int *"}]}, + {"name": "SDL_GetAudioStreamOutputChannelMap", "return_type": "int *", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "count", "type": "int *"}]}, + {"name": "SDL_SetAudioStreamInputChannelMap", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "chmap", "type": "const int *"}, {"name": "count", "type": "int"}]}, + {"name": "SDL_SetAudioStreamOutputChannelMap", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "chmap", "type": "const int *"}, {"name": "count", "type": "int"}]}, + {"name": "SDL_PutAudioStreamData", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "buf", "type": "const void *"}, {"name": "len", "type": "int"}]}, + {"name": "SDL_GetAudioStreamData", "return_type": "int", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "buf", "type": "void *"}, {"name": "len", "type": "int"}]}, + {"name": "SDL_GetAudioStreamAvailable", "return_type": "int", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_GetAudioStreamQueued", "return_type": "int", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_FlushAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_ClearAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_PauseAudioStreamDevice", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_ResumeAudioStreamDevice", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_AudioStreamDevicePaused", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_LockAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_UnlockAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_SetAudioStreamGetCallback", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "callback", "type": "SDL_AudioStreamCallback"}, {"name": "userdata", "type": "void *"}]}, + {"name": "SDL_SetAudioStreamPutCallback", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "callback", "type": "SDL_AudioStreamCallback"}, {"name": "userdata", "type": "void *"}]}, + {"name": "SDL_DestroyAudioStream", "return_type": "void", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]}, + {"name": "SDL_OpenAudioDeviceStream", "return_type": "SDL_AudioStream *", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "spec", "type": "const SDL_AudioSpec *"}, {"name": "callback", "type": "SDL_AudioStreamCallback"}, {"name": "userdata", "type": "void *"}]}, + {"name": "SDL_SetAudioPostmixCallback", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "callback", "type": "SDL_AudioPostmixCallback"}, {"name": "userdata", "type": "void *"}]}, + {"name": "SDL_LoadWAV_IO", "return_type": "bool", "parameters": [{"name": "src", "type": "SDL_IOStream *"}, {"name": "closeio", "type": "bool"}, {"name": "spec", "type": "SDL_AudioSpec *"}, {"name": "audio_buf", "type": "Uint8 **"}, {"name": "audio_len", "type": "Uint32 *"}]}, + {"name": "SDL_LoadWAV", "return_type": "bool", "parameters": [{"name": "path", "type": "const char *"}, {"name": "spec", "type": "SDL_AudioSpec *"}, {"name": "audio_buf", "type": "Uint8 **"}, {"name": "audio_len", "type": "Uint32 *"}]}, + {"name": "SDL_MixAudio", "return_type": "bool", "parameters": [{"name": "dst", "type": "Uint8 *"}, {"name": "src", "type": "const Uint8 *"}, {"name": "format", "type": "SDL_AudioFormat"}, {"name": "len", "type": "Uint32"}, {"name": "volume", "type": "float"}]}, + {"name": "SDL_ConvertAudioSamples", "return_type": "bool", "parameters": [{"name": "src_spec", "type": "const SDL_AudioSpec *"}, {"name": "src_data", "type": "const Uint8 *"}, {"name": "src_len", "type": "int"}, {"name": "dst_spec", "type": "const SDL_AudioSpec *"}, {"name": "dst_data", "type": "Uint8 **"}, {"name": "dst_len", "type": "int *"}]}, + {"name": "SDL_GetAudioFormatName", "return_type": "const char *", "parameters": [{"name": "format", "type": "SDL_AudioFormat"}]}, + {"name": "SDL_GetSilenceValueForFormat", "return_type": "int", "parameters": [{"name": "format", "type": "SDL_AudioFormat"}]} + ] +} diff --git a/lib/sdl3/parser/test_gpu.json b/lib/sdl3/parser/test_gpu.json new file mode 100644 index 0000000..0bf05c3 --- /dev/null +++ b/lib/sdl3/parser/test_gpu.json @@ -0,0 +1,189 @@ +{ + "header": "SDL_gpu.h", + "opaque_types": [ + {"name": "SDL_GPUDevice"}, + {"name": "SDL_GPUBuffer"}, + {"name": "SDL_GPUTransferBuffer"}, + {"name": "SDL_GPUTexture"}, + {"name": "SDL_GPUSampler"}, + {"name": "SDL_GPUShader"}, + {"name": "SDL_GPUComputePipeline"}, + {"name": "SDL_GPUGraphicsPipeline"}, + {"name": "SDL_GPUCommandBuffer"}, + {"name": "SDL_GPURenderPass"}, + {"name": "SDL_GPUComputePass"}, + {"name": "SDL_GPUCopyPass"}, + {"name": "SDL_GPUFence"} + ], + "typedefs": [ + {"name": "SDL_GPUShaderFormat", "underlying_type": "Uint32"} + ], + "function_pointers": [ + ], + "enums": [ + {"name": "SDL_GPUPrimitiveType", "values": []}, + {"name": "SDL_GPULoadOp", "values": []}, + {"name": "SDL_GPUStoreOp", "values": []}, + {"name": "SDL_GPUIndexElementSize", "values": []}, + {"name": "SDL_GPUTextureFormat", "values": [{"name": "SDL_GPU_TEXTUREFORMAT_INVALID"}, {"name": "SDL_GPU_TEXTUREFORMAT_A8_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8_SNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8_SNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16_SNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16_SNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32G32_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32G32_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT"}, {"name": "SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_D16_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT"}, {"name": "SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT"}]}, + {"name": "SDL_GPUTextureType", "values": []}, + {"name": "SDL_GPUSampleCount", "values": []}, + {"name": "SDL_GPUCubeMapFace", "values": [{"name": "SDL_GPU_CUBEMAPFACE_POSITIVEX"}, {"name": "SDL_GPU_CUBEMAPFACE_NEGATIVEX"}, {"name": "SDL_GPU_CUBEMAPFACE_POSITIVEY"}, {"name": "SDL_GPU_CUBEMAPFACE_NEGATIVEY"}, {"name": "SDL_GPU_CUBEMAPFACE_POSITIVEZ"}, {"name": "SDL_GPU_CUBEMAPFACE_NEGATIVEZ"}]}, + {"name": "SDL_GPUTransferBufferUsage", "values": [{"name": "SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD"}, {"name": "SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD"}]}, + {"name": "SDL_GPUShaderStage", "values": [{"name": "SDL_GPU_SHADERSTAGE_VERTEX"}, {"name": "SDL_GPU_SHADERSTAGE_FRAGMENT"}]}, + {"name": "SDL_GPUVertexElementFormat", "values": [{"name": "SDL_GPU_VERTEXELEMENTFORMAT_INVALID"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_INT"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_INT2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_INT3"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_INT4"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT3"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UINT4"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF2"}, {"name": "SDL_GPU_VERTEXELEMENTFORMAT_HALF4"}]}, + {"name": "SDL_GPUVertexInputRate", "values": []}, + {"name": "SDL_GPUFillMode", "values": []}, + {"name": "SDL_GPUCullMode", "values": []}, + {"name": "SDL_GPUFrontFace", "values": []}, + {"name": "SDL_GPUCompareOp", "values": [{"name": "SDL_GPU_COMPAREOP_INVALID"}]}, + {"name": "SDL_GPUStencilOp", "values": [{"name": "SDL_GPU_STENCILOP_INVALID"}]}, + {"name": "SDL_GPUBlendOp", "values": [{"name": "SDL_GPU_BLENDOP_INVALID"}]}, + {"name": "SDL_GPUBlendFactor", "values": [{"name": "SDL_GPU_BLENDFACTOR_INVALID"}]}, + {"name": "SDL_GPUFilter", "values": []}, + {"name": "SDL_GPUSamplerMipmapMode", "values": []}, + {"name": "SDL_GPUSamplerAddressMode", "values": []}, + {"name": "SDL_GPUPresentMode", "values": [{"name": "SDL_GPU_PRESENTMODE_VSYNC"}, {"name": "SDL_GPU_PRESENTMODE_IMMEDIATE"}, {"name": "SDL_GPU_PRESENTMODE_MAILBOX"}]}, + {"name": "SDL_GPUSwapchainComposition", "values": [{"name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR"}, {"name": "SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR"}, {"name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR"}, {"name": "SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084"}]} + ], + "structs": [ + {"name": "SDL_GPUViewport", "fields": [{"name": "x", "type": "float", "comment": "The left offset of the viewport."}, {"name": "y", "type": "float", "comment": "The top offset of the viewport."}, {"name": "w", "type": "float", "comment": "The width of the viewport."}, {"name": "h", "type": "float", "comment": "The height of the viewport."}, {"name": "min_depth", "type": "float", "comment": "The minimum depth of the viewport."}, {"name": "max_depth", "type": "float", "comment": "The maximum depth of the viewport."}]}, + {"name": "SDL_GPUTextureTransferInfo", "fields": [{"name": "transfer_buffer", "type": "SDL_GPUTransferBuffer *", "comment": "The transfer buffer used in the transfer operation."}, {"name": "offset", "type": "Uint32", "comment": "The starting byte of the image data in the transfer buffer."}, {"name": "pixels_per_row", "type": "Uint32", "comment": "The number of pixels from one row to the next."}, {"name": "rows_per_layer", "type": "Uint32", "comment": "The number of rows from one layer/depth-slice to the next."}]}, + {"name": "SDL_GPUTransferBufferLocation", "fields": [{"name": "transfer_buffer", "type": "SDL_GPUTransferBuffer *", "comment": "The transfer buffer used in the transfer operation."}, {"name": "offset", "type": "Uint32", "comment": "The starting byte of the buffer data in the transfer buffer."}]}, + {"name": "SDL_GPUTextureLocation", "fields": [{"name": "texture", "type": "SDL_GPUTexture *", "comment": "The texture used in the copy operation."}, {"name": "mip_level", "type": "Uint32", "comment": "The mip level index of the location."}, {"name": "layer", "type": "Uint32", "comment": "The layer index of the location."}, {"name": "x", "type": "Uint32", "comment": "The left offset of the location."}, {"name": "y", "type": "Uint32", "comment": "The top offset of the location."}, {"name": "z", "type": "Uint32", "comment": "The front offset of the location."}]}, + {"name": "SDL_GPUTextureRegion", "fields": [{"name": "texture", "type": "SDL_GPUTexture *", "comment": "The texture used in the copy operation."}, {"name": "mip_level", "type": "Uint32", "comment": "The mip level index to transfer."}, {"name": "layer", "type": "Uint32", "comment": "The layer index to transfer."}, {"name": "x", "type": "Uint32", "comment": "The left offset of the region."}, {"name": "y", "type": "Uint32", "comment": "The top offset of the region."}, {"name": "z", "type": "Uint32", "comment": "The front offset of the region."}, {"name": "w", "type": "Uint32", "comment": "The width of the region."}, {"name": "h", "type": "Uint32", "comment": "The height of the region."}, {"name": "d", "type": "Uint32", "comment": "The depth of the region."}]}, + {"name": "SDL_GPUBlitRegion", "fields": [{"name": "texture", "type": "SDL_GPUTexture *", "comment": "The texture."}, {"name": "mip_level", "type": "Uint32", "comment": "The mip level index of the region."}, {"name": "layer_or_depth_plane", "type": "Uint32", "comment": "The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures."}, {"name": "x", "type": "Uint32", "comment": "The left offset of the region."}, {"name": "y", "type": "Uint32", "comment": "The top offset of the region."}, {"name": "w", "type": "Uint32", "comment": "The width of the region."}, {"name": "h", "type": "Uint32", "comment": "The height of the region."}]}, + {"name": "SDL_GPUBufferLocation", "fields": [{"name": "buffer", "type": "SDL_GPUBuffer *", "comment": "The buffer."}, {"name": "offset", "type": "Uint32", "comment": "The starting byte within the buffer."}]}, + {"name": "SDL_GPUBufferRegion", "fields": [{"name": "buffer", "type": "SDL_GPUBuffer *", "comment": "The buffer."}, {"name": "offset", "type": "Uint32", "comment": "The starting byte within the buffer."}, {"name": "size", "type": "Uint32", "comment": "The size in bytes of the region."}]}, + {"name": "SDL_GPUIndirectDrawCommand", "fields": [{"name": "num_vertices", "type": "Uint32", "comment": "The number of vertices to draw."}, {"name": "num_instances", "type": "Uint32", "comment": "The number of instances to draw."}, {"name": "first_vertex", "type": "Uint32", "comment": "The index of the first vertex to draw."}, {"name": "first_instance", "type": "Uint32", "comment": "The ID of the first instance to draw."}]}, + {"name": "SDL_GPUIndexedIndirectDrawCommand", "fields": [{"name": "num_indices", "type": "Uint32", "comment": "The number of indices to draw per instance."}, {"name": "num_instances", "type": "Uint32", "comment": "The number of instances to draw."}, {"name": "first_index", "type": "Uint32", "comment": "The base index within the index buffer."}, {"name": "vertex_offset", "type": "Sint32", "comment": "The value added to the vertex index before indexing into the vertex buffer."}, {"name": "first_instance", "type": "Uint32", "comment": "The ID of the first instance to draw."}]}, + {"name": "SDL_GPUIndirectDispatchCommand", "fields": [{"name": "groupcount_x", "type": "Uint32", "comment": "The number of local workgroups to dispatch in the X dimension."}, {"name": "groupcount_y", "type": "Uint32", "comment": "The number of local workgroups to dispatch in the Y dimension."}, {"name": "groupcount_z", "type": "Uint32", "comment": "The number of local workgroups to dispatch in the Z dimension."}]}, + {"name": "SDL_GPUSamplerCreateInfo", "fields": [{"name": "min_filter", "type": "SDL_GPUFilter", "comment": "The minification filter to apply to lookups."}, {"name": "mag_filter", "type": "SDL_GPUFilter", "comment": "The magnification filter to apply to lookups."}, {"name": "mipmap_mode", "type": "SDL_GPUSamplerMipmapMode", "comment": "The mipmap filter to apply to lookups."}, {"name": "address_mode_u", "type": "SDL_GPUSamplerAddressMode", "comment": "The addressing mode for U coordinates outside [0, 1)."}, {"name": "address_mode_v", "type": "SDL_GPUSamplerAddressMode", "comment": "The addressing mode for V coordinates outside [0, 1)."}, {"name": "address_mode_w", "type": "SDL_GPUSamplerAddressMode", "comment": "The addressing mode for W coordinates outside [0, 1)."}, {"name": "mip_lod_bias", "type": "float", "comment": "The bias to be added to mipmap LOD calculation."}, {"name": "max_anisotropy", "type": "float", "comment": "The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored."}, {"name": "compare_op", "type": "SDL_GPUCompareOp", "comment": "The comparison operator to apply to fetched data before filtering."}, {"name": "min_lod", "type": "float", "comment": "Clamps the minimum of the computed LOD value."}, {"name": "max_lod", "type": "float", "comment": "Clamps the maximum of the computed LOD value."}, {"name": "enable_anisotropy", "type": "bool", "comment": "true to enable anisotropic filtering."}, {"name": "enable_compare", "type": "bool", "comment": "true to enable comparison against a reference value during lookups."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}, {"name": "props", "type": "SDL_PropertiesID", "comment": "A properties ID for extensions. Should be 0 if no extensions are needed."}]}, + {"name": "SDL_GPUVertexBufferDescription", "fields": [{"name": "slot", "type": "Uint32", "comment": "The binding slot of the vertex buffer."}, {"name": "pitch", "type": "Uint32", "comment": "The byte pitch between consecutive elements of the vertex buffer."}, {"name": "input_rate", "type": "SDL_GPUVertexInputRate", "comment": "Whether attribute addressing is a function of the vertex index or instance index."}, {"name": "instance_step_rate", "type": "Uint32", "comment": "Reserved for future use. Must be set to 0."}]}, + {"name": "SDL_GPUVertexAttribute", "fields": [{"name": "location", "type": "Uint32", "comment": "The shader input location index."}, {"name": "buffer_slot", "type": "Uint32", "comment": "The binding slot of the associated vertex buffer."}, {"name": "format", "type": "SDL_GPUVertexElementFormat", "comment": "The size and type of the attribute data."}, {"name": "offset", "type": "Uint32", "comment": "The byte offset of this attribute relative to the start of the vertex element."}]}, + {"name": "SDL_GPUVertexInputState", "fields": [{"name": "vertex_buffer_descriptions", "type": "const SDL_GPUVertexBufferDescription *", "comment": "A pointer to an array of vertex buffer descriptions."}, {"name": "num_vertex_buffers", "type": "Uint32", "comment": "The number of vertex buffer descriptions in the above array."}, {"name": "vertex_attributes", "type": "const SDL_GPUVertexAttribute *", "comment": "A pointer to an array of vertex attribute descriptions."}, {"name": "num_vertex_attributes", "type": "Uint32", "comment": "The number of vertex attribute descriptions in the above array."}]}, + {"name": "SDL_GPUStencilOpState", "fields": [{"name": "fail_op", "type": "SDL_GPUStencilOp", "comment": "The action performed on samples that fail the stencil test."}, {"name": "pass_op", "type": "SDL_GPUStencilOp", "comment": "The action performed on samples that pass the depth and stencil tests."}, {"name": "depth_fail_op", "type": "SDL_GPUStencilOp", "comment": "The action performed on samples that pass the stencil test and fail the depth test."}, {"name": "compare_op", "type": "SDL_GPUCompareOp", "comment": "The comparison operator used in the stencil test."}]}, + {"name": "SDL_GPUColorTargetBlendState", "fields": [{"name": "src_color_blendfactor", "type": "SDL_GPUBlendFactor", "comment": "The value to be multiplied by the source RGB value."}, {"name": "dst_color_blendfactor", "type": "SDL_GPUBlendFactor", "comment": "The value to be multiplied by the destination RGB value."}, {"name": "color_blend_op", "type": "SDL_GPUBlendOp", "comment": "The blend operation for the RGB components."}, {"name": "src_alpha_blendfactor", "type": "SDL_GPUBlendFactor", "comment": "The value to be multiplied by the source alpha."}, {"name": "dst_alpha_blendfactor", "type": "SDL_GPUBlendFactor", "comment": "The value to be multiplied by the destination alpha."}, {"name": "alpha_blend_op", "type": "SDL_GPUBlendOp", "comment": "The blend operation for the alpha component."}, {"name": "color_write_mask", "type": "SDL_GPUColorComponentFlags", "comment": "A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false."}, {"name": "enable_blend", "type": "bool", "comment": "Whether blending is enabled for the color target."}, {"name": "enable_color_write_mask", "type": "bool", "comment": "Whether the color write mask is enabled."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}]}, + {"name": "SDL_GPUShaderCreateInfo", "fields": [{"name": "code_size", "type": "size_t", "comment": "The size in bytes of the code pointed to."}, {"name": "code", "type": "const Uint8 *", "comment": "A pointer to shader code."}, {"name": "entrypoint", "type": "const char *", "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader."}, {"name": "format", "type": "SDL_GPUShaderFormat", "comment": "The format of the shader code."}, {"name": "stage", "type": "SDL_GPUShaderStage", "comment": "The stage the shader program corresponds to."}, {"name": "num_samplers", "type": "Uint32", "comment": "The number of samplers defined in the shader."}, {"name": "num_storage_textures", "type": "Uint32", "comment": "The number of storage textures defined in the shader."}, {"name": "num_storage_buffers", "type": "Uint32", "comment": "The number of storage buffers defined in the shader."}, {"name": "num_uniform_buffers", "type": "Uint32", "comment": "The number of uniform buffers defined in the shader."}, {"name": "props", "type": "SDL_PropertiesID", "comment": "A properties ID for extensions. Should be 0 if no extensions are needed."}]}, + {"name": "SDL_GPUTextureCreateInfo", "fields": [{"name": "type", "type": "SDL_GPUTextureType", "comment": "The base dimensionality of the texture."}, {"name": "format", "type": "SDL_GPUTextureFormat", "comment": "The pixel format of the texture."}, {"name": "usage", "type": "SDL_GPUTextureUsageFlags", "comment": "How the texture is intended to be used by the client."}, {"name": "width", "type": "Uint32", "comment": "The width of the texture."}, {"name": "height", "type": "Uint32", "comment": "The height of the texture."}, {"name": "layer_count_or_depth", "type": "Uint32", "comment": "The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures."}, {"name": "num_levels", "type": "Uint32", "comment": "The number of mip levels in the texture."}, {"name": "sample_count", "type": "SDL_GPUSampleCount", "comment": "The number of samples per texel. Only applies if the texture is used as a render target."}, {"name": "props", "type": "SDL_PropertiesID", "comment": "A properties ID for extensions. Should be 0 if no extensions are needed."}]}, + {"name": "SDL_GPUBufferCreateInfo", "fields": [{"name": "usage", "type": "SDL_GPUBufferUsageFlags", "comment": "How the buffer is intended to be used by the client."}, {"name": "size", "type": "Uint32", "comment": "The size in bytes of the buffer."}, {"name": "props", "type": "SDL_PropertiesID", "comment": "A properties ID for extensions. Should be 0 if no extensions are needed."}]}, + {"name": "SDL_GPUTransferBufferCreateInfo", "fields": [{"name": "usage", "type": "SDL_GPUTransferBufferUsage", "comment": "How the transfer buffer is intended to be used by the client."}, {"name": "size", "type": "Uint32", "comment": "The size in bytes of the transfer buffer."}, {"name": "props", "type": "SDL_PropertiesID", "comment": "A properties ID for extensions. Should be 0 if no extensions are needed."}]}, + {"name": "SDL_GPURasterizerState", "fields": [{"name": "fill_mode", "type": "SDL_GPUFillMode", "comment": "Whether polygons will be filled in or drawn as lines."}, {"name": "cull_mode", "type": "SDL_GPUCullMode", "comment": "The facing direction in which triangles will be culled."}, {"name": "front_face", "type": "SDL_GPUFrontFace", "comment": "The vertex winding that will cause a triangle to be determined as front-facing."}, {"name": "depth_bias_constant_factor", "type": "float", "comment": "A scalar factor controlling the depth value added to each fragment."}, {"name": "depth_bias_clamp", "type": "float", "comment": "The maximum depth bias of a fragment."}, {"name": "depth_bias_slope_factor", "type": "float", "comment": "A scalar factor applied to a fragment's slope in depth calculations."}, {"name": "enable_depth_bias", "type": "bool", "comment": "true to bias fragment depth values."}, {"name": "enable_depth_clip", "type": "bool", "comment": "true to enable depth clip, false to enable depth clamp."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}]}, + {"name": "SDL_GPUMultisampleState", "fields": [{"name": "sample_count", "type": "SDL_GPUSampleCount", "comment": "The number of samples to be used in rasterization."}, {"name": "sample_mask", "type": "Uint32", "comment": "Reserved for future use. Must be set to 0."}, {"name": "enable_mask", "type": "bool", "comment": "Reserved for future use. Must be set to false."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}, {"name": "padding3", "type": "Uint8"}]}, + {"name": "SDL_GPUDepthStencilState", "fields": [{"name": "compare_op", "type": "SDL_GPUCompareOp", "comment": "The comparison operator used for depth testing."}, {"name": "back_stencil_state", "type": "SDL_GPUStencilOpState", "comment": "The stencil op state for back-facing triangles."}, {"name": "front_stencil_state", "type": "SDL_GPUStencilOpState", "comment": "The stencil op state for front-facing triangles."}, {"name": "compare_mask", "type": "Uint8", "comment": "Selects the bits of the stencil values participating in the stencil test."}, {"name": "write_mask", "type": "Uint8", "comment": "Selects the bits of the stencil values updated by the stencil test."}, {"name": "enable_depth_test", "type": "bool", "comment": "true enables the depth test."}, {"name": "enable_depth_write", "type": "bool", "comment": "true enables depth writes. Depth writes are always disabled when enable_depth_test is false."}, {"name": "enable_stencil_test", "type": "bool", "comment": "true enables the stencil test."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}, {"name": "padding3", "type": "Uint8"}]}, + {"name": "SDL_GPUColorTargetDescription", "fields": [{"name": "format", "type": "SDL_GPUTextureFormat", "comment": "The pixel format of the texture to be used as a color target."}, {"name": "blend_state", "type": "SDL_GPUColorTargetBlendState", "comment": "The blend state to be used for the color target."}]}, + {"name": "SDL_GPUGraphicsPipelineTargetInfo", "fields": [{"name": "color_target_descriptions", "type": "const SDL_GPUColorTargetDescription *", "comment": "A pointer to an array of color target descriptions."}, {"name": "num_color_targets", "type": "Uint32", "comment": "The number of color target descriptions in the above array."}, {"name": "depth_stencil_format", "type": "SDL_GPUTextureFormat", "comment": "The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false."}, {"name": "has_depth_stencil_target", "type": "bool", "comment": "true specifies that the pipeline uses a depth-stencil target."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}, {"name": "padding3", "type": "Uint8"}]}, + {"name": "SDL_GPUGraphicsPipelineCreateInfo", "fields": [{"name": "vertex_shader", "type": "SDL_GPUShader *", "comment": "The vertex shader used by the graphics pipeline."}, {"name": "fragment_shader", "type": "SDL_GPUShader *", "comment": "The fragment shader used by the graphics pipeline."}, {"name": "vertex_input_state", "type": "SDL_GPUVertexInputState", "comment": "The vertex layout of the graphics pipeline."}, {"name": "primitive_type", "type": "SDL_GPUPrimitiveType", "comment": "The primitive topology of the graphics pipeline."}, {"name": "rasterizer_state", "type": "SDL_GPURasterizerState", "comment": "The rasterizer state of the graphics pipeline."}, {"name": "multisample_state", "type": "SDL_GPUMultisampleState", "comment": "The multisample state of the graphics pipeline."}, {"name": "depth_stencil_state", "type": "SDL_GPUDepthStencilState", "comment": "The depth-stencil state of the graphics pipeline."}, {"name": "target_info", "type": "SDL_GPUGraphicsPipelineTargetInfo", "comment": "Formats and blend modes for the render targets of the graphics pipeline."}, {"name": "props", "type": "SDL_PropertiesID", "comment": "A properties ID for extensions. Should be 0 if no extensions are needed."}]}, + {"name": "SDL_GPUComputePipelineCreateInfo", "fields": [{"name": "code_size", "type": "size_t", "comment": "The size in bytes of the compute shader code pointed to."}, {"name": "code", "type": "const Uint8 *", "comment": "A pointer to compute shader code."}, {"name": "entrypoint", "type": "const char *", "comment": "A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader."}, {"name": "format", "type": "SDL_GPUShaderFormat", "comment": "The format of the compute shader code."}, {"name": "num_samplers", "type": "Uint32", "comment": "The number of samplers defined in the shader."}, {"name": "num_readonly_storage_textures", "type": "Uint32", "comment": "The number of readonly storage textures defined in the shader."}, {"name": "num_readonly_storage_buffers", "type": "Uint32", "comment": "The number of readonly storage buffers defined in the shader."}, {"name": "num_readwrite_storage_textures", "type": "Uint32", "comment": "The number of read-write storage textures defined in the shader."}, {"name": "num_readwrite_storage_buffers", "type": "Uint32", "comment": "The number of read-write storage buffers defined in the shader."}, {"name": "num_uniform_buffers", "type": "Uint32", "comment": "The number of uniform buffers defined in the shader."}, {"name": "threadcount_x", "type": "Uint32", "comment": "The number of threads in the X dimension. This should match the value in the shader."}, {"name": "threadcount_y", "type": "Uint32", "comment": "The number of threads in the Y dimension. This should match the value in the shader."}, {"name": "threadcount_z", "type": "Uint32", "comment": "The number of threads in the Z dimension. This should match the value in the shader."}, {"name": "props", "type": "SDL_PropertiesID", "comment": "A properties ID for extensions. Should be 0 if no extensions are needed."}]}, + {"name": "SDL_GPUColorTargetInfo", "fields": [{"name": "texture", "type": "SDL_GPUTexture *", "comment": "The texture that will be used as a color target by a render pass."}, {"name": "mip_level", "type": "Uint32", "comment": "The mip level to use as a color target."}, {"name": "layer_or_depth_plane", "type": "Uint32", "comment": "The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures."}, {"name": "clear_color", "type": "SDL_FColor", "comment": "The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used."}, {"name": "load_op", "type": "SDL_GPULoadOp", "comment": "What is done with the contents of the color target at the beginning of the render pass."}, {"name": "store_op", "type": "SDL_GPUStoreOp", "comment": "What is done with the results of the render pass."}, {"name": "resolve_texture", "type": "SDL_GPUTexture *", "comment": "The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used."}, {"name": "resolve_mip_level", "type": "Uint32", "comment": "The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used."}, {"name": "resolve_layer", "type": "Uint32", "comment": "The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used."}, {"name": "cycle", "type": "bool", "comment": "true cycles the texture if the texture is bound and load_op is not LOAD"}, {"name": "cycle_resolve_texture", "type": "bool", "comment": "true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}]}, + {"name": "SDL_GPUDepthStencilTargetInfo", "fields": [{"name": "texture", "type": "SDL_GPUTexture *", "comment": "The texture that will be used as the depth stencil target by the render pass."}, {"name": "clear_depth", "type": "float", "comment": "The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used."}, {"name": "load_op", "type": "SDL_GPULoadOp", "comment": "What is done with the depth contents at the beginning of the render pass."}, {"name": "store_op", "type": "SDL_GPUStoreOp", "comment": "What is done with the depth results of the render pass."}, {"name": "stencil_load_op", "type": "SDL_GPULoadOp", "comment": "What is done with the stencil contents at the beginning of the render pass."}, {"name": "stencil_store_op", "type": "SDL_GPUStoreOp", "comment": "What is done with the stencil results of the render pass."}, {"name": "cycle", "type": "bool", "comment": "true cycles the texture if the texture is bound and any load ops are not LOAD"}, {"name": "clear_stencil", "type": "Uint8", "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}]}, + {"name": "SDL_GPUBlitInfo", "fields": [{"name": "source", "type": "SDL_GPUBlitRegion", "comment": "The source region for the blit."}, {"name": "destination", "type": "SDL_GPUBlitRegion", "comment": "The destination region for the blit."}, {"name": "load_op", "type": "SDL_GPULoadOp", "comment": "What is done with the contents of the destination before the blit."}, {"name": "clear_color", "type": "SDL_FColor", "comment": "The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR."}, {"name": "flip_mode", "type": "SDL_FlipMode", "comment": "The flip mode for the source region."}, {"name": "filter", "type": "SDL_GPUFilter", "comment": "The filter mode used when blitting."}, {"name": "cycle", "type": "bool", "comment": "true cycles the destination texture if it is already bound."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}, {"name": "padding3", "type": "Uint8"}]}, + {"name": "SDL_GPUBufferBinding", "fields": [{"name": "buffer", "type": "SDL_GPUBuffer *", "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer."}, {"name": "offset", "type": "Uint32", "comment": "The starting byte of the data to bind in the buffer."}]}, + {"name": "SDL_GPUTextureSamplerBinding", "fields": [{"name": "texture", "type": "SDL_GPUTexture *", "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER."}, {"name": "sampler", "type": "SDL_GPUSampler *", "comment": "The sampler to bind."}]}, + {"name": "SDL_GPUStorageBufferReadWriteBinding", "fields": [{"name": "buffer", "type": "SDL_GPUBuffer *", "comment": "The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE."}, {"name": "cycle", "type": "bool", "comment": "true cycles the buffer if it is already bound."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}, {"name": "padding3", "type": "Uint8"}]}, + {"name": "SDL_GPUStorageTextureReadWriteBinding", "fields": [{"name": "texture", "type": "SDL_GPUTexture *", "comment": "The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE or SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE."}, {"name": "mip_level", "type": "Uint32", "comment": "The mip level index to bind."}, {"name": "layer", "type": "Uint32", "comment": "The layer index to bind."}, {"name": "cycle", "type": "bool", "comment": "true cycles the texture if it is already bound."}, {"name": "padding1", "type": "Uint8"}, {"name": "padding2", "type": "Uint8"}, {"name": "padding3", "type": "Uint8"}]} + ], + "unions": [ + ], + "flags": [ + {"name": "SDL_GPUTextureUsageFlags", "underlying_type": "Uint32", "values": [{"name": "SDL_GPU_TEXTUREUSAGE_SAMPLER", "value": "(1u << 0)", "comment": "Texture supports sampling."}, {"name": "SDL_GPU_TEXTUREUSAGE_COLOR_TARGET", "value": "(1u << 1)", "comment": "Texture is a color render target."}, {"name": "SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET", "value": "(1u << 2)", "comment": "Texture is a depth stencil target."}, {"name": "SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ", "value": "(1u << 3)", "comment": "Texture supports storage reads in graphics stages."}, {"name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ", "value": "(1u << 4)", "comment": "Texture supports storage reads in the compute stage."}, {"name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE", "value": "(1u << 5)", "comment": "Texture supports storage writes in the compute stage."}, {"name": "SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE", "value": "(1u << 6)", "comment": "Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE."}]}, + {"name": "SDL_GPUBufferUsageFlags", "underlying_type": "Uint32", "values": [{"name": "SDL_GPU_BUFFERUSAGE_VERTEX", "value": "(1u << 0)", "comment": "Buffer is a vertex buffer."}, {"name": "SDL_GPU_BUFFERUSAGE_INDEX", "value": "(1u << 1)", "comment": "Buffer is an index buffer."}, {"name": "SDL_GPU_BUFFERUSAGE_INDIRECT", "value": "(1u << 2)", "comment": "Buffer is an indirect buffer."}, {"name": "SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ", "value": "(1u << 3)", "comment": "Buffer supports storage reads in graphics stages."}, {"name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ", "value": "(1u << 4)", "comment": "Buffer supports storage reads in the compute stage."}, {"name": "SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE", "value": "(1u << 5)", "comment": "Buffer supports storage writes in the compute stage."}]}, + {"name": "SDL_GPUColorComponentFlags", "underlying_type": "Uint8", "values": [{"name": "SDL_GPU_COLORCOMPONENT_R", "value": "(1u << 0)", "comment": "the red component"}, {"name": "SDL_GPU_COLORCOMPONENT_G", "value": "(1u << 1)", "comment": "the green component"}, {"name": "SDL_GPU_COLORCOMPONENT_B", "value": "(1u << 2)", "comment": "the blue component"}, {"name": "SDL_GPU_COLORCOMPONENT_A", "value": "(1u << 3)", "comment": "the alpha component"}]} + ], + "functions": [ + {"name": "SDL_GPUSupportsShaderFormats", "return_type": "bool", "parameters": [{"name": "format_flags", "type": "SDL_GPUShaderFormat"}, {"name": "name", "type": "const char *"}]}, + {"name": "SDL_GPUSupportsProperties", "return_type": "bool", "parameters": [{"name": "props", "type": "SDL_PropertiesID"}]}, + {"name": "SDL_CreateGPUDevice", "return_type": "SDL_GPUDevice *", "parameters": [{"name": "format_flags", "type": "SDL_GPUShaderFormat"}, {"name": "debug_mode", "type": "bool"}, {"name": "name", "type": "const char *"}]}, + {"name": "SDL_CreateGPUDeviceWithProperties", "return_type": "SDL_GPUDevice *", "parameters": [{"name": "props", "type": "SDL_PropertiesID"}]}, + {"name": "SDL_DestroyGPUDevice", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}]}, + {"name": "SDL_GetNumGPUDrivers", "return_type": "int", "parameters": []}, + {"name": "SDL_GetGPUDriver", "return_type": "const char *", "parameters": [{"name": "index", "type": "int"}]}, + {"name": "SDL_GetGPUDeviceDriver", "return_type": "const char *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}]}, + {"name": "SDL_GetGPUShaderFormats", "return_type": "SDL_GPUShaderFormat", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}]}, + {"name": "SDL_CreateGPUComputePipeline", "return_type": "SDL_GPUComputePipeline *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "createinfo", "type": "const SDL_GPUComputePipelineCreateInfo *"}]}, + {"name": "SDL_CreateGPUGraphicsPipeline", "return_type": "SDL_GPUGraphicsPipeline *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "createinfo", "type": "const SDL_GPUGraphicsPipelineCreateInfo *"}]}, + {"name": "SDL_CreateGPUSampler", "return_type": "SDL_GPUSampler *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "createinfo", "type": "const SDL_GPUSamplerCreateInfo *"}]}, + {"name": "SDL_CreateGPUShader", "return_type": "SDL_GPUShader *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "createinfo", "type": "const SDL_GPUShaderCreateInfo *"}]}, + {"name": "SDL_CreateGPUTexture", "return_type": "SDL_GPUTexture *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "createinfo", "type": "const SDL_GPUTextureCreateInfo *"}]}, + {"name": "SDL_CreateGPUBuffer", "return_type": "SDL_GPUBuffer *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "createinfo", "type": "const SDL_GPUBufferCreateInfo *"}]}, + {"name": "SDL_CreateGPUTransferBuffer", "return_type": "SDL_GPUTransferBuffer *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "createinfo", "type": "const SDL_GPUTransferBufferCreateInfo *"}]}, + {"name": "SDL_SetGPUBufferName", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "buffer", "type": "SDL_GPUBuffer *"}, {"name": "text", "type": "const char *"}]}, + {"name": "SDL_SetGPUTextureName", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "texture", "type": "SDL_GPUTexture *"}, {"name": "text", "type": "const char *"}]}, + {"name": "SDL_InsertGPUDebugLabel", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "text", "type": "const char *"}]}, + {"name": "SDL_PushGPUDebugGroup", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "name", "type": "const char *"}]}, + {"name": "SDL_PopGPUDebugGroup", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}]}, + {"name": "SDL_ReleaseGPUTexture", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "texture", "type": "SDL_GPUTexture *"}]}, + {"name": "SDL_ReleaseGPUSampler", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "sampler", "type": "SDL_GPUSampler *"}]}, + {"name": "SDL_ReleaseGPUBuffer", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "buffer", "type": "SDL_GPUBuffer *"}]}, + {"name": "SDL_ReleaseGPUTransferBuffer", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "transfer_buffer", "type": "SDL_GPUTransferBuffer *"}]}, + {"name": "SDL_ReleaseGPUComputePipeline", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "compute_pipeline", "type": "SDL_GPUComputePipeline *"}]}, + {"name": "SDL_ReleaseGPUShader", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "shader", "type": "SDL_GPUShader *"}]}, + {"name": "SDL_ReleaseGPUGraphicsPipeline", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "graphics_pipeline", "type": "SDL_GPUGraphicsPipeline *"}]}, + {"name": "SDL_AcquireGPUCommandBuffer", "return_type": "SDL_GPUCommandBuffer *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}]}, + {"name": "SDL_PushGPUVertexUniformData", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "slot_index", "type": "Uint32"}, {"name": "data", "type": "const void *"}, {"name": "length", "type": "Uint32"}]}, + {"name": "SDL_PushGPUFragmentUniformData", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "slot_index", "type": "Uint32"}, {"name": "data", "type": "const void *"}, {"name": "length", "type": "Uint32"}]}, + {"name": "SDL_PushGPUComputeUniformData", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "slot_index", "type": "Uint32"}, {"name": "data", "type": "const void *"}, {"name": "length", "type": "Uint32"}]}, + {"name": "SDL_BeginGPURenderPass", "return_type": "SDL_GPURenderPass *", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "color_target_infos", "type": "const SDL_GPUColorTargetInfo *"}, {"name": "num_color_targets", "type": "Uint32"}, {"name": "depth_stencil_target_info", "type": "const SDL_GPUDepthStencilTargetInfo *"}]}, + {"name": "SDL_BindGPUGraphicsPipeline", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "graphics_pipeline", "type": "SDL_GPUGraphicsPipeline *"}]}, + {"name": "SDL_SetGPUViewport", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "viewport", "type": "const SDL_GPUViewport *"}]}, + {"name": "SDL_SetGPUScissor", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "scissor", "type": "const SDL_Rect *"}]}, + {"name": "SDL_SetGPUBlendConstants", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "blend_constants", "type": "SDL_FColor"}]}, + {"name": "SDL_SetGPUStencilReference", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "reference", "type": "Uint8"}]}, + {"name": "SDL_BindGPUVertexBuffers", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "bindings", "type": "const SDL_GPUBufferBinding *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUIndexBuffer", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "binding", "type": "const SDL_GPUBufferBinding *"}, {"name": "index_element_size", "type": "SDL_GPUIndexElementSize"}]}, + {"name": "SDL_BindGPUVertexSamplers", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "texture_sampler_bindings", "type": "const SDL_GPUTextureSamplerBinding *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUVertexStorageTextures", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "storage_textures", "type": "SDL_GPUTexture *const *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUVertexStorageBuffers", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "storage_buffers", "type": "SDL_GPUBuffer *const *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUFragmentSamplers", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "texture_sampler_bindings", "type": "const SDL_GPUTextureSamplerBinding *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUFragmentStorageTextures", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "storage_textures", "type": "SDL_GPUTexture *const *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUFragmentStorageBuffers", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "storage_buffers", "type": "SDL_GPUBuffer *const *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_DrawGPUIndexedPrimitives", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "num_indices", "type": "Uint32"}, {"name": "num_instances", "type": "Uint32"}, {"name": "first_index", "type": "Uint32"}, {"name": "vertex_offset", "type": "Sint32"}, {"name": "first_instance", "type": "Uint32"}]}, + {"name": "SDL_DrawGPUPrimitives", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "num_vertices", "type": "Uint32"}, {"name": "num_instances", "type": "Uint32"}, {"name": "first_vertex", "type": "Uint32"}, {"name": "first_instance", "type": "Uint32"}]}, + {"name": "SDL_DrawGPUPrimitivesIndirect", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "buffer", "type": "SDL_GPUBuffer *"}, {"name": "offset", "type": "Uint32"}, {"name": "draw_count", "type": "Uint32"}]}, + {"name": "SDL_DrawGPUIndexedPrimitivesIndirect", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}, {"name": "buffer", "type": "SDL_GPUBuffer *"}, {"name": "offset", "type": "Uint32"}, {"name": "draw_count", "type": "Uint32"}]}, + {"name": "SDL_EndGPURenderPass", "return_type": "void", "parameters": [{"name": "render_pass", "type": "SDL_GPURenderPass *"}]}, + {"name": "SDL_BeginGPUComputePass", "return_type": "SDL_GPUComputePass *", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "storage_texture_bindings", "type": "const SDL_GPUStorageTextureReadWriteBinding *"}, {"name": "num_storage_texture_bindings", "type": "Uint32"}, {"name": "storage_buffer_bindings", "type": "const SDL_GPUStorageBufferReadWriteBinding *"}, {"name": "num_storage_buffer_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUComputePipeline", "return_type": "void", "parameters": [{"name": "compute_pass", "type": "SDL_GPUComputePass *"}, {"name": "compute_pipeline", "type": "SDL_GPUComputePipeline *"}]}, + {"name": "SDL_BindGPUComputeSamplers", "return_type": "void", "parameters": [{"name": "compute_pass", "type": "SDL_GPUComputePass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "texture_sampler_bindings", "type": "const SDL_GPUTextureSamplerBinding *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUComputeStorageTextures", "return_type": "void", "parameters": [{"name": "compute_pass", "type": "SDL_GPUComputePass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "storage_textures", "type": "SDL_GPUTexture *const *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_BindGPUComputeStorageBuffers", "return_type": "void", "parameters": [{"name": "compute_pass", "type": "SDL_GPUComputePass *"}, {"name": "first_slot", "type": "Uint32"}, {"name": "storage_buffers", "type": "SDL_GPUBuffer *const *"}, {"name": "num_bindings", "type": "Uint32"}]}, + {"name": "SDL_DispatchGPUCompute", "return_type": "void", "parameters": [{"name": "compute_pass", "type": "SDL_GPUComputePass *"}, {"name": "groupcount_x", "type": "Uint32"}, {"name": "groupcount_y", "type": "Uint32"}, {"name": "groupcount_z", "type": "Uint32"}]}, + {"name": "SDL_DispatchGPUComputeIndirect", "return_type": "void", "parameters": [{"name": "compute_pass", "type": "SDL_GPUComputePass *"}, {"name": "buffer", "type": "SDL_GPUBuffer *"}, {"name": "offset", "type": "Uint32"}]}, + {"name": "SDL_EndGPUComputePass", "return_type": "void", "parameters": [{"name": "compute_pass", "type": "SDL_GPUComputePass *"}]}, + {"name": "SDL_MapGPUTransferBuffer", "return_type": "void *", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "transfer_buffer", "type": "SDL_GPUTransferBuffer *"}, {"name": "cycle", "type": "bool"}]}, + {"name": "SDL_UnmapGPUTransferBuffer", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "transfer_buffer", "type": "SDL_GPUTransferBuffer *"}]}, + {"name": "SDL_BeginGPUCopyPass", "return_type": "SDL_GPUCopyPass *", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}]}, + {"name": "SDL_UploadToGPUTexture", "return_type": "void", "parameters": [{"name": "copy_pass", "type": "SDL_GPUCopyPass *"}, {"name": "source", "type": "const SDL_GPUTextureTransferInfo *"}, {"name": "destination", "type": "const SDL_GPUTextureRegion *"}, {"name": "cycle", "type": "bool"}]}, + {"name": "SDL_UploadToGPUBuffer", "return_type": "void", "parameters": [{"name": "copy_pass", "type": "SDL_GPUCopyPass *"}, {"name": "source", "type": "const SDL_GPUTransferBufferLocation *"}, {"name": "destination", "type": "const SDL_GPUBufferRegion *"}, {"name": "cycle", "type": "bool"}]}, + {"name": "SDL_CopyGPUTextureToTexture", "return_type": "void", "parameters": [{"name": "copy_pass", "type": "SDL_GPUCopyPass *"}, {"name": "source", "type": "const SDL_GPUTextureLocation *"}, {"name": "destination", "type": "const SDL_GPUTextureLocation *"}, {"name": "w", "type": "Uint32"}, {"name": "h", "type": "Uint32"}, {"name": "d", "type": "Uint32"}, {"name": "cycle", "type": "bool"}]}, + {"name": "SDL_CopyGPUBufferToBuffer", "return_type": "void", "parameters": [{"name": "copy_pass", "type": "SDL_GPUCopyPass *"}, {"name": "source", "type": "const SDL_GPUBufferLocation *"}, {"name": "destination", "type": "const SDL_GPUBufferLocation *"}, {"name": "size", "type": "Uint32"}, {"name": "cycle", "type": "bool"}]}, + {"name": "SDL_DownloadFromGPUTexture", "return_type": "void", "parameters": [{"name": "copy_pass", "type": "SDL_GPUCopyPass *"}, {"name": "source", "type": "const SDL_GPUTextureRegion *"}, {"name": "destination", "type": "const SDL_GPUTextureTransferInfo *"}]}, + {"name": "SDL_DownloadFromGPUBuffer", "return_type": "void", "parameters": [{"name": "copy_pass", "type": "SDL_GPUCopyPass *"}, {"name": "source", "type": "const SDL_GPUBufferRegion *"}, {"name": "destination", "type": "const SDL_GPUTransferBufferLocation *"}]}, + {"name": "SDL_EndGPUCopyPass", "return_type": "void", "parameters": [{"name": "copy_pass", "type": "SDL_GPUCopyPass *"}]}, + {"name": "SDL_GenerateMipmapsForGPUTexture", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "texture", "type": "SDL_GPUTexture *"}]}, + {"name": "SDL_BlitGPUTexture", "return_type": "void", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "info", "type": "const SDL_GPUBlitInfo *"}]}, + {"name": "SDL_WindowSupportsGPUSwapchainComposition", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "window", "type": "SDL_Window *"}, {"name": "swapchain_composition", "type": "SDL_GPUSwapchainComposition"}]}, + {"name": "SDL_WindowSupportsGPUPresentMode", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "window", "type": "SDL_Window *"}, {"name": "present_mode", "type": "SDL_GPUPresentMode"}]}, + {"name": "SDL_ClaimWindowForGPUDevice", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_ReleaseWindowFromGPUDevice", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetGPUSwapchainParameters", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "window", "type": "SDL_Window *"}, {"name": "swapchain_composition", "type": "SDL_GPUSwapchainComposition"}, {"name": "present_mode", "type": "SDL_GPUPresentMode"}]}, + {"name": "SDL_SetGPUAllowedFramesInFlight", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "allowed_frames_in_flight", "type": "Uint32"}]}, + {"name": "SDL_GetGPUSwapchainTextureFormat", "return_type": "SDL_GPUTextureFormat", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_AcquireGPUSwapchainTexture", "return_type": "bool", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "window", "type": "SDL_Window *"}, {"name": "swapchain_texture", "type": "SDL_GPUTexture **"}, {"name": "swapchain_texture_width", "type": "Uint32 *"}, {"name": "swapchain_texture_height", "type": "Uint32 *"}]}, + {"name": "SDL_WaitForGPUSwapchain", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_WaitAndAcquireGPUSwapchainTexture", "return_type": "bool", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}, {"name": "window", "type": "SDL_Window *"}, {"name": "swapchain_texture", "type": "SDL_GPUTexture **"}, {"name": "swapchain_texture_width", "type": "Uint32 *"}, {"name": "swapchain_texture_height", "type": "Uint32 *"}]}, + {"name": "SDL_SubmitGPUCommandBuffer", "return_type": "bool", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}]}, + {"name": "SDL_SubmitGPUCommandBufferAndAcquireFence", "return_type": "SDL_GPUFence *", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}]}, + {"name": "SDL_CancelGPUCommandBuffer", "return_type": "bool", "parameters": [{"name": "command_buffer", "type": "SDL_GPUCommandBuffer *"}]}, + {"name": "SDL_WaitForGPUIdle", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}]}, + {"name": "SDL_WaitForGPUFences", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "wait_all", "type": "bool"}, {"name": "fences", "type": "SDL_GPUFence *const *"}, {"name": "num_fences", "type": "Uint32"}]}, + {"name": "SDL_QueryGPUFence", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "fence", "type": "SDL_GPUFence *"}]}, + {"name": "SDL_ReleaseGPUFence", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "fence", "type": "SDL_GPUFence *"}]}, + {"name": "SDL_GPUTextureFormatTexelBlockSize", "return_type": "Uint32", "parameters": [{"name": "format", "type": "SDL_GPUTextureFormat"}]}, + {"name": "SDL_GPUTextureSupportsFormat", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "format", "type": "SDL_GPUTextureFormat"}, {"name": "type", "type": "SDL_GPUTextureType"}, {"name": "usage", "type": "SDL_GPUTextureUsageFlags"}]}, + {"name": "SDL_GPUTextureSupportsSampleCount", "return_type": "bool", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}, {"name": "format", "type": "SDL_GPUTextureFormat"}, {"name": "sample_count", "type": "SDL_GPUSampleCount"}]}, + {"name": "SDL_CalculateGPUTextureFormatSize", "return_type": "Uint32", "parameters": [{"name": "format", "type": "SDL_GPUTextureFormat"}, {"name": "width", "type": "Uint32"}, {"name": "height", "type": "Uint32"}, {"name": "depth_or_layer_count", "type": "Uint32"}]}, + {"name": "SDL_GDKSuspendGPU", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}]}, + {"name": "SDL_GDKResumeGPU", "return_type": "void", "parameters": [{"name": "device", "type": "SDL_GPUDevice *"}]} + ] +} diff --git a/lib/sdl3/parser/test_keyboard.json b/lib/sdl3/parser/test_keyboard.json new file mode 100644 index 0000000..10232ae --- /dev/null +++ b/lib/sdl3/parser/test_keyboard.json @@ -0,0 +1,46 @@ +{ + "header": "SDL_keyboard.h", + "opaque_types": [ + ], + "typedefs": [ + {"name": "SDL_KeyboardID", "underlying_type": "Uint32"} + ], + "function_pointers": [ + ], + "enums": [ + {"name": "SDL_TextInputType", "values": []}, + {"name": "SDL_Capitalization", "values": []} + ], + "structs": [ + ], + "unions": [ + ], + "flags": [ + ], + "functions": [ + {"name": "SDL_HasKeyboard", "return_type": "bool", "parameters": []}, + {"name": "SDL_GetKeyboards", "return_type": "SDL_KeyboardID *", "parameters": [{"name": "count", "type": "int *"}]}, + {"name": "SDL_GetKeyboardNameForID", "return_type": "const char *", "parameters": [{"name": "instance_id", "type": "SDL_KeyboardID"}]}, + {"name": "SDL_GetKeyboardFocus", "return_type": "SDL_Window *", "parameters": []}, + {"name": "SDL_GetKeyboardState", "return_type": "const bool *", "parameters": [{"name": "numkeys", "type": "int *"}]}, + {"name": "SDL_ResetKeyboard", "return_type": "void", "parameters": []}, + {"name": "SDL_GetModState", "return_type": "SDL_Keymod", "parameters": []}, + {"name": "SDL_SetModState", "return_type": "void", "parameters": [{"name": "modstate", "type": "SDL_Keymod"}]}, + {"name": "SDL_GetKeyFromScancode", "return_type": "SDL_Keycode", "parameters": [{"name": "scancode", "type": "SDL_Scancode"}, {"name": "modstate", "type": "SDL_Keymod"}, {"name": "key_event", "type": "bool"}]}, + {"name": "SDL_GetScancodeFromKey", "return_type": "SDL_Scancode", "parameters": [{"name": "key", "type": "SDL_Keycode"}, {"name": "modstate", "type": "SDL_Keymod *"}]}, + {"name": "SDL_SetScancodeName", "return_type": "bool", "parameters": [{"name": "scancode", "type": "SDL_Scancode"}, {"name": "name", "type": "const char *"}]}, + {"name": "SDL_GetScancodeName", "return_type": "const char *", "parameters": [{"name": "scancode", "type": "SDL_Scancode"}]}, + {"name": "SDL_GetScancodeFromName", "return_type": "SDL_Scancode", "parameters": [{"name": "name", "type": "const char *"}]}, + {"name": "SDL_GetKeyName", "return_type": "const char *", "parameters": [{"name": "key", "type": "SDL_Keycode"}]}, + {"name": "SDL_GetKeyFromName", "return_type": "SDL_Keycode", "parameters": [{"name": "name", "type": "const char *"}]}, + {"name": "SDL_StartTextInput", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_StartTextInputWithProperties", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "props", "type": "SDL_PropertiesID"}]}, + {"name": "SDL_TextInputActive", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_StopTextInput", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_ClearComposition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetTextInputArea", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "const SDL_Rect *"}, {"name": "cursor", "type": "int"}]}, + {"name": "SDL_GetTextInputArea", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "SDL_Rect *"}, {"name": "cursor", "type": "int *"}]}, + {"name": "SDL_HasScreenKeyboardSupport", "return_type": "bool", "parameters": []}, + {"name": "SDL_ScreenKeyboardShown", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]} + ] +} diff --git a/lib/sdl3/parser/test_video.json b/lib/sdl3/parser/test_video.json new file mode 100644 index 0000000..37f5f75 --- /dev/null +++ b/lib/sdl3/parser/test_video.json @@ -0,0 +1,143 @@ +{ + "header": "SDL_video.h", + "opaque_types": [ + {"name": "SDL_DisplayModeData"}, + {"name": "SDL_Window"} + ], + "typedefs": [ + {"name": "SDL_DisplayID", "underlying_type": "Uint32"}, + {"name": "SDL_WindowID", "underlying_type": "Uint32"}, + {"name": "SDL_GLProfile", "underlying_type": "Uint32"}, + {"name": "SDL_GLContextFlag", "underlying_type": "Uint32"}, + {"name": "SDL_GLContextReleaseFlag", "underlying_type": "Uint32"}, + {"name": "SDL_GLContextResetNotification", "underlying_type": "Uint32"} + ], + "function_pointers": [ + ], + "enums": [ + {"name": "SDL_SystemTheme", "values": []}, + {"name": "SDL_DisplayOrientation", "values": []}, + {"name": "SDL_FlashOperation", "values": []}, + {"name": "SDL_HitTestResult", "values": []} + ], + "structs": [ + {"name": "SDL_DisplayMode", "fields": [{"name": "displayID", "type": "SDL_DisplayID", "comment": "the display this mode is associated with"}, {"name": "format", "type": "SDL_PixelFormat", "comment": "pixel format"}, {"name": "w", "type": "int", "comment": "width"}, {"name": "h", "type": "int", "comment": "height"}, {"name": "pixel_density", "type": "float", "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)"}, {"name": "refresh_rate", "type": "float", "comment": "refresh rate (or 0.0f for unspecified)"}, {"name": "refresh_rate_numerator", "type": "int", "comment": "precise refresh rate numerator (or 0 for unspecified)"}, {"name": "refresh_rate_denominator", "type": "int", "comment": "precise refresh rate denominator"}, {"name": "internal", "type": "SDL_DisplayModeData *", "comment": "Private"}]}, + {"name": "SDL_GLContextState", "fields": []} + ], + "unions": [ + ], + "flags": [ + {"name": "SDL_WindowFlags", "underlying_type": "Uint64", "values": [{"name": "SDL_WINDOW_FULLSCREEN", "value": "SDL_UINT64_C(0x0000000000000001)", "comment": "window is in fullscreen mode"}, {"name": "SDL_WINDOW_OPENGL", "value": "SDL_UINT64_C(0x0000000000000002)", "comment": "window usable with OpenGL context"}, {"name": "SDL_WINDOW_OCCLUDED", "value": "SDL_UINT64_C(0x0000000000000004)", "comment": "window is occluded"}, {"name": "SDL_WINDOW_HIDDEN", "value": "SDL_UINT64_C(0x0000000000000008)", "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible"}, {"name": "SDL_WINDOW_BORDERLESS", "value": "SDL_UINT64_C(0x0000000000000010)", "comment": "no window decoration"}, {"name": "SDL_WINDOW_RESIZABLE", "value": "SDL_UINT64_C(0x0000000000000020)", "comment": "window can be resized"}, {"name": "SDL_WINDOW_MINIMIZED", "value": "SDL_UINT64_C(0x0000000000000040)", "comment": "window is minimized"}, {"name": "SDL_WINDOW_MAXIMIZED", "value": "SDL_UINT64_C(0x0000000000000080)", "comment": "window is maximized"}, {"name": "SDL_WINDOW_MOUSE_GRABBED", "value": "SDL_UINT64_C(0x0000000000000100)", "comment": "window has grabbed mouse input"}, {"name": "SDL_WINDOW_INPUT_FOCUS", "value": "SDL_UINT64_C(0x0000000000000200)", "comment": "window has input focus"}, {"name": "SDL_WINDOW_MOUSE_FOCUS", "value": "SDL_UINT64_C(0x0000000000000400)", "comment": "window has mouse focus"}, {"name": "SDL_WINDOW_EXTERNAL", "value": "SDL_UINT64_C(0x0000000000000800)", "comment": "window not created by SDL"}, {"name": "SDL_WINDOW_MODAL", "value": "SDL_UINT64_C(0x0000000000001000)", "comment": "window is modal"}, {"name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", "value": "SDL_UINT64_C(0x0000000000002000)", "comment": "window uses high pixel density back buffer if possible"}, {"name": "SDL_WINDOW_MOUSE_CAPTURE", "value": "SDL_UINT64_C(0x0000000000004000)", "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)"}, {"name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", "value": "SDL_UINT64_C(0x0000000000008000)", "comment": "window has relative mode enabled"}, {"name": "SDL_WINDOW_ALWAYS_ON_TOP", "value": "SDL_UINT64_C(0x0000000000010000)", "comment": "window should always be above others"}, {"name": "SDL_WINDOW_UTILITY", "value": "SDL_UINT64_C(0x0000000000020000)", "comment": "window should be treated as a utility window, not showing in the task bar and window list"}, {"name": "SDL_WINDOW_TOOLTIP", "value": "SDL_UINT64_C(0x0000000000040000)", "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window"}, {"name": "SDL_WINDOW_POPUP_MENU", "value": "SDL_UINT64_C(0x0000000000080000)", "comment": "window should be treated as a popup menu, requires a parent window"}, {"name": "SDL_WINDOW_KEYBOARD_GRABBED", "value": "SDL_UINT64_C(0x0000000000100000)", "comment": "window has grabbed keyboard input"}, {"name": "SDL_WINDOW_VULKAN", "value": "SDL_UINT64_C(0x0000000010000000)", "comment": "window usable for Vulkan surface"}, {"name": "SDL_WINDOW_METAL", "value": "SDL_UINT64_C(0x0000000020000000)", "comment": "window usable for Metal view"}, {"name": "SDL_WINDOW_TRANSPARENT", "value": "SDL_UINT64_C(0x0000000040000000)", "comment": "window with transparent buffer"}, {"name": "SDL_WINDOW_NOT_FOCUSABLE", "value": "SDL_UINT64_C(0x0000000080000000)", "comment": "window should not be focusable"}]} + ], + "functions": [ + {"name": "SDL_GetNumVideoDrivers", "return_type": "int", "parameters": []}, + {"name": "SDL_GetVideoDriver", "return_type": "const char *", "parameters": [{"name": "index", "type": "int"}]}, + {"name": "SDL_GetCurrentVideoDriver", "return_type": "const char *", "parameters": []}, + {"name": "SDL_GetSystemTheme", "return_type": "SDL_SystemTheme", "parameters": []}, + {"name": "SDL_GetDisplays", "return_type": "SDL_DisplayID *", "parameters": [{"name": "count", "type": "int *"}]}, + {"name": "SDL_GetPrimaryDisplay", "return_type": "SDL_DisplayID", "parameters": []}, + {"name": "SDL_GetDisplayProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]}, + {"name": "SDL_GetDisplayName", "return_type": "const char *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]}, + {"name": "SDL_GetDisplayBounds", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "rect", "type": "SDL_Rect *"}]}, + {"name": "SDL_GetDisplayUsableBounds", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "rect", "type": "SDL_Rect *"}]}, + {"name": "SDL_GetNaturalDisplayOrientation", "return_type": "SDL_DisplayOrientation", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]}, + {"name": "SDL_GetCurrentDisplayOrientation", "return_type": "SDL_DisplayOrientation", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]}, + {"name": "SDL_GetDisplayContentScale", "return_type": "float", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]}, + {"name": "SDL_GetFullscreenDisplayModes", "return_type": "SDL_DisplayMode **", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "count", "type": "int *"}]}, + {"name": "SDL_GetClosestFullscreenDisplayMode", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "refresh_rate", "type": "float"}, {"name": "include_high_density_modes", "type": "bool"}, {"name": "closest", "type": "SDL_DisplayMode *"}]}, + {"name": "SDL_GetDesktopDisplayMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]}, + {"name": "SDL_GetCurrentDisplayMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]}, + {"name": "SDL_GetDisplayForPoint", "return_type": "SDL_DisplayID", "parameters": [{"name": "point", "type": "const SDL_Point *"}]}, + {"name": "SDL_GetDisplayForRect", "return_type": "SDL_DisplayID", "parameters": [{"name": "rect", "type": "const SDL_Rect *"}]}, + {"name": "SDL_GetDisplayForWindow", "return_type": "SDL_DisplayID", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowPixelDensity", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowDisplayScale", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowFullscreenMode", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "mode", "type": "const SDL_DisplayMode *"}]}, + {"name": "SDL_GetWindowFullscreenMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowICCProfile", "return_type": "void *", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "size", "type": "size_t *"}]}, + {"name": "SDL_GetWindowPixelFormat", "return_type": "SDL_PixelFormat", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindows", "return_type": "SDL_Window **", "parameters": [{"name": "count", "type": "int *"}]}, + {"name": "SDL_CreateWindow", "return_type": "SDL_Window *", "parameters": [{"name": "title", "type": "const char *"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "flags", "type": "SDL_WindowFlags"}]}, + {"name": "SDL_CreatePopupWindow", "return_type": "SDL_Window *", "parameters": [{"name": "parent", "type": "SDL_Window *"}, {"name": "offset_x", "type": "int"}, {"name": "offset_y", "type": "int"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "flags", "type": "SDL_WindowFlags"}]}, + {"name": "SDL_CreateWindowWithProperties", "return_type": "SDL_Window *", "parameters": [{"name": "props", "type": "SDL_PropertiesID"}]}, + {"name": "SDL_GetWindowID", "return_type": "SDL_WindowID", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowFromID", "return_type": "SDL_Window *", "parameters": [{"name": "id", "type": "SDL_WindowID"}]}, + {"name": "SDL_GetWindowParent", "return_type": "SDL_Window *", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowFlags", "return_type": "SDL_WindowFlags", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowTitle", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "title", "type": "const char *"}]}, + {"name": "SDL_GetWindowTitle", "return_type": "const char *", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowIcon", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "icon", "type": "SDL_Surface *"}]}, + {"name": "SDL_SetWindowPosition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int"}, {"name": "y", "type": "int"}]}, + {"name": "SDL_GetWindowPosition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int *"}, {"name": "y", "type": "int *"}]}, + {"name": "SDL_SetWindowSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}]}, + {"name": "SDL_GetWindowSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]}, + {"name": "SDL_GetWindowSafeArea", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "SDL_Rect *"}]}, + {"name": "SDL_SetWindowAspectRatio", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_aspect", "type": "float"}, {"name": "max_aspect", "type": "float"}]}, + {"name": "SDL_GetWindowAspectRatio", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_aspect", "type": "float *"}, {"name": "max_aspect", "type": "float *"}]}, + {"name": "SDL_GetWindowBordersSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "top", "type": "int *"}, {"name": "left", "type": "int *"}, {"name": "bottom", "type": "int *"}, {"name": "right", "type": "int *"}]}, + {"name": "SDL_GetWindowSizeInPixels", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]}, + {"name": "SDL_SetWindowMinimumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_w", "type": "int"}, {"name": "min_h", "type": "int"}]}, + {"name": "SDL_GetWindowMinimumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]}, + {"name": "SDL_SetWindowMaximumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "max_w", "type": "int"}, {"name": "max_h", "type": "int"}]}, + {"name": "SDL_GetWindowMaximumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]}, + {"name": "SDL_SetWindowBordered", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "bordered", "type": "bool"}]}, + {"name": "SDL_SetWindowResizable", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "resizable", "type": "bool"}]}, + {"name": "SDL_SetWindowAlwaysOnTop", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "on_top", "type": "bool"}]}, + {"name": "SDL_ShowWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_HideWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_RaiseWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_MaximizeWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_MinimizeWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_RestoreWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowFullscreen", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "fullscreen", "type": "bool"}]}, + {"name": "SDL_SyncWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_WindowHasSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowSurface", "return_type": "SDL_Surface *", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowSurfaceVSync", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "vsync", "type": "int"}]}, + {"name": "SDL_GetWindowSurfaceVSync", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "vsync", "type": "int *"}]}, + {"name": "SDL_UpdateWindowSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_UpdateWindowSurfaceRects", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rects", "type": "const SDL_Rect *"}, {"name": "numrects", "type": "int"}]}, + {"name": "SDL_DestroyWindowSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowKeyboardGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "grabbed", "type": "bool"}]}, + {"name": "SDL_SetWindowMouseGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "grabbed", "type": "bool"}]}, + {"name": "SDL_GetWindowKeyboardGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetWindowMouseGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GetGrabbedWindow", "return_type": "SDL_Window *", "parameters": []}, + {"name": "SDL_SetWindowMouseRect", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "const SDL_Rect *"}]}, + {"name": "SDL_GetWindowMouseRect", "return_type": "const SDL_Rect *", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowOpacity", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "opacity", "type": "float"}]}, + {"name": "SDL_GetWindowOpacity", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowParent", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "parent", "type": "SDL_Window *"}]}, + {"name": "SDL_SetWindowModal", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "modal", "type": "bool"}]}, + {"name": "SDL_SetWindowFocusable", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "focusable", "type": "bool"}]}, + {"name": "SDL_ShowWindowSystemMenu", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int"}, {"name": "y", "type": "int"}]}, + {"name": "SDL_SetWindowHitTest", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "callback", "type": "SDL_HitTest"}, {"name": "callback_data", "type": "void *"}]}, + {"name": "SDL_SetWindowShape", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "shape", "type": "SDL_Surface *"}]}, + {"name": "SDL_FlashWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "operation", "type": "SDL_FlashOperation"}]}, + {"name": "SDL_DestroyWindow", "return_type": "void", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_ScreenSaverEnabled", "return_type": "bool", "parameters": []}, + {"name": "SDL_EnableScreenSaver", "return_type": "bool", "parameters": []}, + {"name": "SDL_DisableScreenSaver", "return_type": "bool", "parameters": []}, + {"name": "SDL_GL_LoadLibrary", "return_type": "bool", "parameters": [{"name": "path", "type": "const char *"}]}, + {"name": "SDL_GL_GetProcAddress", "return_type": "SDL_FunctionPointer", "parameters": [{"name": "proc", "type": "const char *"}]}, + {"name": "SDL_EGL_GetProcAddress", "return_type": "SDL_FunctionPointer", "parameters": [{"name": "proc", "type": "const char *"}]}, + {"name": "SDL_GL_UnloadLibrary", "return_type": "void", "parameters": []}, + {"name": "SDL_GL_ExtensionSupported", "return_type": "bool", "parameters": [{"name": "extension", "type": "const char *"}]}, + {"name": "SDL_GL_ResetAttributes", "return_type": "void", "parameters": []}, + {"name": "SDL_GL_SetAttribute", "return_type": "bool", "parameters": [{"name": "attr", "type": "SDL_GLAttr"}, {"name": "value", "type": "int"}]}, + {"name": "SDL_GL_GetAttribute", "return_type": "bool", "parameters": [{"name": "attr", "type": "SDL_GLAttr"}, {"name": "value", "type": "int *"}]}, + {"name": "SDL_GL_CreateContext", "return_type": "SDL_GLContext", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GL_MakeCurrent", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "context", "type": "SDL_GLContext"}]}, + {"name": "SDL_GL_GetCurrentWindow", "return_type": "SDL_Window *", "parameters": []}, + {"name": "SDL_GL_GetCurrentContext", "return_type": "SDL_GLContext", "parameters": []}, + {"name": "SDL_EGL_GetCurrentDisplay", "return_type": "SDL_EGLDisplay", "parameters": []}, + {"name": "SDL_EGL_GetCurrentConfig", "return_type": "SDL_EGLConfig", "parameters": []}, + {"name": "SDL_EGL_GetWindowSurface", "return_type": "SDL_EGLSurface", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_EGL_SetAttributeCallbacks", "return_type": "void", "parameters": [{"name": "platformAttribCallback", "type": "SDL_EGLAttribArrayCallback"}, {"name": "surfaceAttribCallback", "type": "SDL_EGLIntArrayCallback"}, {"name": "contextAttribCallback", "type": "SDL_EGLIntArrayCallback"}, {"name": "userdata", "type": "void *"}]}, + {"name": "SDL_GL_SetSwapInterval", "return_type": "bool", "parameters": [{"name": "interval", "type": "int"}]}, + {"name": "SDL_GL_GetSwapInterval", "return_type": "bool", "parameters": [{"name": "interval", "type": "int *"}]}, + {"name": "SDL_GL_SwapWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}, + {"name": "SDL_GL_DestroyContext", "return_type": "bool", "parameters": [{"name": "context", "type": "SDL_GLContext"}]} + ] +}