sdl3 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +7 -0
  3. data/LICENSE +21 -0
  4. data/README.md +188 -0
  5. data/Rakefile +12 -0
  6. data/examples/01_hello_window.rb +24 -0
  7. data/examples/02_basic_rendering.rb +45 -0
  8. data/examples/03_keyboard_input.rb +52 -0
  9. data/examples/04_mouse_input.rb +56 -0
  10. data/examples/05_simple_game.rb +107 -0
  11. data/lib/sdl3/high_level/audio_device.rb +202 -0
  12. data/lib/sdl3/high_level/camera.rb +118 -0
  13. data/lib/sdl3/high_level/clipboard.rb +59 -0
  14. data/lib/sdl3/high_level/event.rb +240 -0
  15. data/lib/sdl3/high_level/gamepad.rb +190 -0
  16. data/lib/sdl3/high_level/gpu.rb +194 -0
  17. data/lib/sdl3/high_level/haptic.rb +213 -0
  18. data/lib/sdl3/high_level/joystick.rb +165 -0
  19. data/lib/sdl3/high_level/renderer.rb +163 -0
  20. data/lib/sdl3/high_level/sensor.rb +105 -0
  21. data/lib/sdl3/high_level/surface.rb +143 -0
  22. data/lib/sdl3/high_level/texture.rb +111 -0
  23. data/lib/sdl3/high_level/timer.rb +88 -0
  24. data/lib/sdl3/high_level/window.rb +151 -0
  25. data/lib/sdl3/library_loader.rb +63 -0
  26. data/lib/sdl3/raw/assert.rb +32 -0
  27. data/lib/sdl3/raw/asyncio.rb +36 -0
  28. data/lib/sdl3/raw/atomic.rb +40 -0
  29. data/lib/sdl3/raw/audio.rb +95 -0
  30. data/lib/sdl3/raw/base.rb +12 -0
  31. data/lib/sdl3/raw/bits.rb +17 -0
  32. data/lib/sdl3/raw/blendmode.rb +36 -0
  33. data/lib/sdl3/raw/camera.rb +38 -0
  34. data/lib/sdl3/raw/clipboard.rb +20 -0
  35. data/lib/sdl3/raw/cpuinfo.rb +29 -0
  36. data/lib/sdl3/raw/dialog.rb +33 -0
  37. data/lib/sdl3/raw/endian.rb +8 -0
  38. data/lib/sdl3/raw/error.rb +15 -0
  39. data/lib/sdl3/raw/events.rb +563 -0
  40. data/lib/sdl3/raw/filesystem.rb +47 -0
  41. data/lib/sdl3/raw/gamepad.rb +135 -0
  42. data/lib/sdl3/raw/gpu.rb +734 -0
  43. data/lib/sdl3/raw/guid.rb +12 -0
  44. data/lib/sdl3/raw/haptic.rb +167 -0
  45. data/lib/sdl3/raw/hidapi.rb +57 -0
  46. data/lib/sdl3/raw/hints.rb +20 -0
  47. data/lib/sdl3/raw/init.rb +27 -0
  48. data/lib/sdl3/raw/iostream.rb +88 -0
  49. data/lib/sdl3/raw/joystick.rb +101 -0
  50. data/lib/sdl3/raw/keyboard.rb +30 -0
  51. data/lib/sdl3/raw/keycode.rb +132 -0
  52. data/lib/sdl3/raw/loadso.rb +9 -0
  53. data/lib/sdl3/raw/locale.rb +12 -0
  54. data/lib/sdl3/raw/log.rb +61 -0
  55. data/lib/sdl3/raw/main.rb +23 -0
  56. data/lib/sdl3/raw/messagebox.rb +50 -0
  57. data/lib/sdl3/raw/metal.rb +9 -0
  58. data/lib/sdl3/raw/misc.rb +7 -0
  59. data/lib/sdl3/raw/mouse.rb +82 -0
  60. data/lib/sdl3/raw/mutex.rb +48 -0
  61. data/lib/sdl3/raw/openxr.rb +21 -0
  62. data/lib/sdl3/raw/pen.rb +38 -0
  63. data/lib/sdl3/raw/pixels.rb +180 -0
  64. data/lib/sdl3/raw/platform.rb +7 -0
  65. data/lib/sdl3/raw/power.rb +14 -0
  66. data/lib/sdl3/raw/process.rb +15 -0
  67. data/lib/sdl3/raw/properties.rb +39 -0
  68. data/lib/sdl3/raw/rect.rb +41 -0
  69. data/lib/sdl3/raw/render.rb +153 -0
  70. data/lib/sdl3/raw/scancode.rb +112 -0
  71. data/lib/sdl3/raw/sensor.rb +31 -0
  72. data/lib/sdl3/raw/stdinc.rb +209 -0
  73. data/lib/sdl3/raw/storage.rb +50 -0
  74. data/lib/sdl3/raw/surface.rb +106 -0
  75. data/lib/sdl3/raw/system.rb +77 -0
  76. data/lib/sdl3/raw/thread.rb +40 -0
  77. data/lib/sdl3/raw/time.rb +36 -0
  78. data/lib/sdl3/raw/timer.rb +19 -0
  79. data/lib/sdl3/raw/touch.rb +22 -0
  80. data/lib/sdl3/raw/tray.rb +42 -0
  81. data/lib/sdl3/raw/types.rb +21 -0
  82. data/lib/sdl3/raw/version.rb +8 -0
  83. data/lib/sdl3/raw/video.rb +208 -0
  84. data/lib/sdl3/raw/vulkan.rb +13 -0
  85. data/lib/sdl3/version.rb +5 -0
  86. data/lib/sdl3.rb +128 -0
  87. data/sdl3.gemspec +30 -0
  88. metadata +143 -0
