sdl2-bindings 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +145 -134
  3. data/LICENSE.txt +0 -0
  4. data/README.md +108 -86
  5. data/lib/sdl2.rb +131 -131
  6. data/lib/sdl2_audio.rb +265 -261
  7. data/lib/sdl2_blendmode.rb +72 -72
  8. data/lib/sdl2_clipboard.rb +56 -56
  9. data/lib/sdl2_cpuinfo.rb +137 -129
  10. data/lib/sdl2_error.rb +71 -71
  11. data/lib/sdl2_events.rb +575 -564
  12. data/lib/sdl2_filesystem.rb +52 -52
  13. data/lib/sdl2_framerate.rb +74 -74
  14. data/lib/sdl2_gamecontroller.rb +345 -329
  15. data/lib/sdl2_gesture.rb +61 -61
  16. data/lib/sdl2_gfxPrimitives.rb +283 -283
  17. data/lib/sdl2_guid.rb +58 -0
  18. data/lib/sdl2_haptic.rb +301 -301
  19. data/lib/sdl2_hidapi.rb +139 -139
  20. data/lib/sdl2_hints.rb +240 -221
  21. data/lib/sdl2_image.rb +296 -296
  22. data/lib/sdl2_imageFilter.rb +164 -164
  23. data/lib/sdl2_joystick.rb +332 -294
  24. data/lib/sdl2_keyboard.rb +129 -125
  25. data/lib/sdl2_keycode.rb +311 -307
  26. data/lib/sdl2_log.rb +131 -131
  27. data/lib/sdl2_main.rb +74 -74
  28. data/lib/sdl2_messagebox.rb +102 -102
  29. data/lib/sdl2_misc.rb +48 -48
  30. data/lib/sdl2_mixer.rb +464 -464
  31. data/lib/sdl2_mouse.rb +136 -136
  32. data/lib/sdl2_pixels.rb +240 -240
  33. data/lib/sdl2_platform.rb +48 -48
  34. data/lib/sdl2_power.rb +54 -54
  35. data/lib/sdl2_rect.rb +145 -145
  36. data/lib/sdl2_render.rb +408 -408
  37. data/lib/sdl2_rotozoom.rb +76 -76
  38. data/lib/sdl2_rwops.rb +242 -242
  39. data/lib/sdl2_scancode.rb +293 -289
  40. data/lib/sdl2_sensor.rb +115 -115
  41. data/lib/sdl2_shape.rb +83 -83
  42. data/lib/sdl2_sound.rb +154 -154
  43. data/lib/sdl2_stdinc.rb +572 -548
  44. data/lib/sdl2_surface.rb +229 -229
  45. data/lib/sdl2_syswm.rb +160 -160
  46. data/lib/sdl2_timer.rb +74 -74
  47. data/lib/sdl2_touch.rb +86 -86
  48. data/lib/sdl2_ttf.rb +414 -414
  49. data/lib/sdl2_version.rb +67 -67
  50. data/lib/sdl2_video.rb +549 -540
  51. data/lib/sdl2_vulkan.rb +72 -72
  52. metadata +4 -3