@@ -0,0 +1,734 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SDL3
4
+ module Raw
5
+ SDL_GPUPrimitiveType = enum :SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, 0,
6
+ :SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP,
7
+ :SDL_GPU_PRIMITIVETYPE_LINELIST,
8
+ :SDL_GPU_PRIMITIVETYPE_LINESTRIP,
9
+ :SDL_GPU_PRIMITIVETYPE_POINTLIST
10
+
11
+ SDL_GPULoadOp = enum :SDL_GPU_LOADOP_LOAD, 0,
12
+ :SDL_GPU_LOADOP_CLEAR,
13
+ :SDL_GPU_LOADOP_DONT_CARE
14
+
15
+ SDL_GPUStoreOp = enum :SDL_GPU_STOREOP_STORE, 0,
16
+ :SDL_GPU_STOREOP_DONT_CARE,
17
+ :SDL_GPU_STOREOP_RESOLVE,
18
+ :SDL_GPU_STOREOP_RESOLVE_AND_STORE
19
+
20
+ SDL_GPUIndexElementSize = enum :SDL_GPU_INDEXELEMENTSIZE_16BIT, 0,
21
+ :SDL_GPU_INDEXELEMENTSIZE_32BIT
22
+
23
+ SDL_GPUTextureFormat = enum :SDL_GPU_TEXTUREFORMAT_INVALID, 0,
24
+ :SDL_GPU_TEXTUREFORMAT_A8_UNORM,
25
+ :SDL_GPU_TEXTUREFORMAT_R8_UNORM,
26
+ :SDL_GPU_TEXTUREFORMAT_R8G8_UNORM,
27
+ :SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM,
28
+ :SDL_GPU_TEXTUREFORMAT_R16_UNORM,
29
+ :SDL_GPU_TEXTUREFORMAT_R16G16_UNORM,
30
+ :SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM,
31
+ :SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM,
32
+ :SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM,
33
+ :SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM,
34
+ :SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM,
35
+ :SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM,
36
+ :SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM,
37
+ :SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM,
38
+ :SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM,
39
+ :SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM,
40
+ :SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM,
41
+ :SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM,
42
+ :SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT,
43
+ :SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT,
44
+ :SDL_GPU_TEXTUREFORMAT_R8_SNORM,
45
+ :SDL_GPU_TEXTUREFORMAT_R8G8_SNORM,
46
+ :SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM,
47
+ :SDL_GPU_TEXTUREFORMAT_R16_SNORM,
48
+ :SDL_GPU_TEXTUREFORMAT_R16G16_SNORM,
49
+ :SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM,
50
+ :SDL_GPU_TEXTUREFORMAT_R16_FLOAT,
51
+ :SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT,
52
+ :SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT,
53
+ :SDL_GPU_TEXTUREFORMAT_R32_FLOAT,
54
+ :SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT,
55
+ :SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT,
56
+ :SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT,
57
+ :SDL_GPU_TEXTUREFORMAT_R8_UINT,
58
+ :SDL_GPU_TEXTUREFORMAT_R8G8_UINT,
59
+ :SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT,
60
+ :SDL_GPU_TEXTUREFORMAT_R16_UINT,
61
+ :SDL_GPU_TEXTUREFORMAT_R16G16_UINT,
62
+ :SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT,
63
+ :SDL_GPU_TEXTUREFORMAT_R32_UINT,
64
+ :SDL_GPU_TEXTUREFORMAT_R32G32_UINT,
65
+ :SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT,
66
+ :SDL_GPU_TEXTUREFORMAT_R8_INT,
67
+ :SDL_GPU_TEXTUREFORMAT_R8G8_INT,
68
+ :SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT,
69
+ :SDL_GPU_TEXTUREFORMAT_R16_INT,
70
+ :SDL_GPU_TEXTUREFORMAT_R16G16_INT,
71
+ :SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT,
72
+ :SDL_GPU_TEXTUREFORMAT_R32_INT,
73
+ :SDL_GPU_TEXTUREFORMAT_R32G32_INT,
74
+ :SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT,
75
+ :SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB,
76
+ :SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB,
77
+ :SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB,
78
+ :SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB,
79
+ :SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB,
80
+ :SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB,
81
+ :SDL_GPU_TEXTUREFORMAT_D16_UNORM,
82
+ :SDL_GPU_TEXTUREFORMAT_D24_UNORM,
83
+ :SDL_GPU_TEXTUREFORMAT_D32_FLOAT,
84
+ :SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT,
85
+ :SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT,
86
+ :SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM,
87
+ :SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM,
88
+ :SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM,
89
+ :SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM,
90
+ :SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM,
91
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM,
92
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM,
93
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM,
94
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM,
95
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM,
96
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM,
97
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM,
98
+ :SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM,
99
+ :SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM,
100
+ :SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB,
101
+ :SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB,
102
+ :SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB,
103
+ :SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB,
104
+ :SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB,
105
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB,
106
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB,
107
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB,
108
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB,
109
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB,
110
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB,
111
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB,
112
+ :SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB,
113
+ :SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB,
114
+ :SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT,
115
+ :SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT,
116
+ :SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT,
117
+ :SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT,
118
+ :SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT,
119
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT,
120
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT,
121
+ :SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT,
122
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT,
123
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT,
124
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT,
125
+ :SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT,
126
+ :SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT,
127
+ :SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
128
+
129
+ SDL_GPUTextureUsageFlags = enum :SDL_GPU_TEXTUREUSAGE_SAMPLER, 0x00000001,
130
+ :SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, 0x00000002,
131
+ :SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, 0x00000004,
132
+ :SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ, 0x00000008,
133
+ :SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ, 0x00000010,
134
+ :SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE, 0x00000020,
135
+ :SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE, 0x00000040
136
+
137
+ SDL_GPUTextureType = enum :SDL_GPU_TEXTURETYPE_2D, 0,
138
+ :SDL_GPU_TEXTURETYPE_2D_ARRAY,
139
+ :SDL_GPU_TEXTURETYPE_3D,
140
+ :SDL_GPU_TEXTURETYPE_CUBE,
141
+ :SDL_GPU_TEXTURETYPE_CUBE_ARRAY
142
+
143
+ SDL_GPUSampleCount = enum :SDL_GPU_SAMPLECOUNT_1, 0,
144
+ :SDL_GPU_SAMPLECOUNT_2,
145
+ :SDL_GPU_SAMPLECOUNT_4,
146
+ :SDL_GPU_SAMPLECOUNT_8
147
+
148
+ SDL_GPUCubeMapFace = enum :SDL_GPU_CUBEMAPFACE_POSITIVEX, 0,
149
+ :SDL_GPU_CUBEMAPFACE_NEGATIVEX,
150
+ :SDL_GPU_CUBEMAPFACE_POSITIVEY,
151
+ :SDL_GPU_CUBEMAPFACE_NEGATIVEY,
152
+ :SDL_GPU_CUBEMAPFACE_POSITIVEZ,
153
+ :SDL_GPU_CUBEMAPFACE_NEGATIVEZ
154
+
155
+ SDL_GPUBufferUsageFlags = enum :SDL_GPU_BUFFERUSAGE_VERTEX, 0x00000001,
156
+ :SDL_GPU_BUFFERUSAGE_INDEX, 0x00000002,
157
+ :SDL_GPU_BUFFERUSAGE_INDIRECT, 0x00000004,
158
+ :SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ, 0x00000008,
159
+ :SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ, 0x00000010,
160
+ :SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE, 0x00000020
161
+
162
+ SDL_GPUTransferBufferUsage = enum :SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, 0,
163
+ :SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
164
+
165
+ SDL_GPUShaderStage = enum :SDL_GPU_SHADERSTAGE_VERTEX, 0,
166
+ :SDL_GPU_SHADERSTAGE_FRAGMENT
167
+
168
+ SDL_GPUShaderFormat = enum :SDL_GPU_SHADERFORMAT_INVALID, 0x00000000,
169
+ :SDL_GPU_SHADERFORMAT_PRIVATE, 0x00000001,
170
+ :SDL_GPU_SHADERFORMAT_SPIRV, 0x00000002,
171
+ :SDL_GPU_SHADERFORMAT_DXBC, 0x00000004,
172
+ :SDL_GPU_SHADERFORMAT_DXIL, 0x00000008,
173
+ :SDL_GPU_SHADERFORMAT_MSL, 0x00000010,
174
+ :SDL_GPU_SHADERFORMAT_METALLIB, 0x00000020
175
+
176
+ SDL_GPUVertexElementFormat = enum :SDL_GPU_VERTEXELEMENTFORMAT_INVALID, 0,
177
+ :SDL_GPU_VERTEXELEMENTFORMAT_INT,
178
+ :SDL_GPU_VERTEXELEMENTFORMAT_INT2,
179
+ :SDL_GPU_VERTEXELEMENTFORMAT_INT3,
180
+ :SDL_GPU_VERTEXELEMENTFORMAT_INT4,
181
+ :SDL_GPU_VERTEXELEMENTFORMAT_UINT,
182
+ :SDL_GPU_VERTEXELEMENTFORMAT_UINT2,
183
+ :SDL_GPU_VERTEXELEMENTFORMAT_UINT3,
184
+ :SDL_GPU_VERTEXELEMENTFORMAT_UINT4,
185
+ :SDL_GPU_VERTEXELEMENTFORMAT_FLOAT,
186
+ :SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2,
187
+ :SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3,
188
+ :SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4,
189
+ :SDL_GPU_VERTEXELEMENTFORMAT_BYTE2,
190
+ :SDL_GPU_VERTEXELEMENTFORMAT_BYTE4,
191
+ :SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2,
192
+ :SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4,
193
+ :SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM,
194
+ :SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM,
195
+ :SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM,
196
+ :SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM,
197
+ :SDL_GPU_VERTEXELEMENTFORMAT_SHORT2,
198
+ :SDL_GPU_VERTEXELEMENTFORMAT_SHORT4,
199
+ :SDL_GPU_VERTEXELEMENTFORMAT_USHORT2,
200
+ :SDL_GPU_VERTEXELEMENTFORMAT_USHORT4,
201
+ :SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM,
202
+ :SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM,
203
+ :SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM,
204
+ :SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM,
205
+ :SDL_GPU_VERTEXELEMENTFORMAT_HALF2,
206
+ :SDL_GPU_VERTEXELEMENTFORMAT_HALF4
207
+
208
+ SDL_GPUVertexInputRate = enum :SDL_GPU_VERTEXINPUTRATE_VERTEX, 0,
209
+ :SDL_GPU_VERTEXINPUTRATE_INSTANCE
210
+
211
+ SDL_GPUFillMode = enum :SDL_GPU_FILLMODE_FILL, 0,
212
+ :SDL_GPU_FILLMODE_LINE
213
+
214
+ SDL_GPUCullMode = enum :SDL_GPU_CULLMODE_NONE, 0,
215
+ :SDL_GPU_CULLMODE_FRONT,
216
+ :SDL_GPU_CULLMODE_BACK
217
+
218
+ SDL_GPUFrontFace = enum :SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, 0,
219
+ :SDL_GPU_FRONTFACE_CLOCKWISE
220
+
221
+ SDL_GPUCompareOp = enum :SDL_GPU_COMPAREOP_INVALID, 0,
222
+ :SDL_GPU_COMPAREOP_NEVER,
223
+ :SDL_GPU_COMPAREOP_LESS,
224
+ :SDL_GPU_COMPAREOP_EQUAL,
225
+ :SDL_GPU_COMPAREOP_LESS_OR_EQUAL,
226
+ :SDL_GPU_COMPAREOP_GREATER,
227
+ :SDL_GPU_COMPAREOP_NOT_EQUAL,
228
+ :SDL_GPU_COMPAREOP_GREATER_OR_EQUAL,
229
+ :SDL_GPU_COMPAREOP_ALWAYS
230
+
231
+ SDL_GPUStencilOp = enum :SDL_GPU_STENCILOP_INVALID, 0,
232
+ :SDL_GPU_STENCILOP_KEEP,
233
+ :SDL_GPU_STENCILOP_ZERO,
234
+ :SDL_GPU_STENCILOP_REPLACE,
235
+ :SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP,
236
+ :SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP,
237
+ :SDL_GPU_STENCILOP_INVERT,
238
+ :SDL_GPU_STENCILOP_INCREMENT_AND_WRAP,
239
+ :SDL_GPU_STENCILOP_DECREMENT_AND_WRAP
240
+
241
+ SDL_GPUBlendOp = enum :SDL_GPU_BLENDOP_INVALID, 0,
242
+ :SDL_GPU_BLENDOP_ADD,
243
+ :SDL_GPU_BLENDOP_SUBTRACT,
244
+ :SDL_GPU_BLENDOP_REVERSE_SUBTRACT,
245
+ :SDL_GPU_BLENDOP_MIN,
246
+ :SDL_GPU_BLENDOP_MAX
247
+
248
+ SDL_GPUBlendFactor = enum :SDL_GPU_BLENDFACTOR_INVALID, 0,
249
+ :SDL_GPU_BLENDFACTOR_ZERO,
250
+ :SDL_GPU_BLENDFACTOR_ONE,
251
+ :SDL_GPU_BLENDFACTOR_SRC_COLOR,
252
+ :SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR,
253
+ :SDL_GPU_BLENDFACTOR_DST_COLOR,
254
+ :SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR,
255
+ :SDL_GPU_BLENDFACTOR_SRC_ALPHA,
256
+ :SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
257
+ :SDL_GPU_BLENDFACTOR_DST_ALPHA,
258
+ :SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA,
259
+ :SDL_GPU_BLENDFACTOR_CONSTANT_COLOR,
260
+ :SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR,
261
+ :SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
262
+
263
+ SDL_GPUColorComponentFlags = enum :SDL_GPU_COLORCOMPONENT_R, 0x00000001,
264
+ :SDL_GPU_COLORCOMPONENT_G, 0x00000002,
265
+ :SDL_GPU_COLORCOMPONENT_B, 0x00000004,
266
+ :SDL_GPU_COLORCOMPONENT_A, 0x00000008
267
+
268
+ SDL_GPUFilter = enum :SDL_GPU_FILTER_NEAREST, 0,
269
+ :SDL_GPU_FILTER_LINEAR
270
+
271
+ SDL_GPUSamplerMipmapMode = enum :SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, 0,
272
+ :SDL_GPU_SAMPLERMIPMAPMODE_LINEAR
273
+
274
+ SDL_GPUSamplerAddressMode = enum :SDL_GPU_SAMPLERADDRESSMODE_REPEAT, 0,
275
+ :SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT,
276
+ :SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE
277
+
278
+ SDL_GPUPresentMode = enum :SDL_GPU_PRESENTMODE_VSYNC, 0,
279
+ :SDL_GPU_PRESENTMODE_IMMEDIATE,
280
+ :SDL_GPU_PRESENTMODE_MAILBOX
281
+
282
+ SDL_GPUSwapchainComposition = enum :SDL_GPU_SWAPCHAINCOMPOSITION_SDR, 0,
283
+ :SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR,
284
+ :SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR,
285
+ :SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084
286
+
287
+ class SDL_GPUViewport < FFI::Struct
288
+ layout :x, :float,
289
+ :y, :float,
290
+ :w, :float,
291
+ :h, :float,
292
+ :min_depth, :float,
293
+ :max_depth, :float
294
+ end
295
+
296
+ class SDL_GPUTextureTransferInfo < FFI::Struct
297
+ layout :transfer_buffer, :pointer,
298
+ :offset, :uint32,
299
+ :pixels_per_row, :uint32,
300
+ :rows_per_layer, :uint32
301
+ end
302
+
303
+ class SDL_GPUTransferBufferLocation < FFI::Struct
304
+ layout :transfer_buffer, :pointer,
305
+ :offset, :uint32
306
+ end
307
+
308
+ class SDL_GPUTextureLocation < FFI::Struct
309
+ layout :texture, :pointer,
310
+ :mip_level, :uint32,
311
+ :layer, :uint32,
312
+ :x, :uint32,
313
+ :y, :uint32,
314
+ :z, :uint32
315
+ end
316
+
317
+ class SDL_GPUTextureRegion < FFI::Struct
318
+ layout :texture, :pointer,
319
+ :mip_level, :uint32,
320
+ :layer, :uint32,
321
+ :x, :uint32,
322
+ :y, :uint32,
323
+ :z, :uint32,
324
+ :w, :uint32,
325
+ :h, :uint32,
326
+ :d, :uint32
327
+ end
328
+
329
+ class SDL_GPUBlitRegion < FFI::Struct
330
+ layout :texture, :pointer,
331
+ :mip_level, :uint32,
332
+ :layer_or_depth_plane, :uint32,
333
+ :x, :uint32,
334
+ :y, :uint32,
335
+ :w, :uint32,
336
+ :h, :uint32
337
+ end
338
+
339
+ class SDL_GPUBufferLocation < FFI::Struct
340
+ layout :buffer, :pointer,
341
+ :offset, :uint32
342
+ end
343
+
344
+ class SDL_GPUBufferRegion < FFI::Struct
345
+ layout :buffer, :pointer,
346
+ :offset, :uint32,
347
+ :size, :uint32
348
+ end
349
+
350
+ class SDL_GPUIndirectDrawCommand < FFI::Struct
351
+ layout :num_vertices, :uint32,
352
+ :num_instances, :uint32,
353
+ :first_vertex, :uint32,
354
+ :first_instance, :uint32
355
+ end
356
+
357
+ class SDL_GPUIndexedIndirectDrawCommand < FFI::Struct
358
+ layout :num_indices, :uint32,
359
+ :num_instances, :uint32,
360
+ :first_index, :uint32,
361
+ :vertex_offset, :int32,
362
+ :first_instance, :uint32
363
+ end
364
+
365
+ class SDL_GPUIndirectDispatchCommand < FFI::Struct
366
+ layout :groupcount_x, :uint32,
367
+ :groupcount_y, :uint32,
368
+ :groupcount_z, :uint32
369
+ end
370
+
371
+ class SDL_GPUSamplerCreateInfo < FFI::Struct
372
+ layout :min_filter, SDL_GPUFilter,
373
+ :mag_filter, SDL_GPUFilter,
374
+ :mipmap_mode, SDL_GPUSamplerMipmapMode,
375
+ :address_mode_u, SDL_GPUSamplerAddressMode,
376
+ :address_mode_v, SDL_GPUSamplerAddressMode,
377
+ :address_mode_w, SDL_GPUSamplerAddressMode,
378
+ :mip_lod_bias, :float,
379
+ :max_anisotropy, :float,
380
+ :compare_op, SDL_GPUCompareOp,
381
+ :min_lod, :float,
382
+ :max_lod, :float,
383
+ :enable_anisotropy, :bool,
384
+ :enable_compare, :bool,
385
+ :padding1, :uint8,
386
+ :padding2, :uint8,
387
+ :props, :SDL_PropertiesID
388
+ end
389
+
390
+ class SDL_GPUVertexBufferDescription < FFI::Struct
391
+ layout :slot, :uint32,
392
+ :pitch, :uint32,
393
+ :input_rate, SDL_GPUVertexInputRate,
394
+ :instance_step_rate, :uint32
395
+ end
396
+
397
+ class SDL_GPUVertexAttribute < FFI::Struct
398
+ layout :location, :uint32,
399
+ :buffer_slot, :uint32,
400
+ :format, SDL_GPUVertexElementFormat,
401
+ :offset, :uint32
402
+ end
403
+
404
+ class SDL_GPUVertexInputState < FFI::Struct
405
+ layout :vertex_buffer_descriptions, :pointer,
406
+ :num_vertex_buffers, :uint32,
407
+ :vertex_attributes, :pointer,
408
+ :num_vertex_attributes, :uint32
409
+ end
410
+
411
+ class SDL_GPUStencilOpState < FFI::Struct
412
+ layout :fail_op, SDL_GPUStencilOp,
413
+ :pass_op, SDL_GPUStencilOp,
414
+ :depth_fail_op, SDL_GPUStencilOp,
415
+ :compare_op, SDL_GPUCompareOp
416
+ end
417
+
418
+ class SDL_GPUColorTargetBlendState < FFI::Struct
419
+ layout :src_color_blendfactor, SDL_GPUBlendFactor,
420
+ :dst_color_blendfactor, SDL_GPUBlendFactor,
421
+ :color_blend_op, SDL_GPUBlendOp,
422
+ :src_alpha_blendfactor, SDL_GPUBlendFactor,
423
+ :dst_alpha_blendfactor, SDL_GPUBlendFactor,
424
+ :alpha_blend_op, SDL_GPUBlendOp,
425
+ :color_write_mask, :uint8,
426
+ :enable_blend, :bool,
427
+ :enable_color_write_mask, :bool,
428
+ :padding1, :uint8,
429
+ :padding2, :uint8
430
+ end
431
+
432
+ class SDL_GPUShaderCreateInfo < FFI::Struct
433
+ layout :code_size, :size_t,
434
+ :code, :pointer,
435
+ :entrypoint, :string,
436
+ :format, :uint32,
437
+ :stage, SDL_GPUShaderStage,
438
+ :num_samplers, :uint32,
439
+ :num_storage_textures, :uint32,
440
+ :num_storage_buffers, :uint32,
441
+ :num_uniform_buffers, :uint32,
442
+ :props, :SDL_PropertiesID
443
+ end
444
+
445
+ class SDL_GPUTextureCreateInfo < FFI::Struct
446
+ layout :type, SDL_GPUTextureType,
447
+ :format, SDL_GPUTextureFormat,
448
+ :usage, :uint32,
449
+ :width, :uint32,
450
+ :height, :uint32,
451
+ :layer_count_or_depth, :uint32,
452
+ :num_levels, :uint32,
453
+ :sample_count, SDL_GPUSampleCount,
454
+ :props, :SDL_PropertiesID
455
+ end
456
+
457
+ class SDL_GPUBufferCreateInfo < FFI::Struct
458
+ layout :usage, :uint32,
459
+ :size, :uint32,
460
+ :props, :SDL_PropertiesID
461
+ end
462
+
463
+ class SDL_GPUTransferBufferCreateInfo < FFI::Struct
464
+ layout :usage, SDL_GPUTransferBufferUsage,
465
+ :size, :uint32,
466
+ :props, :SDL_PropertiesID
467
+ end
468
+
469
+ class SDL_GPURasterizerState < FFI::Struct
470
+ layout :fill_mode, SDL_GPUFillMode,
471
+ :cull_mode, SDL_GPUCullMode,
472
+ :front_face, SDL_GPUFrontFace,
473
+ :depth_bias_constant_factor, :float,
474
+ :depth_bias_clamp, :float,
475
+ :depth_bias_slope_factor, :float,
476
+ :enable_depth_bias, :bool,
477
+ :enable_depth_clip, :bool,
478
+ :padding1, :uint8,
479
+ :padding2, :uint8
480
+ end
481
+
482
+ class SDL_GPUMultisampleState < FFI::Struct
483
+ layout :sample_count, SDL_GPUSampleCount,
484
+ :sample_mask, :uint32,
485
+ :enable_mask, :bool,
486
+ :padding1, :uint8,
487
+ :padding2, :uint8,
488
+ :padding3, :uint8
489
+ end
490
+
491
+ class SDL_GPUDepthStencilState < FFI::Struct
492
+ layout :compare_op, SDL_GPUCompareOp,
493
+ :back_stencil_state, SDL_GPUStencilOpState,
494
+ :front_stencil_state, SDL_GPUStencilOpState,
495
+ :compare_mask, :uint8,
496
+ :write_mask, :uint8,
497
+ :enable_depth_test, :bool,
498
+ :enable_depth_write, :bool,
499
+ :enable_stencil_test, :bool,
500
+ :padding1, :uint8,
501
+ :padding2, :uint8,
502
+ :padding3, :uint8
503
+ end
504
+
505
+ class SDL_GPUColorTargetDescription < FFI::Struct
506
+ layout :format, SDL_GPUTextureFormat,
507
+ :blend_state, SDL_GPUColorTargetBlendState
508
+ end
509
+
510
+ class SDL_GPUGraphicsPipelineTargetInfo < FFI::Struct
511
+ layout :color_target_descriptions, :pointer,
512
+ :num_color_targets, :uint32,
513
+ :depth_stencil_format, SDL_GPUTextureFormat,
514
+ :has_depth_stencil_target, :bool,
515
+ :padding1, :uint8,
516
+ :padding2, :uint8,
517
+ :padding3, :uint8
518
+ end
519
+
520
+ class SDL_GPUGraphicsPipelineCreateInfo < FFI::Struct
521
+ layout :vertex_shader, :pointer,
522
+ :fragment_shader, :pointer,
523
+ :vertex_input_state, SDL_GPUVertexInputState,
524
+ :primitive_type, SDL_GPUPrimitiveType,
525
+ :rasterizer_state, SDL_GPURasterizerState,
526
+ :multisample_state, SDL_GPUMultisampleState,
527
+ :depth_stencil_state, SDL_GPUDepthStencilState,
528
+ :target_info, SDL_GPUGraphicsPipelineTargetInfo,
529
+ :props, :SDL_PropertiesID
530
+ end
531
+
532
+ class SDL_GPUComputePipelineCreateInfo < FFI::Struct
533
+ layout :code_size, :size_t,
534
+ :code, :pointer,
535
+ :entrypoint, :string,
536
+ :format, :uint32,
537
+ :num_samplers, :uint32,
538
+ :num_readonly_storage_textures, :uint32,
539
+ :num_readonly_storage_buffers, :uint32,
540
+ :num_readwrite_storage_textures, :uint32,
541
+ :num_readwrite_storage_buffers, :uint32,
542
+ :num_uniform_buffers, :uint32,
543
+ :threadcount_x, :uint32,
544
+ :threadcount_y, :uint32,
545
+ :threadcount_z, :uint32,
546
+ :props, :SDL_PropertiesID
547
+ end
548
+
549
+ class SDL_GPUColorTargetInfo < FFI::Struct
550
+ layout :texture, :pointer,
551
+ :mip_level, :uint32,
552
+ :layer_or_depth_plane, :uint32,
553
+ :clear_color, SDL_FColor,
554
+ :load_op, SDL_GPULoadOp,
555
+ :store_op, SDL_GPUStoreOp,
556
+ :resolve_texture, :pointer,
557
+ :resolve_mip_level, :uint32,
558
+ :resolve_layer, :uint32,
559
+ :cycle, :bool,
560
+ :cycle_resolve_texture, :bool,
561
+ :padding1, :uint8,
562
+ :padding2, :uint8
563
+ end
564
+
565
+ class SDL_GPUDepthStencilTargetInfo < FFI::Struct
566
+ layout :texture, :pointer,
567
+ :clear_depth, :float,
568
+ :load_op, SDL_GPULoadOp,
569
+ :store_op, SDL_GPUStoreOp,
570
+ :stencil_load_op, SDL_GPULoadOp,
571
+ :stencil_store_op, SDL_GPUStoreOp,
572
+ :cycle, :bool,
573
+ :clear_stencil, :uint8,
574
+ :padding1, :uint8,
575
+ :padding2, :uint8
576
+ end
577
+
578
+ class SDL_GPUBlitInfo < FFI::Struct
579
+ layout :source, SDL_GPUBlitRegion,
580
+ :destination, SDL_GPUBlitRegion,
581
+ :load_op, SDL_GPULoadOp,
582
+ :clear_color, SDL_FColor,
583
+ :flip_mode, :int,
584
+ :filter, SDL_GPUFilter,
585
+ :cycle, :bool,
586
+ :padding1, :uint8,
587
+ :padding2, :uint8,
588
+ :padding3, :uint8
589
+ end
590
+
591
+ class SDL_GPUBufferBinding < FFI::Struct
592
+ layout :buffer, :pointer,
593
+ :offset, :uint32
594
+ end
595
+
596
+ class SDL_GPUTextureSamplerBinding < FFI::Struct
597
+ layout :texture, :pointer,
598
+ :sampler, :pointer
599
+ end
600
+
601
+ class SDL_GPUStorageBufferReadWriteBinding < FFI::Struct
602
+ layout :buffer, :pointer,
603
+ :cycle, :bool,
604
+ :padding1, :uint8,
605
+ :padding2, :uint8,
606
+ :padding3, :uint8
607
+ end
608
+
609
+ class SDL_GPUStorageTextureReadWriteBinding < FFI::Struct
610
+ layout :texture, :pointer,
611
+ :mip_level, :uint32,
612
+ :layer, :uint32,
613
+ :cycle, :bool,
614
+ :padding1, :uint8,
615
+ :padding2, :uint8,
616
+ :padding3, :uint8
617
+ end
618
+
619
+ begin
620
+ attach_function :SDL_GPUSupportsShaderFormats, %i[uint32 string], :bool
621
+ attach_function :SDL_GPUSupportsProperties, [:SDL_PropertiesID], :bool
622
+ attach_function :SDL_CreateGPUDevice, %i[uint32 bool string], :pointer
623
+ attach_function :SDL_CreateGPUDeviceWithProperties, [:SDL_PropertiesID], :pointer
624
+ attach_function :SDL_DestroyGPUDevice, [:pointer], :void
625
+ attach_function :SDL_GetNumGPUDrivers, [], :int
626
+ attach_function :SDL_GetGPUDriver, [:int], :string
627
+ attach_function :SDL_GetGPUDeviceDriver, [:pointer], :string
628
+ begin
629
+ attach_function :SDL_GetGPUDeviceProperties, [:pointer], :SDL_PropertiesID
630
+ rescue FFI::NotFoundError
631
+ # Added in newer SDL3 versions.
632
+ end
633
+ attach_function :SDL_GetGPUShaderFormats, [:pointer], :uint32
634
+ attach_function :SDL_CreateGPUComputePipeline, [:pointer, SDL_GPUComputePipelineCreateInfo.ptr], :pointer
635
+ attach_function :SDL_CreateGPUGraphicsPipeline, [:pointer, SDL_GPUGraphicsPipelineCreateInfo.ptr], :pointer
636
+ attach_function :SDL_CreateGPUSampler, [:pointer, SDL_GPUSamplerCreateInfo.ptr], :pointer
637
+ attach_function :SDL_CreateGPUShader, [:pointer, SDL_GPUShaderCreateInfo.ptr], :pointer
638
+ attach_function :SDL_CreateGPUTexture, [:pointer, SDL_GPUTextureCreateInfo.ptr], :pointer
639
+ attach_function :SDL_CreateGPUBuffer, [:pointer, SDL_GPUBufferCreateInfo.ptr], :pointer
640
+ attach_function :SDL_CreateGPUTransferBuffer, [:pointer, SDL_GPUTransferBufferCreateInfo.ptr], :pointer
641
+ attach_function :SDL_SetGPUBufferName, %i[pointer pointer string], :void
642
+ attach_function :SDL_SetGPUTextureName, %i[pointer pointer string], :void
643
+ attach_function :SDL_InsertGPUDebugLabel, %i[pointer string], :void
644
+ attach_function :SDL_PushGPUDebugGroup, %i[pointer string], :void
645
+ attach_function :SDL_PopGPUDebugGroup, [:pointer], :void
646
+ attach_function :SDL_ReleaseGPUTexture, %i[pointer pointer], :void
647
+ attach_function :SDL_ReleaseGPUSampler, %i[pointer pointer], :void
648
+ attach_function :SDL_ReleaseGPUBuffer, %i[pointer pointer], :void
649
+ attach_function :SDL_ReleaseGPUTransferBuffer, %i[pointer pointer], :void
650
+ attach_function :SDL_ReleaseGPUComputePipeline, %i[pointer pointer], :void
651
+ attach_function :SDL_ReleaseGPUShader, %i[pointer pointer], :void
652
+ attach_function :SDL_ReleaseGPUGraphicsPipeline, %i[pointer pointer], :void
653
+ attach_function :SDL_AcquireGPUCommandBuffer, [:pointer], :pointer
654
+ attach_function :SDL_PushGPUVertexUniformData, %i[pointer uint32 pointer uint32], :void
655
+ attach_function :SDL_PushGPUFragmentUniformData, %i[pointer uint32 pointer uint32], :void
656
+ attach_function :SDL_PushGPUComputeUniformData, %i[pointer uint32 pointer uint32], :void
657
+ attach_function :SDL_BeginGPURenderPass, [:pointer, :pointer, :uint32, SDL_GPUDepthStencilTargetInfo.ptr], :pointer
658
+ attach_function :SDL_BindGPUGraphicsPipeline, %i[pointer pointer], :void
659
+ attach_function :SDL_SetGPUViewport, [:pointer, SDL_GPUViewport.ptr], :void
660
+ attach_function :SDL_SetGPUScissor, [:pointer, SDL_Rect.ptr], :void
661
+ attach_function :SDL_SetGPUBlendConstants, [:pointer, SDL_FColor], :void
662
+ attach_function :SDL_SetGPUStencilReference, %i[pointer uint8], :void
663
+ attach_function :SDL_BindGPUVertexBuffers, %i[pointer uint32 pointer uint32], :void
664
+ attach_function :SDL_BindGPUIndexBuffer, [:pointer, SDL_GPUBufferBinding.ptr, SDL_GPUIndexElementSize], :void
665
+ attach_function :SDL_BindGPUVertexSamplers, %i[pointer uint32 pointer uint32], :void
666
+ attach_function :SDL_BindGPUVertexStorageTextures, %i[pointer uint32 pointer uint32], :void
667
+ attach_function :SDL_BindGPUVertexStorageBuffers, %i[pointer uint32 pointer uint32], :void
668
+ attach_function :SDL_BindGPUFragmentSamplers, %i[pointer uint32 pointer uint32], :void
669
+ attach_function :SDL_BindGPUFragmentStorageTextures, %i[pointer uint32 pointer uint32], :void
670
+ attach_function :SDL_BindGPUFragmentStorageBuffers, %i[pointer uint32 pointer uint32], :void
671
+ attach_function :SDL_DrawGPUIndexedPrimitives, %i[pointer uint32 uint32 uint32 int32 uint32], :void
672
+ attach_function :SDL_DrawGPUPrimitives, %i[pointer uint32 uint32 uint32 uint32], :void
673
+ attach_function :SDL_DrawGPUPrimitivesIndirect, [:pointer, :pointer, :uint32, :uint32], :void
674
+ attach_function :SDL_DrawGPUIndexedPrimitivesIndirect, [:pointer, :pointer, :uint32, :uint32], :void
675
+ attach_function :SDL_EndGPURenderPass, [:pointer], :void
676
+ attach_function :SDL_BeginGPUComputePass, %i[pointer pointer uint32 pointer uint32], :pointer
677
+ attach_function :SDL_BindGPUComputePipeline, %i[pointer pointer], :void
678
+ attach_function :SDL_BindGPUComputeSamplers, %i[pointer uint32 pointer uint32], :void
679
+ attach_function :SDL_BindGPUComputeStorageTextures, %i[pointer uint32 pointer uint32], :void
680
+ attach_function :SDL_BindGPUComputeStorageBuffers, %i[pointer uint32 pointer uint32], :void
681
+ attach_function :SDL_DispatchGPUCompute, %i[pointer uint32 uint32 uint32], :void
682
+ attach_function :SDL_DispatchGPUComputeIndirect, %i[pointer pointer uint32], :void
683
+ attach_function :SDL_EndGPUComputePass, [:pointer], :void
684
+ attach_function :SDL_MapGPUTransferBuffer, %i[pointer pointer bool], :pointer
685
+ attach_function :SDL_UnmapGPUTransferBuffer, %i[pointer pointer], :void
686
+ attach_function :SDL_BeginGPUCopyPass, [:pointer], :pointer
687
+ attach_function :SDL_UploadToGPUTexture, [:pointer, SDL_GPUTextureTransferInfo.ptr, SDL_GPUTextureRegion.ptr, :bool], :void
688
+ attach_function :SDL_UploadToGPUBuffer, [:pointer, SDL_GPUTransferBufferLocation.ptr, SDL_GPUBufferRegion.ptr, :bool], :void
689
+ attach_function :SDL_CopyGPUTextureToTexture, [:pointer, SDL_GPUTextureLocation.ptr, SDL_GPUTextureLocation.ptr, :uint32, :uint32, :uint32, :bool], :void
690
+ attach_function :SDL_CopyGPUBufferToBuffer, [:pointer, SDL_GPUBufferLocation.ptr, SDL_GPUBufferLocation.ptr, :uint32, :bool], :void
691
+ attach_function :SDL_DownloadFromGPUTexture, [:pointer, SDL_GPUTextureRegion.ptr, SDL_GPUTextureTransferInfo.ptr], :void
692
+ attach_function :SDL_DownloadFromGPUBuffer, [:pointer, SDL_GPUBufferRegion.ptr, SDL_GPUTransferBufferLocation.ptr], :void
693
+ attach_function :SDL_EndGPUCopyPass, [:pointer], :void
694
+ attach_function :SDL_GenerateMipmapsForGPUTexture, %i[pointer pointer], :void
695
+ attach_function :SDL_BlitGPUTexture, [:pointer, SDL_GPUBlitInfo.ptr], :void
696
+ attach_function :SDL_WindowSupportsGPUSwapchainComposition, %i[pointer pointer int], :bool
697
+ attach_function :SDL_WindowSupportsGPUPresentMode, %i[pointer pointer int], :bool
698
+ attach_function :SDL_ClaimWindowForGPUDevice, %i[pointer pointer], :bool
699
+ attach_function :SDL_ReleaseWindowFromGPUDevice, %i[pointer pointer], :void
700
+ attach_function :SDL_SetGPUSwapchainParameters, %i[pointer pointer int int], :bool
701
+ attach_function :SDL_SetGPUAllowedFramesInFlight, %i[pointer uint32], :bool
702
+ attach_function :SDL_GetGPUSwapchainTextureFormat, %i[pointer pointer], SDL_GPUTextureFormat
703
+ attach_function :SDL_AcquireGPUSwapchainTexture, %i[pointer pointer pointer pointer pointer], :bool
704
+ attach_function :SDL_WaitForGPUSwapchain, %i[pointer pointer], :bool
705
+ attach_function :SDL_WaitAndAcquireGPUSwapchainTexture, %i[pointer pointer pointer pointer pointer], :bool
706
+ attach_function :SDL_SubmitGPUCommandBuffer, [:pointer], :bool
707
+ attach_function :SDL_SubmitGPUCommandBufferAndAcquireFence, [:pointer], :pointer
708
+ attach_function :SDL_CancelGPUCommandBuffer, [:pointer], :bool
709
+ attach_function :SDL_WaitForGPUIdle, [:pointer], :bool
710
+ attach_function :SDL_WaitForGPUFences, %i[pointer bool pointer uint32], :bool
711
+ attach_function :SDL_QueryGPUFence, %i[pointer pointer], :bool
712
+ attach_function :SDL_ReleaseGPUFence, %i[pointer pointer], :void
713
+ attach_function :SDL_GPUTextureFormatTexelBlockSize, [SDL_GPUTextureFormat], :uint32
714
+ attach_function :SDL_GPUTextureSupportsFormat, [:pointer, SDL_GPUTextureFormat, SDL_GPUTextureType, :uint32], :bool
715
+ attach_function :SDL_GPUTextureSupportsSampleCount, [:pointer, SDL_GPUTextureFormat, SDL_GPUSampleCount], :bool
716
+ attach_function :SDL_CalculateGPUTextureFormatSize, [SDL_GPUTextureFormat, :uint32, :uint32, :uint32], :uint32
717
+ begin
718
+ attach_function :SDL_GetPixelFormatFromGPUTextureFormat, [SDL_GPUTextureFormat], :uint32
719
+ attach_function :SDL_GetGPUTextureFormatFromPixelFormat, [:uint32], SDL_GPUTextureFormat
720
+ rescue FFI::NotFoundError
721
+ # Added in newer SDL3 versions.
722
+ end
723
+
724
+ begin
725
+ attach_function :SDL_GDKSuspendGPU, [:pointer], :void
726
+ attach_function :SDL_GDKResumeGPU, [:pointer], :void
727
+ rescue FFI::NotFoundError
728
+ # GDK-only APIs are not available on all platforms.
729
+ end
730
+ rescue FFI::NotFoundError
731
+ # GPU API may not be available in all SDL3 versions
732
+ end
733
+ end
734
+ end