data/lib/sdl2_render.rb CHANGED
@@ -1,408 +1,408 @@
1
- # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/sdl2-bindings
4
- #
5
- # [NOTICE] This is an automatically generated file.
6
-
7
- require 'ffi'
8
-
9
- module SDL
10
- extend FFI::Library
11
- # Define/Macro
12
-
13
-
14
- # Enum
15
-
16
- RENDERER_SOFTWARE = 1
17
- RENDERER_ACCELERATED = 2
18
- RENDERER_PRESENTVSYNC = 4
19
- RENDERER_TARGETTEXTURE = 8
20
- ScaleModeNearest = 0
21
- ScaleModeLinear = 1
22
- ScaleModeBest = 2
23
- TEXTUREACCESS_STATIC = 0
24
- TEXTUREACCESS_STREAMING = 1
25
- TEXTUREACCESS_TARGET = 2
26
- TEXTUREMODULATE_NONE = 0
27
- TEXTUREMODULATE_COLOR = 1
28
- TEXTUREMODULATE_ALPHA = 2
29
- FLIP_NONE = 0
30
- FLIP_HORIZONTAL = 1
31
- FLIP_VERTICAL = 2
32
-
33
- # Typedef
34
-
35
- typedef :int, :SDL_RendererFlags
36
- typedef :int, :SDL_ScaleMode
37
- typedef :int, :SDL_TextureAccess
38
- typedef :int, :SDL_TextureModulate
39
- typedef :int, :SDL_RendererFlip
40
-
41
- # Struct
42
-
43
- class RendererInfo < FFI::Struct
44
- layout(
45
- :name, :pointer,
46
- :flags, :uint,
47
- :num_texture_formats, :uint,
48
- :texture_formats, [:uint, 16],
49
- :max_texture_width, :int,
50
- :max_texture_height, :int,
51
- )
52
- end
53
-
54
- class Vertex < FFI::Struct
55
- layout(
56
- :position, FPoint,
57
- :color, Color,
58
- :tex_coord, FPoint,
59
- )
60
- end
61
-
62
-
63
- # Function
64
-
65
- def self.setup_render_symbols(output_error = false)
66
- symbols = [
67
- :SDL_GetNumRenderDrivers,
68
- :SDL_GetRenderDriverInfo,
69
- :SDL_CreateWindowAndRenderer,
70
- :SDL_CreateRenderer,
71
- :SDL_CreateSoftwareRenderer,
72
- :SDL_GetRenderer,
73
- :SDL_RenderGetWindow,
74
- :SDL_GetRendererInfo,
75
- :SDL_GetRendererOutputSize,
76
- :SDL_CreateTexture,
77
- :SDL_CreateTextureFromSurface,
78
- :SDL_QueryTexture,
79
- :SDL_SetTextureColorMod,
80
- :SDL_GetTextureColorMod,
81
- :SDL_SetTextureAlphaMod,
82
- :SDL_GetTextureAlphaMod,
83
- :SDL_SetTextureBlendMode,
84
- :SDL_GetTextureBlendMode,
85
- :SDL_SetTextureScaleMode,
86
- :SDL_GetTextureScaleMode,
87
- :SDL_SetTextureUserData,
88
- :SDL_GetTextureUserData,
89
- :SDL_UpdateTexture,
90
- :SDL_UpdateYUVTexture,
91
- :SDL_UpdateNVTexture,
92
- :SDL_LockTexture,
93
- :SDL_LockTextureToSurface,
94
- :SDL_UnlockTexture,
95
- :SDL_RenderTargetSupported,
96
- :SDL_SetRenderTarget,
97
- :SDL_GetRenderTarget,
98
- :SDL_RenderSetLogicalSize,
99
- :SDL_RenderGetLogicalSize,
100
- :SDL_RenderSetIntegerScale,
101
- :SDL_RenderGetIntegerScale,
102
- :SDL_RenderSetViewport,
103
- :SDL_RenderGetViewport,
104
- :SDL_RenderSetClipRect,
105
- :SDL_RenderGetClipRect,
106
- :SDL_RenderIsClipEnabled,
107
- :SDL_RenderSetScale,
108
- :SDL_RenderGetScale,
109
- :SDL_RenderWindowToLogical,
110
- :SDL_RenderLogicalToWindow,
111
- :SDL_SetRenderDrawColor,
112
- :SDL_GetRenderDrawColor,
113
- :SDL_SetRenderDrawBlendMode,
114
- :SDL_GetRenderDrawBlendMode,
115
- :SDL_RenderClear,
116
- :SDL_RenderDrawPoint,
117
- :SDL_RenderDrawPoints,
118
- :SDL_RenderDrawLine,
119
- :SDL_RenderDrawLines,
120
- :SDL_RenderDrawRect,
121
- :SDL_RenderDrawRects,
122
- :SDL_RenderFillRect,
123
- :SDL_RenderFillRects,
124
- :SDL_RenderCopy,
125
- :SDL_RenderCopyEx,
126
- :SDL_RenderDrawPointF,
127
- :SDL_RenderDrawPointsF,
128
- :SDL_RenderDrawLineF,
129
- :SDL_RenderDrawLinesF,
130
- :SDL_RenderDrawRectF,
131
- :SDL_RenderDrawRectsF,
132
- :SDL_RenderFillRectF,
133
- :SDL_RenderFillRectsF,
134
- :SDL_RenderCopyF,
135
- :SDL_RenderCopyExF,
136
- :SDL_RenderGeometry,
137
- :SDL_RenderGeometryRaw,
138
- :SDL_RenderReadPixels,
139
- :SDL_RenderPresent,
140
- :SDL_DestroyTexture,
141
- :SDL_DestroyRenderer,
142
- :SDL_RenderFlush,
143
- :SDL_GL_BindTexture,
144
- :SDL_GL_UnbindTexture,
145
- :SDL_RenderGetMetalLayer,
146
- :SDL_RenderGetMetalCommandEncoder,
147
- :SDL_RenderSetVSync,
148
- ]
149
- apis = {
150
- :SDL_GetNumRenderDrivers => :GetNumRenderDrivers,
151
- :SDL_GetRenderDriverInfo => :GetRenderDriverInfo,
152
- :SDL_CreateWindowAndRenderer => :CreateWindowAndRenderer,
153
- :SDL_CreateRenderer => :CreateRenderer,
154
- :SDL_CreateSoftwareRenderer => :CreateSoftwareRenderer,
155
- :SDL_GetRenderer => :GetRenderer,
156
- :SDL_RenderGetWindow => :RenderGetWindow,
157
- :SDL_GetRendererInfo => :GetRendererInfo,
158
- :SDL_GetRendererOutputSize => :GetRendererOutputSize,
159
- :SDL_CreateTexture => :CreateTexture,
160
- :SDL_CreateTextureFromSurface => :CreateTextureFromSurface,
161
- :SDL_QueryTexture => :QueryTexture,
162
- :SDL_SetTextureColorMod => :SetTextureColorMod,
163
- :SDL_GetTextureColorMod => :GetTextureColorMod,
164
- :SDL_SetTextureAlphaMod => :SetTextureAlphaMod,
165
- :SDL_GetTextureAlphaMod => :GetTextureAlphaMod,
166
- :SDL_SetTextureBlendMode => :SetTextureBlendMode,
167
- :SDL_GetTextureBlendMode => :GetTextureBlendMode,
168
- :SDL_SetTextureScaleMode => :SetTextureScaleMode,
169
- :SDL_GetTextureScaleMode => :GetTextureScaleMode,
170
- :SDL_SetTextureUserData => :SetTextureUserData,
171
- :SDL_GetTextureUserData => :GetTextureUserData,
172
- :SDL_UpdateTexture => :UpdateTexture,
173
- :SDL_UpdateYUVTexture => :UpdateYUVTexture,
174
- :SDL_UpdateNVTexture => :UpdateNVTexture,
175
- :SDL_LockTexture => :LockTexture,
176
- :SDL_LockTextureToSurface => :LockTextureToSurface,
177
- :SDL_UnlockTexture => :UnlockTexture,
178
- :SDL_RenderTargetSupported => :RenderTargetSupported,
179
- :SDL_SetRenderTarget => :SetRenderTarget,
180
- :SDL_GetRenderTarget => :GetRenderTarget,
181
- :SDL_RenderSetLogicalSize => :RenderSetLogicalSize,
182
- :SDL_RenderGetLogicalSize => :RenderGetLogicalSize,
183
- :SDL_RenderSetIntegerScale => :RenderSetIntegerScale,
184
- :SDL_RenderGetIntegerScale => :RenderGetIntegerScale,
185
- :SDL_RenderSetViewport => :RenderSetViewport,
186
- :SDL_RenderGetViewport => :RenderGetViewport,
187
- :SDL_RenderSetClipRect => :RenderSetClipRect,
188
- :SDL_RenderGetClipRect => :RenderGetClipRect,
189
- :SDL_RenderIsClipEnabled => :RenderIsClipEnabled,
190
- :SDL_RenderSetScale => :RenderSetScale,
191
- :SDL_RenderGetScale => :RenderGetScale,
192
- :SDL_RenderWindowToLogical => :RenderWindowToLogical,
193
- :SDL_RenderLogicalToWindow => :RenderLogicalToWindow,
194
- :SDL_SetRenderDrawColor => :SetRenderDrawColor,
195
- :SDL_GetRenderDrawColor => :GetRenderDrawColor,
196
- :SDL_SetRenderDrawBlendMode => :SetRenderDrawBlendMode,
197
- :SDL_GetRenderDrawBlendMode => :GetRenderDrawBlendMode,
198
- :SDL_RenderClear => :RenderClear,
199
- :SDL_RenderDrawPoint => :RenderDrawPoint,
200
- :SDL_RenderDrawPoints => :RenderDrawPoints,
201
- :SDL_RenderDrawLine => :RenderDrawLine,
202
- :SDL_RenderDrawLines => :RenderDrawLines,
203
- :SDL_RenderDrawRect => :RenderDrawRect,
204
- :SDL_RenderDrawRects => :RenderDrawRects,
205
- :SDL_RenderFillRect => :RenderFillRect,
206
- :SDL_RenderFillRects => :RenderFillRects,
207
- :SDL_RenderCopy => :RenderCopy,
208
- :SDL_RenderCopyEx => :RenderCopyEx,
209
- :SDL_RenderDrawPointF => :RenderDrawPointF,
210
- :SDL_RenderDrawPointsF => :RenderDrawPointsF,
211
- :SDL_RenderDrawLineF => :RenderDrawLineF,
212
- :SDL_RenderDrawLinesF => :RenderDrawLinesF,
213
- :SDL_RenderDrawRectF => :RenderDrawRectF,
214
- :SDL_RenderDrawRectsF => :RenderDrawRectsF,
215
- :SDL_RenderFillRectF => :RenderFillRectF,
216
- :SDL_RenderFillRectsF => :RenderFillRectsF,
217
- :SDL_RenderCopyF => :RenderCopyF,
218
- :SDL_RenderCopyExF => :RenderCopyExF,
219
- :SDL_RenderGeometry => :RenderGeometry,
220
- :SDL_RenderGeometryRaw => :RenderGeometryRaw,
221
- :SDL_RenderReadPixels => :RenderReadPixels,
222
- :SDL_RenderPresent => :RenderPresent,
223
- :SDL_DestroyTexture => :DestroyTexture,
224
- :SDL_DestroyRenderer => :DestroyRenderer,
225
- :SDL_RenderFlush => :RenderFlush,
226
- :SDL_GL_BindTexture => :GL_BindTexture,
227
- :SDL_GL_UnbindTexture => :GL_UnbindTexture,
228
- :SDL_RenderGetMetalLayer => :RenderGetMetalLayer,
229
- :SDL_RenderGetMetalCommandEncoder => :RenderGetMetalCommandEncoder,
230
- :SDL_RenderSetVSync => :RenderSetVSync,
231
- }
232
- args = {
233
- :SDL_GetNumRenderDrivers => [],
234
- :SDL_GetRenderDriverInfo => [:int, :pointer],
235
- :SDL_CreateWindowAndRenderer => [:int, :int, :uint, :pointer, :pointer],
236
- :SDL_CreateRenderer => [:pointer, :int, :uint],
237
- :SDL_CreateSoftwareRenderer => [:pointer],
238
- :SDL_GetRenderer => [:pointer],
239
- :SDL_RenderGetWindow => [:pointer],
240
- :SDL_GetRendererInfo => [:pointer, :pointer],
241
- :SDL_GetRendererOutputSize => [:pointer, :pointer, :pointer],
242
- :SDL_CreateTexture => [:pointer, :uint, :int, :int, :int],
243
- :SDL_CreateTextureFromSurface => [:pointer, :pointer],
244
- :SDL_QueryTexture => [:pointer, :pointer, :pointer, :pointer, :pointer],
245
- :SDL_SetTextureColorMod => [:pointer, :uchar, :uchar, :uchar],
246
- :SDL_GetTextureColorMod => [:pointer, :pointer, :pointer, :pointer],
247
- :SDL_SetTextureAlphaMod => [:pointer, :uchar],
248
- :SDL_GetTextureAlphaMod => [:pointer, :pointer],
249
- :SDL_SetTextureBlendMode => [:pointer, :int],
250
- :SDL_GetTextureBlendMode => [:pointer, :pointer],
251
- :SDL_SetTextureScaleMode => [:pointer, :int],
252
- :SDL_GetTextureScaleMode => [:pointer, :pointer],
253
- :SDL_SetTextureUserData => [:pointer, :pointer],
254
- :SDL_GetTextureUserData => [:pointer],
255
- :SDL_UpdateTexture => [:pointer, :pointer, :pointer, :int],
256
- :SDL_UpdateYUVTexture => [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int],
257
- :SDL_UpdateNVTexture => [:pointer, :pointer, :pointer, :int, :pointer, :int],
258
- :SDL_LockTexture => [:pointer, :pointer, :pointer, :pointer],
259
- :SDL_LockTextureToSurface => [:pointer, :pointer, :pointer],
260
- :SDL_UnlockTexture => [:pointer],
261
- :SDL_RenderTargetSupported => [:pointer],
262
- :SDL_SetRenderTarget => [:pointer, :pointer],
263
- :SDL_GetRenderTarget => [:pointer],
264
- :SDL_RenderSetLogicalSize => [:pointer, :int, :int],
265
- :SDL_RenderGetLogicalSize => [:pointer, :pointer, :pointer],
266
- :SDL_RenderSetIntegerScale => [:pointer, :int],
267
- :SDL_RenderGetIntegerScale => [:pointer],
268
- :SDL_RenderSetViewport => [:pointer, :pointer],
269
- :SDL_RenderGetViewport => [:pointer, :pointer],
270
- :SDL_RenderSetClipRect => [:pointer, :pointer],
271
- :SDL_RenderGetClipRect => [:pointer, :pointer],
272
- :SDL_RenderIsClipEnabled => [:pointer],
273
- :SDL_RenderSetScale => [:pointer, :float, :float],
274
- :SDL_RenderGetScale => [:pointer, :pointer, :pointer],
275
- :SDL_RenderWindowToLogical => [:pointer, :int, :int, :pointer, :pointer],
276
- :SDL_RenderLogicalToWindow => [:pointer, :float, :float, :pointer, :pointer],
277
- :SDL_SetRenderDrawColor => [:pointer, :uchar, :uchar, :uchar, :uchar],
278
- :SDL_GetRenderDrawColor => [:pointer, :pointer, :pointer, :pointer, :pointer],
279
- :SDL_SetRenderDrawBlendMode => [:pointer, :int],
280
- :SDL_GetRenderDrawBlendMode => [:pointer, :pointer],
281
- :SDL_RenderClear => [:pointer],
282
- :SDL_RenderDrawPoint => [:pointer, :int, :int],
283
- :SDL_RenderDrawPoints => [:pointer, :pointer, :int],
284
- :SDL_RenderDrawLine => [:pointer, :int, :int, :int, :int],
285
- :SDL_RenderDrawLines => [:pointer, :pointer, :int],
286
- :SDL_RenderDrawRect => [:pointer, :pointer],
287
- :SDL_RenderDrawRects => [:pointer, :pointer, :int],
288
- :SDL_RenderFillRect => [:pointer, :pointer],
289
- :SDL_RenderFillRects => [:pointer, :pointer, :int],
290
- :SDL_RenderCopy => [:pointer, :pointer, :pointer, :pointer],
291
- :SDL_RenderCopyEx => [:pointer, :pointer, :pointer, :pointer, :double, :pointer, :int],
292
- :SDL_RenderDrawPointF => [:pointer, :float, :float],
293
- :SDL_RenderDrawPointsF => [:pointer, :pointer, :int],
294
- :SDL_RenderDrawLineF => [:pointer, :float, :float, :float, :float],
295
- :SDL_RenderDrawLinesF => [:pointer, :pointer, :int],
296
- :SDL_RenderDrawRectF => [:pointer, :pointer],
297
- :SDL_RenderDrawRectsF => [:pointer, :pointer, :int],
298
- :SDL_RenderFillRectF => [:pointer, :pointer],
299
- :SDL_RenderFillRectsF => [:pointer, :pointer, :int],
300
- :SDL_RenderCopyF => [:pointer, :pointer, :pointer, :pointer],
301
- :SDL_RenderCopyExF => [:pointer, :pointer, :pointer, :pointer, :double, :pointer, :int],
302
- :SDL_RenderGeometry => [:pointer, :pointer, :pointer, :int, :pointer, :int],
303
- :SDL_RenderGeometryRaw => [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int, :int, :pointer, :int, :int],
304
- :SDL_RenderReadPixels => [:pointer, :pointer, :uint, :pointer, :int],
305
- :SDL_RenderPresent => [:pointer],
306
- :SDL_DestroyTexture => [:pointer],
307
- :SDL_DestroyRenderer => [:pointer],
308
- :SDL_RenderFlush => [:pointer],
309
- :SDL_GL_BindTexture => [:pointer, :pointer, :pointer],
310
- :SDL_GL_UnbindTexture => [:pointer],
311
- :SDL_RenderGetMetalLayer => [:pointer],
312
- :SDL_RenderGetMetalCommandEncoder => [:pointer],
313
- :SDL_RenderSetVSync => [:pointer, :int],
314
- }
315
- retvals = {
316
- :SDL_GetNumRenderDrivers => :int,
317
- :SDL_GetRenderDriverInfo => :int,
318
- :SDL_CreateWindowAndRenderer => :int,
319
- :SDL_CreateRenderer => :pointer,
320
- :SDL_CreateSoftwareRenderer => :pointer,
321
- :SDL_GetRenderer => :pointer,
322
- :SDL_RenderGetWindow => :pointer,
323
- :SDL_GetRendererInfo => :int,
324
- :SDL_GetRendererOutputSize => :int,
325
- :SDL_CreateTexture => :pointer,
326
- :SDL_CreateTextureFromSurface => :pointer,
327
- :SDL_QueryTexture => :int,
328
- :SDL_SetTextureColorMod => :int,
329
- :SDL_GetTextureColorMod => :int,
330
- :SDL_SetTextureAlphaMod => :int,
331
- :SDL_GetTextureAlphaMod => :int,
332
- :SDL_SetTextureBlendMode => :int,
333
- :SDL_GetTextureBlendMode => :int,
334
- :SDL_SetTextureScaleMode => :int,
335
- :SDL_GetTextureScaleMode => :int,
336
- :SDL_SetTextureUserData => :int,
337
- :SDL_GetTextureUserData => :pointer,
338
- :SDL_UpdateTexture => :int,
339
- :SDL_UpdateYUVTexture => :int,
340
- :SDL_UpdateNVTexture => :int,
341
- :SDL_LockTexture => :int,
342
- :SDL_LockTextureToSurface => :int,
343
- :SDL_UnlockTexture => :void,
344
- :SDL_RenderTargetSupported => :int,
345
- :SDL_SetRenderTarget => :int,
346
- :SDL_GetRenderTarget => :pointer,
347
- :SDL_RenderSetLogicalSize => :int,
348
- :SDL_RenderGetLogicalSize => :void,
349
- :SDL_RenderSetIntegerScale => :int,
350
- :SDL_RenderGetIntegerScale => :int,
351
- :SDL_RenderSetViewport => :int,
352
- :SDL_RenderGetViewport => :void,
353
- :SDL_RenderSetClipRect => :int,
354
- :SDL_RenderGetClipRect => :void,
355
- :SDL_RenderIsClipEnabled => :int,
356
- :SDL_RenderSetScale => :int,
357
- :SDL_RenderGetScale => :void,
358
- :SDL_RenderWindowToLogical => :void,
359
- :SDL_RenderLogicalToWindow => :void,
360
- :SDL_SetRenderDrawColor => :int,
361
- :SDL_GetRenderDrawColor => :int,
362
- :SDL_SetRenderDrawBlendMode => :int,
363
- :SDL_GetRenderDrawBlendMode => :int,
364
- :SDL_RenderClear => :int,
365
- :SDL_RenderDrawPoint => :int,
366
- :SDL_RenderDrawPoints => :int,
367
- :SDL_RenderDrawLine => :int,
368
- :SDL_RenderDrawLines => :int,
369
- :SDL_RenderDrawRect => :int,
370
- :SDL_RenderDrawRects => :int,
371
- :SDL_RenderFillRect => :int,
372
- :SDL_RenderFillRects => :int,
373
- :SDL_RenderCopy => :int,
374
- :SDL_RenderCopyEx => :int,
375
- :SDL_RenderDrawPointF => :int,
376
- :SDL_RenderDrawPointsF => :int,
377
- :SDL_RenderDrawLineF => :int,
378
- :SDL_RenderDrawLinesF => :int,
379
- :SDL_RenderDrawRectF => :int,
380
- :SDL_RenderDrawRectsF => :int,
381
- :SDL_RenderFillRectF => :int,
382
- :SDL_RenderFillRectsF => :int,
383
- :SDL_RenderCopyF => :int,
384
- :SDL_RenderCopyExF => :int,
385
- :SDL_RenderGeometry => :int,
386
- :SDL_RenderGeometryRaw => :int,
387
- :SDL_RenderReadPixels => :int,
388
- :SDL_RenderPresent => :void,
389
- :SDL_DestroyTexture => :void,
390
- :SDL_DestroyRenderer => :void,
391
- :SDL_RenderFlush => :int,
392
- :SDL_GL_BindTexture => :int,
393
- :SDL_GL_UnbindTexture => :int,
394
- :SDL_RenderGetMetalLayer => :pointer,
395
- :SDL_RenderGetMetalCommandEncoder => :pointer,
396
- :SDL_RenderSetVSync => :int,
397
- }
398
- symbols.each do |sym|
399
- begin
400
- attach_function apis[sym], sym, args[sym], retvals[sym]
401
- rescue FFI::NotFoundError => error
402
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
403
- end
404
- end
405
- end
406
-
407
- end
408
-
1
+ # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/sdl2-bindings
4
+ #
5
+ # [NOTICE] This is an automatically generated file.
6
+
7
+ require 'ffi'
8
+
9
+ module SDL
10
+ extend FFI::Library
11
+ # Define/Macro
12
+
13
+
14
+ # Enum
15
+
16
+ RENDERER_SOFTWARE = 1
17
+ RENDERER_ACCELERATED = 2
18
+ RENDERER_PRESENTVSYNC = 4
19
+ RENDERER_TARGETTEXTURE = 8
20
+ ScaleModeNearest = 0
21
+ ScaleModeLinear = 1
22
+ ScaleModeBest = 2
23
+ TEXTUREACCESS_STATIC = 0
24
+ TEXTUREACCESS_STREAMING = 1
25
+ TEXTUREACCESS_TARGET = 2
26
+ TEXTUREMODULATE_NONE = 0
27
+ TEXTUREMODULATE_COLOR = 1
28
+ TEXTUREMODULATE_ALPHA = 2
29
+ FLIP_NONE = 0
30
+ FLIP_HORIZONTAL = 1
31
+ FLIP_VERTICAL = 2
32
+
33
+ # Typedef
34
+
35
+ typedef :int, :SDL_RendererFlags
36
+ typedef :int, :SDL_ScaleMode
37
+ typedef :int, :SDL_TextureAccess
38
+ typedef :int, :SDL_TextureModulate
39
+ typedef :int, :SDL_RendererFlip
40
+
41
+ # Struct
42
+
43
+ class RendererInfo < FFI::Struct
44
+ layout(
45
+ :name, :pointer,
46
+ :flags, :uint,
47
+ :num_texture_formats, :uint,
48
+ :texture_formats, [:uint, 16],
49
+ :max_texture_width, :int,
50
+ :max_texture_height, :int,
51
+ )
52
+ end
53
+
54
+ class Vertex < FFI::Struct
55
+ layout(
56
+ :position, FPoint,
57
+ :color, Color,
58
+ :tex_coord, FPoint,
59
+ )
60
+ end
61
+
62
+
63
+ # Function
64
+
65
+ def self.setup_render_symbols(output_error = false)
66
+ symbols = [
67
+ :SDL_GetNumRenderDrivers,
68
+ :SDL_GetRenderDriverInfo,
69
+ :SDL_CreateWindowAndRenderer,
70
+ :SDL_CreateRenderer,
71
+ :SDL_CreateSoftwareRenderer,
72
+ :SDL_GetRenderer,
73
+ :SDL_RenderGetWindow,
74
+ :SDL_GetRendererInfo,
75
+ :SDL_GetRendererOutputSize,
76
+ :SDL_CreateTexture,
77
+ :SDL_CreateTextureFromSurface,
78
+ :SDL_QueryTexture,
79
+ :SDL_SetTextureColorMod,
80
+ :SDL_GetTextureColorMod,
81
+ :SDL_SetTextureAlphaMod,
82
+ :SDL_GetTextureAlphaMod,
83
+ :SDL_SetTextureBlendMode,
84
+ :SDL_GetTextureBlendMode,
85
+ :SDL_SetTextureScaleMode,
86
+ :SDL_GetTextureScaleMode,
87
+ :SDL_SetTextureUserData,
88
+ :SDL_GetTextureUserData,
89
+ :SDL_UpdateTexture,
90
+ :SDL_UpdateYUVTexture,
91
+ :SDL_UpdateNVTexture,
92
+ :SDL_LockTexture,
93
+ :SDL_LockTextureToSurface,
94
+ :SDL_UnlockTexture,
95
+ :SDL_RenderTargetSupported,
96
+ :SDL_SetRenderTarget,
97
+ :SDL_GetRenderTarget,
98
+ :SDL_RenderSetLogicalSize,
99
+ :SDL_RenderGetLogicalSize,
100
+ :SDL_RenderSetIntegerScale,
101
+ :SDL_RenderGetIntegerScale,
102
+ :SDL_RenderSetViewport,
103
+ :SDL_RenderGetViewport,
104
+ :SDL_RenderSetClipRect,
105
+ :SDL_RenderGetClipRect,
106
+ :SDL_RenderIsClipEnabled,
107
+ :SDL_RenderSetScale,
108
+ :SDL_RenderGetScale,
109
+ :SDL_RenderWindowToLogical,
110
+ :SDL_RenderLogicalToWindow,
111
+ :SDL_SetRenderDrawColor,
112
+ :SDL_GetRenderDrawColor,
113
+ :SDL_SetRenderDrawBlendMode,
114
+ :SDL_GetRenderDrawBlendMode,
115
+ :SDL_RenderClear,
116
+ :SDL_RenderDrawPoint,
117
+ :SDL_RenderDrawPoints,
118
+ :SDL_RenderDrawLine,
119
+ :SDL_RenderDrawLines,
120
+ :SDL_RenderDrawRect,
121
+ :SDL_RenderDrawRects,
122
+ :SDL_RenderFillRect,
123
+ :SDL_RenderFillRects,
124
+ :SDL_RenderCopy,
125
+ :SDL_RenderCopyEx,
126
+ :SDL_RenderDrawPointF,
127
+ :SDL_RenderDrawPointsF,
128
+ :SDL_RenderDrawLineF,
129
+ :SDL_RenderDrawLinesF,
130
+ :SDL_RenderDrawRectF,
131
+ :SDL_RenderDrawRectsF,
132
+ :SDL_RenderFillRectF,
133
+ :SDL_RenderFillRectsF,
134
+ :SDL_RenderCopyF,
135
+ :SDL_RenderCopyExF,
136
+ :SDL_RenderGeometry,
137
+ :SDL_RenderGeometryRaw,
138
+ :SDL_RenderReadPixels,
139
+ :SDL_RenderPresent,
140
+ :SDL_DestroyTexture,
141
+ :SDL_DestroyRenderer,
142
+ :SDL_RenderFlush,
143
+ :SDL_GL_BindTexture,
144
+ :SDL_GL_UnbindTexture,
145
+ :SDL_RenderGetMetalLayer,
146
+ :SDL_RenderGetMetalCommandEncoder,
147
+ :SDL_RenderSetVSync,
148
+ ]
149
+ apis = {
150
+ :SDL_GetNumRenderDrivers => :GetNumRenderDrivers,
151
+ :SDL_GetRenderDriverInfo => :GetRenderDriverInfo,
152
+ :SDL_CreateWindowAndRenderer => :CreateWindowAndRenderer,
153
+ :SDL_CreateRenderer => :CreateRenderer,
154
+ :SDL_CreateSoftwareRenderer => :CreateSoftwareRenderer,
155
+ :SDL_GetRenderer => :GetRenderer,
156
+ :SDL_RenderGetWindow => :RenderGetWindow,
157
+ :SDL_GetRendererInfo => :GetRendererInfo,
158
+ :SDL_GetRendererOutputSize => :GetRendererOutputSize,
159
+ :SDL_CreateTexture => :CreateTexture,
160
+ :SDL_CreateTextureFromSurface => :CreateTextureFromSurface,
161
+ :SDL_QueryTexture => :QueryTexture,
162
+ :SDL_SetTextureColorMod => :SetTextureColorMod,
163
+ :SDL_GetTextureColorMod => :GetTextureColorMod,
164
+ :SDL_SetTextureAlphaMod => :SetTextureAlphaMod,
165
+ :SDL_GetTextureAlphaMod => :GetTextureAlphaMod,
166
+ :SDL_SetTextureBlendMode => :SetTextureBlendMode,
167
+ :SDL_GetTextureBlendMode => :GetTextureBlendMode,
168
+ :SDL_SetTextureScaleMode => :SetTextureScaleMode,
169
+ :SDL_GetTextureScaleMode => :GetTextureScaleMode,
170
+ :SDL_SetTextureUserData => :SetTextureUserData,
171
+ :SDL_GetTextureUserData => :GetTextureUserData,
172
+ :SDL_UpdateTexture => :UpdateTexture,
173
+ :SDL_UpdateYUVTexture => :UpdateYUVTexture,
174
+ :SDL_UpdateNVTexture => :UpdateNVTexture,
175
+ :SDL_LockTexture => :LockTexture,
176
+ :SDL_LockTextureToSurface => :LockTextureToSurface,
177
+ :SDL_UnlockTexture => :UnlockTexture,
178
+ :SDL_RenderTargetSupported => :RenderTargetSupported,
179
+ :SDL_SetRenderTarget => :SetRenderTarget,
180
+ :SDL_GetRenderTarget => :GetRenderTarget,
181
+ :SDL_RenderSetLogicalSize => :RenderSetLogicalSize,
182
+ :SDL_RenderGetLogicalSize => :RenderGetLogicalSize,
183
+ :SDL_RenderSetIntegerScale => :RenderSetIntegerScale,
184
+ :SDL_RenderGetIntegerScale => :RenderGetIntegerScale,
185
+ :SDL_RenderSetViewport => :RenderSetViewport,
186
+ :SDL_RenderGetViewport => :RenderGetViewport,
187
+ :SDL_RenderSetClipRect => :RenderSetClipRect,
188
+ :SDL_RenderGetClipRect => :RenderGetClipRect,
189
+ :SDL_RenderIsClipEnabled => :RenderIsClipEnabled,
190
+ :SDL_RenderSetScale => :RenderSetScale,
191
+ :SDL_RenderGetScale => :RenderGetScale,
192
+ :SDL_RenderWindowToLogical => :RenderWindowToLogical,
193
+ :SDL_RenderLogicalToWindow => :RenderLogicalToWindow,
194
+ :SDL_SetRenderDrawColor => :SetRenderDrawColor,
195
+ :SDL_GetRenderDrawColor => :GetRenderDrawColor,
196
+ :SDL_SetRenderDrawBlendMode => :SetRenderDrawBlendMode,
197
+ :SDL_GetRenderDrawBlendMode => :GetRenderDrawBlendMode,
198
+ :SDL_RenderClear => :RenderClear,
199
+ :SDL_RenderDrawPoint => :RenderDrawPoint,
200
+ :SDL_RenderDrawPoints => :RenderDrawPoints,
201
+ :SDL_RenderDrawLine => :RenderDrawLine,
202
+ :SDL_RenderDrawLines => :RenderDrawLines,
203
+ :SDL_RenderDrawRect => :RenderDrawRect,
204
+ :SDL_RenderDrawRects => :RenderDrawRects,
205
+ :SDL_RenderFillRect => :RenderFillRect,
206
+ :SDL_RenderFillRects => :RenderFillRects,
207
+ :SDL_RenderCopy => :RenderCopy,
208
+ :SDL_RenderCopyEx => :RenderCopyEx,
209
+ :SDL_RenderDrawPointF => :RenderDrawPointF,
210
+ :SDL_RenderDrawPointsF => :RenderDrawPointsF,
211
+ :SDL_RenderDrawLineF => :RenderDrawLineF,
212
+ :SDL_RenderDrawLinesF => :RenderDrawLinesF,
213
+ :SDL_RenderDrawRectF => :RenderDrawRectF,
214
+ :SDL_RenderDrawRectsF => :RenderDrawRectsF,
215
+ :SDL_RenderFillRectF => :RenderFillRectF,
216
+ :SDL_RenderFillRectsF => :RenderFillRectsF,
217
+ :SDL_RenderCopyF => :RenderCopyF,
218
+ :SDL_RenderCopyExF => :RenderCopyExF,
219
+ :SDL_RenderGeometry => :RenderGeometry,
220
+ :SDL_RenderGeometryRaw => :RenderGeometryRaw,
221
+ :SDL_RenderReadPixels => :RenderReadPixels,
222
+ :SDL_RenderPresent => :RenderPresent,
223
+ :SDL_DestroyTexture => :DestroyTexture,
224
+ :SDL_DestroyRenderer => :DestroyRenderer,
225
+ :SDL_RenderFlush => :RenderFlush,
226
+ :SDL_GL_BindTexture => :GL_BindTexture,
227
+ :SDL_GL_UnbindTexture => :GL_UnbindTexture,
228
+ :SDL_RenderGetMetalLayer => :RenderGetMetalLayer,
229
+ :SDL_RenderGetMetalCommandEncoder => :RenderGetMetalCommandEncoder,
230
+ :SDL_RenderSetVSync => :RenderSetVSync,
231
+ }
232
+ args = {
233
+ :SDL_GetNumRenderDrivers => [],
234
+ :SDL_GetRenderDriverInfo => [:int, :pointer],
235
+ :SDL_CreateWindowAndRenderer => [:int, :int, :uint, :pointer, :pointer],
236
+ :SDL_CreateRenderer => [:pointer, :int, :uint],
237
+ :SDL_CreateSoftwareRenderer => [:pointer],
238
+ :SDL_GetRenderer => [:pointer],
239
+ :SDL_RenderGetWindow => [:pointer],
240
+ :SDL_GetRendererInfo => [:pointer, :pointer],
241
+ :SDL_GetRendererOutputSize => [:pointer, :pointer, :pointer],
242
+ :SDL_CreateTexture => [:pointer, :uint, :int, :int, :int],
243
+ :SDL_CreateTextureFromSurface => [:pointer, :pointer],
244
+ :SDL_QueryTexture => [:pointer, :pointer, :pointer, :pointer, :pointer],
245
+ :SDL_SetTextureColorMod => [:pointer, :uchar, :uchar, :uchar],
246
+ :SDL_GetTextureColorMod => [:pointer, :pointer, :pointer, :pointer],
247
+ :SDL_SetTextureAlphaMod => [:pointer, :uchar],
248
+ :SDL_GetTextureAlphaMod => [:pointer, :pointer],
249
+ :SDL_SetTextureBlendMode => [:pointer, :int],
250
+ :SDL_GetTextureBlendMode => [:pointer, :pointer],
251
+ :SDL_SetTextureScaleMode => [:pointer, :int],
252
+ :SDL_GetTextureScaleMode => [:pointer, :pointer],
253
+ :SDL_SetTextureUserData => [:pointer, :pointer],
254
+ :SDL_GetTextureUserData => [:pointer],
255
+ :SDL_UpdateTexture => [:pointer, :pointer, :pointer, :int],
256
+ :SDL_UpdateYUVTexture => [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int],
257
+ :SDL_UpdateNVTexture => [:pointer, :pointer, :pointer, :int, :pointer, :int],
258
+ :SDL_LockTexture => [:pointer, :pointer, :pointer, :pointer],
259
+ :SDL_LockTextureToSurface => [:pointer, :pointer, :pointer],
260
+ :SDL_UnlockTexture => [:pointer],
261
+ :SDL_RenderTargetSupported => [:pointer],
262
+ :SDL_SetRenderTarget => [:pointer, :pointer],
263
+ :SDL_GetRenderTarget => [:pointer],
264
+ :SDL_RenderSetLogicalSize => [:pointer, :int, :int],
265
+ :SDL_RenderGetLogicalSize => [:pointer, :pointer, :pointer],
266
+ :SDL_RenderSetIntegerScale => [:pointer, :int],
267
+ :SDL_RenderGetIntegerScale => [:pointer],
268
+ :SDL_RenderSetViewport => [:pointer, :pointer],
269
+ :SDL_RenderGetViewport => [:pointer, :pointer],
270
+ :SDL_RenderSetClipRect => [:pointer, :pointer],
271
+ :SDL_RenderGetClipRect => [:pointer, :pointer],
272
+ :SDL_RenderIsClipEnabled => [:pointer],
273
+ :SDL_RenderSetScale => [:pointer, :float, :float],
274
+ :SDL_RenderGetScale => [:pointer, :pointer, :pointer],
275
+ :SDL_RenderWindowToLogical => [:pointer, :int, :int, :pointer, :pointer],
276
+ :SDL_RenderLogicalToWindow => [:pointer, :float, :float, :pointer, :pointer],
277
+ :SDL_SetRenderDrawColor => [:pointer, :uchar, :uchar, :uchar, :uchar],
278
+ :SDL_GetRenderDrawColor => [:pointer, :pointer, :pointer, :pointer, :pointer],
279
+ :SDL_SetRenderDrawBlendMode => [:pointer, :int],
280
+ :SDL_GetRenderDrawBlendMode => [:pointer, :pointer],
281
+ :SDL_RenderClear => [:pointer],
282
+ :SDL_RenderDrawPoint => [:pointer, :int, :int],
283
+ :SDL_RenderDrawPoints => [:pointer, :pointer, :int],
284
+ :SDL_RenderDrawLine => [:pointer, :int, :int, :int, :int],
285
+ :SDL_RenderDrawLines => [:pointer, :pointer, :int],
286
+ :SDL_RenderDrawRect => [:pointer, :pointer],
287
+ :SDL_RenderDrawRects => [:pointer, :pointer, :int],
288
+ :SDL_RenderFillRect => [:pointer, :pointer],
289
+ :SDL_RenderFillRects => [:pointer, :pointer, :int],
290
+ :SDL_RenderCopy => [:pointer, :pointer, :pointer, :pointer],
291
+ :SDL_RenderCopyEx => [:pointer, :pointer, :pointer, :pointer, :double, :pointer, :int],
292
+ :SDL_RenderDrawPointF => [:pointer, :float, :float],
293
+ :SDL_RenderDrawPointsF => [:pointer, :pointer, :int],
294
+ :SDL_RenderDrawLineF => [:pointer, :float, :float, :float, :float],
295
+ :SDL_RenderDrawLinesF => [:pointer, :pointer, :int],
296
+ :SDL_RenderDrawRectF => [:pointer, :pointer],
297
+ :SDL_RenderDrawRectsF => [:pointer, :pointer, :int],
298
+ :SDL_RenderFillRectF => [:pointer, :pointer],
299
+ :SDL_RenderFillRectsF => [:pointer, :pointer, :int],
300
+ :SDL_RenderCopyF => [:pointer, :pointer, :pointer, :pointer],
301
+ :SDL_RenderCopyExF => [:pointer, :pointer, :pointer, :pointer, :double, :pointer, :int],
302
+ :SDL_RenderGeometry => [:pointer, :pointer, :pointer, :int, :pointer, :int],
303
+ :SDL_RenderGeometryRaw => [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int, :int, :pointer, :int, :int],
304
+ :SDL_RenderReadPixels => [:pointer, :pointer, :uint, :pointer, :int],
305
+ :SDL_RenderPresent => [:pointer],
306
+ :SDL_DestroyTexture => [:pointer],
307
+ :SDL_DestroyRenderer => [:pointer],
308
+ :SDL_RenderFlush => [:pointer],
309
+ :SDL_GL_BindTexture => [:pointer, :pointer, :pointer],
310
+ :SDL_GL_UnbindTexture => [:pointer],
311
+ :SDL_RenderGetMetalLayer => [:pointer],
312
+ :SDL_RenderGetMetalCommandEncoder => [:pointer],
313
+ :SDL_RenderSetVSync => [:pointer, :int],
314
+ }
315
+ retvals = {
316
+ :SDL_GetNumRenderDrivers => :int,
317
+ :SDL_GetRenderDriverInfo => :int,
318
+ :SDL_CreateWindowAndRenderer => :int,
319
+ :SDL_CreateRenderer => :pointer,
320
+ :SDL_CreateSoftwareRenderer => :pointer,
321
+ :SDL_GetRenderer => :pointer,
322
+ :SDL_RenderGetWindow => :pointer,
323
+ :SDL_GetRendererInfo => :int,
324
+ :SDL_GetRendererOutputSize => :int,
325
+ :SDL_CreateTexture => :pointer,
326
+ :SDL_CreateTextureFromSurface => :pointer,
327
+ :SDL_QueryTexture => :int,
328
+ :SDL_SetTextureColorMod => :int,
329
+ :SDL_GetTextureColorMod => :int,
330
+ :SDL_SetTextureAlphaMod => :int,
331
+ :SDL_GetTextureAlphaMod => :int,
332
+ :SDL_SetTextureBlendMode => :int,
333
+ :SDL_GetTextureBlendMode => :int,
334
+ :SDL_SetTextureScaleMode => :int,
335
+ :SDL_GetTextureScaleMode => :int,
336
+ :SDL_SetTextureUserData => :int,
337
+ :SDL_GetTextureUserData => :pointer,
338
+ :SDL_UpdateTexture => :int,
339
+ :SDL_UpdateYUVTexture => :int,
340
+ :SDL_UpdateNVTexture => :int,
341
+ :SDL_LockTexture => :int,
342
+ :SDL_LockTextureToSurface => :int,
343
+ :SDL_UnlockTexture => :void,
344
+ :SDL_RenderTargetSupported => :int,
345
+ :SDL_SetRenderTarget => :int,
346
+ :SDL_GetRenderTarget => :pointer,
347
+ :SDL_RenderSetLogicalSize => :int,
348
+ :SDL_RenderGetLogicalSize => :void,
349
+ :SDL_RenderSetIntegerScale => :int,
350
+ :SDL_RenderGetIntegerScale => :int,
351
+ :SDL_RenderSetViewport => :int,
352
+ :SDL_RenderGetViewport => :void,
353
+ :SDL_RenderSetClipRect => :int,
354
+ :SDL_RenderGetClipRect => :void,
355
+ :SDL_RenderIsClipEnabled => :int,
356
+ :SDL_RenderSetScale => :int,
357
+ :SDL_RenderGetScale => :void,
358
+ :SDL_RenderWindowToLogical => :void,
359
+ :SDL_RenderLogicalToWindow => :void,
360
+ :SDL_SetRenderDrawColor => :int,
361
+ :SDL_GetRenderDrawColor => :int,
362
+ :SDL_SetRenderDrawBlendMode => :int,
363
+ :SDL_GetRenderDrawBlendMode => :int,
364
+ :SDL_RenderClear => :int,
365
+ :SDL_RenderDrawPoint => :int,
366
+ :SDL_RenderDrawPoints => :int,
367
+ :SDL_RenderDrawLine => :int,
368
+ :SDL_RenderDrawLines => :int,
369
+ :SDL_RenderDrawRect => :int,
370
+ :SDL_RenderDrawRects => :int,
371
+ :SDL_RenderFillRect => :int,
372
+ :SDL_RenderFillRects => :int,
373
+ :SDL_RenderCopy => :int,
374
+ :SDL_RenderCopyEx => :int,
375
+ :SDL_RenderDrawPointF => :int,
376
+ :SDL_RenderDrawPointsF => :int,
377
+ :SDL_RenderDrawLineF => :int,
378
+ :SDL_RenderDrawLinesF => :int,
379
+ :SDL_RenderDrawRectF => :int,
380
+ :SDL_RenderDrawRectsF => :int,
381
+ :SDL_RenderFillRectF => :int,
382
+ :SDL_RenderFillRectsF => :int,
383
+ :SDL_RenderCopyF => :int,
384
+ :SDL_RenderCopyExF => :int,
385
+ :SDL_RenderGeometry => :int,
386
+ :SDL_RenderGeometryRaw => :int,
387
+ :SDL_RenderReadPixels => :int,
388
+ :SDL_RenderPresent => :void,
389
+ :SDL_DestroyTexture => :void,
390
+ :SDL_DestroyRenderer => :void,
391
+ :SDL_RenderFlush => :int,
392
+ :SDL_GL_BindTexture => :int,
393
+ :SDL_GL_UnbindTexture => :int,
394
+ :SDL_RenderGetMetalLayer => :pointer,
395
+ :SDL_RenderGetMetalCommandEncoder => :pointer,
396
+ :SDL_RenderSetVSync => :int,
397
+ }
398
+ symbols.each do |sym|
399
+ begin
400
+ attach_function apis[sym], sym, args[sym], retvals[sym]
401
+ rescue FFI::NotFoundError => error
402
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
403
+ end
404
+ end
405
+ end
406
+
407
+ end
408
+