sdl2-bindings 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +134 -108
- data/LICENSE.txt +0 -0
- data/README.md +86 -68
- data/lib/sdl2.rb +131 -127
- data/lib/sdl2_audio.rb +261 -261
- data/lib/sdl2_blendmode.rb +72 -72
- data/lib/sdl2_clipboard.rb +56 -56
- data/lib/sdl2_cpuinfo.rb +129 -129
- data/lib/sdl2_error.rb +71 -71
- data/lib/sdl2_events.rb +564 -552
- data/lib/sdl2_filesystem.rb +52 -52
- data/lib/sdl2_framerate.rb +74 -74
- data/lib/sdl2_gamecontroller.rb +329 -329
- data/lib/sdl2_gesture.rb +61 -61
- data/lib/sdl2_gfxPrimitives.rb +283 -283
- data/lib/sdl2_haptic.rb +301 -301
- data/lib/sdl2_hidapi.rb +139 -139
- data/lib/sdl2_hints.rb +221 -207
- data/lib/sdl2_image.rb +296 -232
- data/lib/sdl2_imageFilter.rb +164 -164
- data/lib/sdl2_joystick.rb +294 -294
- data/lib/sdl2_keyboard.rb +125 -117
- data/lib/sdl2_keycode.rb +307 -307
- data/lib/sdl2_log.rb +131 -131
- data/lib/sdl2_main.rb +74 -74
- data/lib/sdl2_messagebox.rb +102 -102
- data/lib/sdl2_misc.rb +48 -48
- data/lib/sdl2_mixer.rb +464 -392
- data/lib/sdl2_mouse.rb +136 -136
- data/lib/sdl2_pixels.rb +240 -240
- data/lib/sdl2_platform.rb +48 -48
- data/lib/sdl2_power.rb +54 -54
- data/lib/sdl2_rect.rb +145 -109
- data/lib/sdl2_render.rb +408 -404
- data/lib/sdl2_rotozoom.rb +76 -76
- data/lib/sdl2_rwops.rb +242 -238
- data/lib/sdl2_scancode.rb +289 -289
- data/lib/sdl2_sensor.rb +115 -115
- data/lib/sdl2_shape.rb +83 -83
- data/lib/sdl2_sound.rb +154 -0
- data/lib/sdl2_stdinc.rb +548 -564
- data/lib/sdl2_surface.rb +229 -229
- data/lib/sdl2_syswm.rb +160 -160
- data/lib/sdl2_timer.rb +74 -74
- data/lib/sdl2_touch.rb +86 -82
- data/lib/sdl2_ttf.rb +414 -357
- data/lib/sdl2_version.rb +67 -67
- data/lib/sdl2_video.rb +540 -540
- data/lib/sdl2_vulkan.rb +72 -72
- metadata +3 -2
data/lib/sdl2_stdinc.rb
CHANGED
@@ -1,564 +1,548 @@
|
|
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
|
-
ICONV_ERROR = -1
|
14
|
-
ICONV_E2BIG = -2
|
15
|
-
ICONV_EILSEQ = -3
|
16
|
-
ICONV_EINVAL = -4
|
17
|
-
|
18
|
-
# Enum
|
19
|
-
|
20
|
-
FALSE = 0
|
21
|
-
TRUE = 1
|
22
|
-
|
23
|
-
# Typedef
|
24
|
-
|
25
|
-
typedef :
|
26
|
-
typedef :
|
27
|
-
typedef :
|
28
|
-
typedef :
|
29
|
-
typedef :
|
30
|
-
typedef :
|
31
|
-
typedef :uint, :
|
32
|
-
typedef :
|
33
|
-
typedef :
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
typedef :
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
79
|
-
:
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
88
|
-
:
|
89
|
-
:
|
90
|
-
:
|
91
|
-
:
|
92
|
-
:
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
103
|
-
:
|
104
|
-
:
|
105
|
-
:
|
106
|
-
:
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
110
|
-
:
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
122
|
-
:
|
123
|
-
:
|
124
|
-
:
|
125
|
-
:
|
126
|
-
:
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
:
|
135
|
-
:
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
:
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:
|
150
|
-
:
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
:
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
159
|
-
:
|
160
|
-
:
|
161
|
-
:
|
162
|
-
:
|
163
|
-
:
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
:
|
168
|
-
|
169
|
-
|
170
|
-
:
|
171
|
-
:
|
172
|
-
:
|
173
|
-
:
|
174
|
-
:
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
|
179
|
-
|
180
|
-
:
|
181
|
-
:
|
182
|
-
:
|
183
|
-
:
|
184
|
-
:
|
185
|
-
:
|
186
|
-
:
|
187
|
-
:
|
188
|
-
:
|
189
|
-
:
|
190
|
-
:
|
191
|
-
:
|
192
|
-
:
|
193
|
-
:
|
194
|
-
:
|
195
|
-
:
|
196
|
-
:
|
197
|
-
:
|
198
|
-
:
|
199
|
-
:
|
200
|
-
:
|
201
|
-
:
|
202
|
-
:
|
203
|
-
:
|
204
|
-
:
|
205
|
-
:
|
206
|
-
:
|
207
|
-
:
|
208
|
-
:
|
209
|
-
:
|
210
|
-
:
|
211
|
-
:
|
212
|
-
:
|
213
|
-
:
|
214
|
-
:
|
215
|
-
:
|
216
|
-
:
|
217
|
-
:
|
218
|
-
:
|
219
|
-
:
|
220
|
-
:
|
221
|
-
:
|
222
|
-
:
|
223
|
-
:
|
224
|
-
:
|
225
|
-
:
|
226
|
-
:
|
227
|
-
:
|
228
|
-
:
|
229
|
-
:
|
230
|
-
:
|
231
|
-
:
|
232
|
-
:
|
233
|
-
:
|
234
|
-
:
|
235
|
-
:
|
236
|
-
:
|
237
|
-
:
|
238
|
-
:
|
239
|
-
:
|
240
|
-
:
|
241
|
-
:
|
242
|
-
:
|
243
|
-
:
|
244
|
-
:
|
245
|
-
:
|
246
|
-
:
|
247
|
-
:
|
248
|
-
:
|
249
|
-
:
|
250
|
-
:
|
251
|
-
:
|
252
|
-
:
|
253
|
-
:
|
254
|
-
:
|
255
|
-
:
|
256
|
-
:
|
257
|
-
:
|
258
|
-
:
|
259
|
-
:
|
260
|
-
:
|
261
|
-
:
|
262
|
-
:
|
263
|
-
:
|
264
|
-
:
|
265
|
-
:
|
266
|
-
:
|
267
|
-
:
|
268
|
-
:
|
269
|
-
:
|
270
|
-
:
|
271
|
-
:
|
272
|
-
:
|
273
|
-
:
|
274
|
-
:
|
275
|
-
:
|
276
|
-
:
|
277
|
-
:
|
278
|
-
:
|
279
|
-
:
|
280
|
-
:
|
281
|
-
:
|
282
|
-
:
|
283
|
-
:
|
284
|
-
:
|
285
|
-
:
|
286
|
-
:
|
287
|
-
:
|
288
|
-
:
|
289
|
-
:
|
290
|
-
:
|
291
|
-
|
292
|
-
|
293
|
-
:
|
294
|
-
:
|
295
|
-
:
|
296
|
-
:
|
297
|
-
:
|
298
|
-
:
|
299
|
-
:
|
300
|
-
:
|
301
|
-
:
|
302
|
-
:
|
303
|
-
|
304
|
-
|
305
|
-
:
|
306
|
-
:
|
307
|
-
:
|
308
|
-
:
|
309
|
-
:
|
310
|
-
:
|
311
|
-
:
|
312
|
-
:
|
313
|
-
:
|
314
|
-
:
|
315
|
-
:
|
316
|
-
:
|
317
|
-
:
|
318
|
-
:
|
319
|
-
:
|
320
|
-
:
|
321
|
-
:
|
322
|
-
:
|
323
|
-
:
|
324
|
-
:
|
325
|
-
:
|
326
|
-
:
|
327
|
-
:
|
328
|
-
:
|
329
|
-
:
|
330
|
-
:
|
331
|
-
:
|
332
|
-
:
|
333
|
-
:
|
334
|
-
:
|
335
|
-
:
|
336
|
-
:
|
337
|
-
:
|
338
|
-
:
|
339
|
-
:
|
340
|
-
:
|
341
|
-
:
|
342
|
-
:
|
343
|
-
:
|
344
|
-
:
|
345
|
-
:
|
346
|
-
:
|
347
|
-
:
|
348
|
-
:
|
349
|
-
:
|
350
|
-
:
|
351
|
-
:
|
352
|
-
:
|
353
|
-
:
|
354
|
-
:
|
355
|
-
:
|
356
|
-
:
|
357
|
-
:
|
358
|
-
:
|
359
|
-
:
|
360
|
-
:
|
361
|
-
:
|
362
|
-
:
|
363
|
-
:
|
364
|
-
:
|
365
|
-
:
|
366
|
-
:
|
367
|
-
:
|
368
|
-
:
|
369
|
-
:
|
370
|
-
:
|
371
|
-
:
|
372
|
-
:
|
373
|
-
:
|
374
|
-
:
|
375
|
-
:
|
376
|
-
:
|
377
|
-
:
|
378
|
-
:
|
379
|
-
:
|
380
|
-
:
|
381
|
-
:
|
382
|
-
:
|
383
|
-
:
|
384
|
-
:
|
385
|
-
:
|
386
|
-
:
|
387
|
-
:
|
388
|
-
:
|
389
|
-
:
|
390
|
-
:
|
391
|
-
:
|
392
|
-
:
|
393
|
-
:
|
394
|
-
:
|
395
|
-
:
|
396
|
-
:
|
397
|
-
:
|
398
|
-
:
|
399
|
-
:
|
400
|
-
:
|
401
|
-
:
|
402
|
-
:
|
403
|
-
:
|
404
|
-
:
|
405
|
-
:
|
406
|
-
:
|
407
|
-
:
|
408
|
-
:
|
409
|
-
:
|
410
|
-
:
|
411
|
-
:
|
412
|
-
:
|
413
|
-
:
|
414
|
-
|
415
|
-
|
416
|
-
:
|
417
|
-
:
|
418
|
-
:
|
419
|
-
:
|
420
|
-
:
|
421
|
-
:
|
422
|
-
:
|
423
|
-
:
|
424
|
-
:
|
425
|
-
:
|
426
|
-
:
|
427
|
-
:
|
428
|
-
|
429
|
-
|
430
|
-
:
|
431
|
-
:
|
432
|
-
:
|
433
|
-
:
|
434
|
-
:
|
435
|
-
:
|
436
|
-
:
|
437
|
-
:
|
438
|
-
:
|
439
|
-
:
|
440
|
-
:
|
441
|
-
:
|
442
|
-
:
|
443
|
-
:
|
444
|
-
:
|
445
|
-
:
|
446
|
-
:
|
447
|
-
:
|
448
|
-
:
|
449
|
-
:
|
450
|
-
:
|
451
|
-
:
|
452
|
-
:
|
453
|
-
:
|
454
|
-
:
|
455
|
-
:
|
456
|
-
:
|
457
|
-
:
|
458
|
-
:
|
459
|
-
:
|
460
|
-
:
|
461
|
-
:
|
462
|
-
:
|
463
|
-
:
|
464
|
-
:
|
465
|
-
:
|
466
|
-
:
|
467
|
-
:
|
468
|
-
:
|
469
|
-
:
|
470
|
-
:
|
471
|
-
:
|
472
|
-
:
|
473
|
-
:
|
474
|
-
:
|
475
|
-
:
|
476
|
-
:
|
477
|
-
:
|
478
|
-
:
|
479
|
-
:
|
480
|
-
:
|
481
|
-
:
|
482
|
-
:
|
483
|
-
:
|
484
|
-
:
|
485
|
-
:
|
486
|
-
:
|
487
|
-
:
|
488
|
-
:
|
489
|
-
:
|
490
|
-
:
|
491
|
-
:
|
492
|
-
:
|
493
|
-
:
|
494
|
-
:
|
495
|
-
:
|
496
|
-
:
|
497
|
-
:
|
498
|
-
:
|
499
|
-
:
|
500
|
-
:
|
501
|
-
:
|
502
|
-
:
|
503
|
-
:
|
504
|
-
:
|
505
|
-
:
|
506
|
-
:
|
507
|
-
:
|
508
|
-
:
|
509
|
-
:
|
510
|
-
:
|
511
|
-
:
|
512
|
-
:
|
513
|
-
:
|
514
|
-
:
|
515
|
-
:
|
516
|
-
:
|
517
|
-
:
|
518
|
-
:
|
519
|
-
:
|
520
|
-
:
|
521
|
-
:
|
522
|
-
:
|
523
|
-
:
|
524
|
-
:
|
525
|
-
:
|
526
|
-
:
|
527
|
-
:
|
528
|
-
:
|
529
|
-
:
|
530
|
-
:
|
531
|
-
:
|
532
|
-
:
|
533
|
-
:
|
534
|
-
:
|
535
|
-
:
|
536
|
-
:
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
:SDL_iconv_close => :int,
|
550
|
-
:SDL_iconv => :int,
|
551
|
-
:SDL_iconv_string => :pointer,
|
552
|
-
:SDL_memcpy4 => :pointer,
|
553
|
-
}
|
554
|
-
symbols.each do |sym|
|
555
|
-
begin
|
556
|
-
attach_function apis[sym], sym, args[sym], retvals[sym]
|
557
|
-
rescue FFI::NotFoundError => error
|
558
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
559
|
-
end
|
560
|
-
end
|
561
|
-
end
|
562
|
-
|
563
|
-
end
|
564
|
-
|
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
|
+
ICONV_ERROR = -1
|
14
|
+
ICONV_E2BIG = -2
|
15
|
+
ICONV_EILSEQ = -3
|
16
|
+
ICONV_EINVAL = -4
|
17
|
+
|
18
|
+
# Enum
|
19
|
+
|
20
|
+
FALSE = 0
|
21
|
+
TRUE = 1
|
22
|
+
|
23
|
+
# Typedef
|
24
|
+
|
25
|
+
typedef :int, :SDL_bool
|
26
|
+
typedef :char, :Sint8
|
27
|
+
typedef :uchar, :Uint8
|
28
|
+
typedef :short, :Sint16
|
29
|
+
typedef :ushort, :Uint16
|
30
|
+
typedef :int, :Sint32
|
31
|
+
typedef :uint, :Uint32
|
32
|
+
typedef :long_long, :Sint64
|
33
|
+
typedef :ulong_long, :Uint64
|
34
|
+
callback :SDL_malloc_func, [:ulong], :pointer
|
35
|
+
callback :SDL_calloc_func, [:ulong, :ulong], :pointer
|
36
|
+
callback :SDL_realloc_func, [:pointer, :ulong], :pointer
|
37
|
+
callback :SDL_free_func, [:pointer], :void
|
38
|
+
typedef :pointer, :SDL_iconv_t
|
39
|
+
|
40
|
+
# Struct
|
41
|
+
|
42
|
+
|
43
|
+
# Function
|
44
|
+
|
45
|
+
def self.setup_stdinc_symbols(output_error = false)
|
46
|
+
symbols = [
|
47
|
+
:SDL_malloc,
|
48
|
+
:SDL_calloc,
|
49
|
+
:SDL_realloc,
|
50
|
+
:SDL_free,
|
51
|
+
:SDL_GetMemoryFunctions,
|
52
|
+
:SDL_SetMemoryFunctions,
|
53
|
+
:SDL_GetNumAllocations,
|
54
|
+
:SDL_getenv,
|
55
|
+
:SDL_setenv,
|
56
|
+
:SDL_qsort,
|
57
|
+
:SDL_abs,
|
58
|
+
:SDL_isalpha,
|
59
|
+
:SDL_isalnum,
|
60
|
+
:SDL_isblank,
|
61
|
+
:SDL_iscntrl,
|
62
|
+
:SDL_isdigit,
|
63
|
+
:SDL_isxdigit,
|
64
|
+
:SDL_ispunct,
|
65
|
+
:SDL_isspace,
|
66
|
+
:SDL_isupper,
|
67
|
+
:SDL_islower,
|
68
|
+
:SDL_isprint,
|
69
|
+
:SDL_isgraph,
|
70
|
+
:SDL_toupper,
|
71
|
+
:SDL_tolower,
|
72
|
+
:SDL_crc32,
|
73
|
+
:SDL_memset,
|
74
|
+
:SDL_memcpy,
|
75
|
+
:SDL_memmove,
|
76
|
+
:SDL_memcmp,
|
77
|
+
:SDL_wcslen,
|
78
|
+
:SDL_wcslcpy,
|
79
|
+
:SDL_wcslcat,
|
80
|
+
:SDL_wcsdup,
|
81
|
+
:SDL_wcsstr,
|
82
|
+
:SDL_wcscmp,
|
83
|
+
:SDL_wcsncmp,
|
84
|
+
:SDL_wcscasecmp,
|
85
|
+
:SDL_wcsncasecmp,
|
86
|
+
:SDL_strlen,
|
87
|
+
:SDL_strlcpy,
|
88
|
+
:SDL_utf8strlcpy,
|
89
|
+
:SDL_strlcat,
|
90
|
+
:SDL_strdup,
|
91
|
+
:SDL_strrev,
|
92
|
+
:SDL_strupr,
|
93
|
+
:SDL_strlwr,
|
94
|
+
:SDL_strchr,
|
95
|
+
:SDL_strrchr,
|
96
|
+
:SDL_strstr,
|
97
|
+
:SDL_strtokr,
|
98
|
+
:SDL_utf8strlen,
|
99
|
+
:SDL_itoa,
|
100
|
+
:SDL_uitoa,
|
101
|
+
:SDL_ltoa,
|
102
|
+
:SDL_ultoa,
|
103
|
+
:SDL_lltoa,
|
104
|
+
:SDL_ulltoa,
|
105
|
+
:SDL_atoi,
|
106
|
+
:SDL_atof,
|
107
|
+
:SDL_strtol,
|
108
|
+
:SDL_strtoul,
|
109
|
+
:SDL_strtoll,
|
110
|
+
:SDL_strtoull,
|
111
|
+
:SDL_strtod,
|
112
|
+
:SDL_strcmp,
|
113
|
+
:SDL_strncmp,
|
114
|
+
:SDL_strcasecmp,
|
115
|
+
:SDL_strncasecmp,
|
116
|
+
:SDL_sscanf,
|
117
|
+
:SDL_vsscanf,
|
118
|
+
:SDL_snprintf,
|
119
|
+
:SDL_vsnprintf,
|
120
|
+
:SDL_asprintf,
|
121
|
+
:SDL_vasprintf,
|
122
|
+
:SDL_acos,
|
123
|
+
:SDL_acosf,
|
124
|
+
:SDL_asin,
|
125
|
+
:SDL_asinf,
|
126
|
+
:SDL_atan,
|
127
|
+
:SDL_atanf,
|
128
|
+
:SDL_atan2,
|
129
|
+
:SDL_atan2f,
|
130
|
+
:SDL_ceil,
|
131
|
+
:SDL_ceilf,
|
132
|
+
:SDL_copysign,
|
133
|
+
:SDL_copysignf,
|
134
|
+
:SDL_cos,
|
135
|
+
:SDL_cosf,
|
136
|
+
:SDL_exp,
|
137
|
+
:SDL_expf,
|
138
|
+
:SDL_fabs,
|
139
|
+
:SDL_fabsf,
|
140
|
+
:SDL_floor,
|
141
|
+
:SDL_floorf,
|
142
|
+
:SDL_trunc,
|
143
|
+
:SDL_truncf,
|
144
|
+
:SDL_fmod,
|
145
|
+
:SDL_fmodf,
|
146
|
+
:SDL_log,
|
147
|
+
:SDL_logf,
|
148
|
+
:SDL_log10,
|
149
|
+
:SDL_log10f,
|
150
|
+
:SDL_pow,
|
151
|
+
:SDL_powf,
|
152
|
+
:SDL_round,
|
153
|
+
:SDL_roundf,
|
154
|
+
:SDL_lround,
|
155
|
+
:SDL_lroundf,
|
156
|
+
:SDL_scalbn,
|
157
|
+
:SDL_scalbnf,
|
158
|
+
:SDL_sin,
|
159
|
+
:SDL_sinf,
|
160
|
+
:SDL_sqrt,
|
161
|
+
:SDL_sqrtf,
|
162
|
+
:SDL_tan,
|
163
|
+
:SDL_tanf,
|
164
|
+
:SDL_iconv_open,
|
165
|
+
:SDL_iconv_close,
|
166
|
+
:SDL_iconv,
|
167
|
+
:SDL_iconv_string,
|
168
|
+
]
|
169
|
+
apis = {
|
170
|
+
:SDL_malloc => :malloc,
|
171
|
+
:SDL_calloc => :calloc,
|
172
|
+
:SDL_realloc => :realloc,
|
173
|
+
:SDL_free => :free,
|
174
|
+
:SDL_GetMemoryFunctions => :GetMemoryFunctions,
|
175
|
+
:SDL_SetMemoryFunctions => :SetMemoryFunctions,
|
176
|
+
:SDL_GetNumAllocations => :GetNumAllocations,
|
177
|
+
:SDL_getenv => :getenv,
|
178
|
+
:SDL_setenv => :setenv,
|
179
|
+
:SDL_qsort => :qsort,
|
180
|
+
:SDL_abs => :abs,
|
181
|
+
:SDL_isalpha => :isalpha,
|
182
|
+
:SDL_isalnum => :isalnum,
|
183
|
+
:SDL_isblank => :isblank,
|
184
|
+
:SDL_iscntrl => :iscntrl,
|
185
|
+
:SDL_isdigit => :isdigit,
|
186
|
+
:SDL_isxdigit => :isxdigit,
|
187
|
+
:SDL_ispunct => :ispunct,
|
188
|
+
:SDL_isspace => :isspace,
|
189
|
+
:SDL_isupper => :isupper,
|
190
|
+
:SDL_islower => :islower,
|
191
|
+
:SDL_isprint => :isprint,
|
192
|
+
:SDL_isgraph => :isgraph,
|
193
|
+
:SDL_toupper => :toupper,
|
194
|
+
:SDL_tolower => :tolower,
|
195
|
+
:SDL_crc32 => :crc32,
|
196
|
+
:SDL_memset => :memset,
|
197
|
+
:SDL_memcpy => :memcpy,
|
198
|
+
:SDL_memmove => :memmove,
|
199
|
+
:SDL_memcmp => :memcmp,
|
200
|
+
:SDL_wcslen => :wcslen,
|
201
|
+
:SDL_wcslcpy => :wcslcpy,
|
202
|
+
:SDL_wcslcat => :wcslcat,
|
203
|
+
:SDL_wcsdup => :wcsdup,
|
204
|
+
:SDL_wcsstr => :wcsstr,
|
205
|
+
:SDL_wcscmp => :wcscmp,
|
206
|
+
:SDL_wcsncmp => :wcsncmp,
|
207
|
+
:SDL_wcscasecmp => :wcscasecmp,
|
208
|
+
:SDL_wcsncasecmp => :wcsncasecmp,
|
209
|
+
:SDL_strlen => :strlen,
|
210
|
+
:SDL_strlcpy => :strlcpy,
|
211
|
+
:SDL_utf8strlcpy => :utf8strlcpy,
|
212
|
+
:SDL_strlcat => :strlcat,
|
213
|
+
:SDL_strdup => :strdup,
|
214
|
+
:SDL_strrev => :strrev,
|
215
|
+
:SDL_strupr => :strupr,
|
216
|
+
:SDL_strlwr => :strlwr,
|
217
|
+
:SDL_strchr => :strchr,
|
218
|
+
:SDL_strrchr => :strrchr,
|
219
|
+
:SDL_strstr => :strstr,
|
220
|
+
:SDL_strtokr => :strtokr,
|
221
|
+
:SDL_utf8strlen => :utf8strlen,
|
222
|
+
:SDL_itoa => :itoa,
|
223
|
+
:SDL_uitoa => :uitoa,
|
224
|
+
:SDL_ltoa => :ltoa,
|
225
|
+
:SDL_ultoa => :ultoa,
|
226
|
+
:SDL_lltoa => :lltoa,
|
227
|
+
:SDL_ulltoa => :ulltoa,
|
228
|
+
:SDL_atoi => :atoi,
|
229
|
+
:SDL_atof => :atof,
|
230
|
+
:SDL_strtol => :strtol,
|
231
|
+
:SDL_strtoul => :strtoul,
|
232
|
+
:SDL_strtoll => :strtoll,
|
233
|
+
:SDL_strtoull => :strtoull,
|
234
|
+
:SDL_strtod => :strtod,
|
235
|
+
:SDL_strcmp => :strcmp,
|
236
|
+
:SDL_strncmp => :strncmp,
|
237
|
+
:SDL_strcasecmp => :strcasecmp,
|
238
|
+
:SDL_strncasecmp => :strncasecmp,
|
239
|
+
:SDL_sscanf => :sscanf,
|
240
|
+
:SDL_vsscanf => :vsscanf,
|
241
|
+
:SDL_snprintf => :snprintf,
|
242
|
+
:SDL_vsnprintf => :vsnprintf,
|
243
|
+
:SDL_asprintf => :asprintf,
|
244
|
+
:SDL_vasprintf => :vasprintf,
|
245
|
+
:SDL_acos => :acos,
|
246
|
+
:SDL_acosf => :acosf,
|
247
|
+
:SDL_asin => :asin,
|
248
|
+
:SDL_asinf => :asinf,
|
249
|
+
:SDL_atan => :atan,
|
250
|
+
:SDL_atanf => :atanf,
|
251
|
+
:SDL_atan2 => :atan2,
|
252
|
+
:SDL_atan2f => :atan2f,
|
253
|
+
:SDL_ceil => :ceil,
|
254
|
+
:SDL_ceilf => :ceilf,
|
255
|
+
:SDL_copysign => :copysign,
|
256
|
+
:SDL_copysignf => :copysignf,
|
257
|
+
:SDL_cos => :cos,
|
258
|
+
:SDL_cosf => :cosf,
|
259
|
+
:SDL_exp => :exp,
|
260
|
+
:SDL_expf => :expf,
|
261
|
+
:SDL_fabs => :fabs,
|
262
|
+
:SDL_fabsf => :fabsf,
|
263
|
+
:SDL_floor => :floor,
|
264
|
+
:SDL_floorf => :floorf,
|
265
|
+
:SDL_trunc => :trunc,
|
266
|
+
:SDL_truncf => :truncf,
|
267
|
+
:SDL_fmod => :fmod,
|
268
|
+
:SDL_fmodf => :fmodf,
|
269
|
+
:SDL_log => :log,
|
270
|
+
:SDL_logf => :logf,
|
271
|
+
:SDL_log10 => :log10,
|
272
|
+
:SDL_log10f => :log10f,
|
273
|
+
:SDL_pow => :pow,
|
274
|
+
:SDL_powf => :powf,
|
275
|
+
:SDL_round => :round,
|
276
|
+
:SDL_roundf => :roundf,
|
277
|
+
:SDL_lround => :lround,
|
278
|
+
:SDL_lroundf => :lroundf,
|
279
|
+
:SDL_scalbn => :scalbn,
|
280
|
+
:SDL_scalbnf => :scalbnf,
|
281
|
+
:SDL_sin => :sin,
|
282
|
+
:SDL_sinf => :sinf,
|
283
|
+
:SDL_sqrt => :sqrt,
|
284
|
+
:SDL_sqrtf => :sqrtf,
|
285
|
+
:SDL_tan => :tan,
|
286
|
+
:SDL_tanf => :tanf,
|
287
|
+
:SDL_iconv_open => :iconv_open,
|
288
|
+
:SDL_iconv_close => :iconv_close,
|
289
|
+
:SDL_iconv => :iconv,
|
290
|
+
:SDL_iconv_string => :iconv_string,
|
291
|
+
}
|
292
|
+
args = {
|
293
|
+
:SDL_malloc => [:ulong],
|
294
|
+
:SDL_calloc => [:ulong, :ulong],
|
295
|
+
:SDL_realloc => [:pointer, :ulong],
|
296
|
+
:SDL_free => [:pointer],
|
297
|
+
:SDL_GetMemoryFunctions => [:pointer, :pointer, :pointer, :pointer],
|
298
|
+
:SDL_SetMemoryFunctions => [:SDL_malloc_func, :SDL_calloc_func, :SDL_realloc_func, :SDL_free_func],
|
299
|
+
:SDL_GetNumAllocations => [],
|
300
|
+
:SDL_getenv => [:pointer],
|
301
|
+
:SDL_setenv => [:pointer, :pointer, :int],
|
302
|
+
:SDL_qsort => [:pointer, :ulong, :ulong, :pointer],
|
303
|
+
:SDL_abs => [:int],
|
304
|
+
:SDL_isalpha => [:int],
|
305
|
+
:SDL_isalnum => [:int],
|
306
|
+
:SDL_isblank => [:int],
|
307
|
+
:SDL_iscntrl => [:int],
|
308
|
+
:SDL_isdigit => [:int],
|
309
|
+
:SDL_isxdigit => [:int],
|
310
|
+
:SDL_ispunct => [:int],
|
311
|
+
:SDL_isspace => [:int],
|
312
|
+
:SDL_isupper => [:int],
|
313
|
+
:SDL_islower => [:int],
|
314
|
+
:SDL_isprint => [:int],
|
315
|
+
:SDL_isgraph => [:int],
|
316
|
+
:SDL_toupper => [:int],
|
317
|
+
:SDL_tolower => [:int],
|
318
|
+
:SDL_crc32 => [:uint, :pointer, :ulong],
|
319
|
+
:SDL_memset => [:pointer, :int, :ulong],
|
320
|
+
:SDL_memcpy => [:pointer, :pointer, :ulong],
|
321
|
+
:SDL_memmove => [:pointer, :pointer, :ulong],
|
322
|
+
:SDL_memcmp => [:pointer, :pointer, :ulong],
|
323
|
+
:SDL_wcslen => [:pointer],
|
324
|
+
:SDL_wcslcpy => [:pointer, :pointer, :ulong],
|
325
|
+
:SDL_wcslcat => [:pointer, :pointer, :ulong],
|
326
|
+
:SDL_wcsdup => [:pointer],
|
327
|
+
:SDL_wcsstr => [:pointer, :pointer],
|
328
|
+
:SDL_wcscmp => [:pointer, :pointer],
|
329
|
+
:SDL_wcsncmp => [:pointer, :pointer, :ulong],
|
330
|
+
:SDL_wcscasecmp => [:pointer, :pointer],
|
331
|
+
:SDL_wcsncasecmp => [:pointer, :pointer, :ulong],
|
332
|
+
:SDL_strlen => [:pointer],
|
333
|
+
:SDL_strlcpy => [:pointer, :pointer, :ulong],
|
334
|
+
:SDL_utf8strlcpy => [:pointer, :pointer, :ulong],
|
335
|
+
:SDL_strlcat => [:pointer, :pointer, :ulong],
|
336
|
+
:SDL_strdup => [:pointer],
|
337
|
+
:SDL_strrev => [:pointer],
|
338
|
+
:SDL_strupr => [:pointer],
|
339
|
+
:SDL_strlwr => [:pointer],
|
340
|
+
:SDL_strchr => [:pointer, :int],
|
341
|
+
:SDL_strrchr => [:pointer, :int],
|
342
|
+
:SDL_strstr => [:pointer, :pointer],
|
343
|
+
:SDL_strtokr => [:pointer, :pointer, :pointer],
|
344
|
+
:SDL_utf8strlen => [:pointer],
|
345
|
+
:SDL_itoa => [:int, :pointer, :int],
|
346
|
+
:SDL_uitoa => [:uint, :pointer, :int],
|
347
|
+
:SDL_ltoa => [:long, :pointer, :int],
|
348
|
+
:SDL_ultoa => [:ulong, :pointer, :int],
|
349
|
+
:SDL_lltoa => [:long_long, :pointer, :int],
|
350
|
+
:SDL_ulltoa => [:ulong_long, :pointer, :int],
|
351
|
+
:SDL_atoi => [:pointer],
|
352
|
+
:SDL_atof => [:pointer],
|
353
|
+
:SDL_strtol => [:pointer, :pointer, :int],
|
354
|
+
:SDL_strtoul => [:pointer, :pointer, :int],
|
355
|
+
:SDL_strtoll => [:pointer, :pointer, :int],
|
356
|
+
:SDL_strtoull => [:pointer, :pointer, :int],
|
357
|
+
:SDL_strtod => [:pointer, :pointer],
|
358
|
+
:SDL_strcmp => [:pointer, :pointer],
|
359
|
+
:SDL_strncmp => [:pointer, :pointer, :ulong],
|
360
|
+
:SDL_strcasecmp => [:pointer, :pointer],
|
361
|
+
:SDL_strncasecmp => [:pointer, :pointer, :ulong],
|
362
|
+
:SDL_sscanf => [:pointer, :pointer],
|
363
|
+
:SDL_vsscanf => [:pointer, :pointer, :pointer],
|
364
|
+
:SDL_snprintf => [:pointer, :ulong, :pointer],
|
365
|
+
:SDL_vsnprintf => [:pointer, :ulong, :pointer, :pointer],
|
366
|
+
:SDL_asprintf => [:pointer, :pointer],
|
367
|
+
:SDL_vasprintf => [:pointer, :pointer, :pointer],
|
368
|
+
:SDL_acos => [:double],
|
369
|
+
:SDL_acosf => [:float],
|
370
|
+
:SDL_asin => [:double],
|
371
|
+
:SDL_asinf => [:float],
|
372
|
+
:SDL_atan => [:double],
|
373
|
+
:SDL_atanf => [:float],
|
374
|
+
:SDL_atan2 => [:double, :double],
|
375
|
+
:SDL_atan2f => [:float, :float],
|
376
|
+
:SDL_ceil => [:double],
|
377
|
+
:SDL_ceilf => [:float],
|
378
|
+
:SDL_copysign => [:double, :double],
|
379
|
+
:SDL_copysignf => [:float, :float],
|
380
|
+
:SDL_cos => [:double],
|
381
|
+
:SDL_cosf => [:float],
|
382
|
+
:SDL_exp => [:double],
|
383
|
+
:SDL_expf => [:float],
|
384
|
+
:SDL_fabs => [:double],
|
385
|
+
:SDL_fabsf => [:float],
|
386
|
+
:SDL_floor => [:double],
|
387
|
+
:SDL_floorf => [:float],
|
388
|
+
:SDL_trunc => [:double],
|
389
|
+
:SDL_truncf => [:float],
|
390
|
+
:SDL_fmod => [:double, :double],
|
391
|
+
:SDL_fmodf => [:float, :float],
|
392
|
+
:SDL_log => [:double],
|
393
|
+
:SDL_logf => [:float],
|
394
|
+
:SDL_log10 => [:double],
|
395
|
+
:SDL_log10f => [:float],
|
396
|
+
:SDL_pow => [:double, :double],
|
397
|
+
:SDL_powf => [:float, :float],
|
398
|
+
:SDL_round => [:double],
|
399
|
+
:SDL_roundf => [:float],
|
400
|
+
:SDL_lround => [:double],
|
401
|
+
:SDL_lroundf => [:float],
|
402
|
+
:SDL_scalbn => [:double, :int],
|
403
|
+
:SDL_scalbnf => [:float, :int],
|
404
|
+
:SDL_sin => [:double],
|
405
|
+
:SDL_sinf => [:float],
|
406
|
+
:SDL_sqrt => [:double],
|
407
|
+
:SDL_sqrtf => [:float],
|
408
|
+
:SDL_tan => [:double],
|
409
|
+
:SDL_tanf => [:float],
|
410
|
+
:SDL_iconv_open => [:pointer, :pointer],
|
411
|
+
:SDL_iconv_close => [:pointer],
|
412
|
+
:SDL_iconv => [:pointer, :pointer, :pointer, :pointer, :pointer],
|
413
|
+
:SDL_iconv_string => [:pointer, :pointer, :pointer, :ulong],
|
414
|
+
}
|
415
|
+
retvals = {
|
416
|
+
:SDL_malloc => :pointer,
|
417
|
+
:SDL_calloc => :pointer,
|
418
|
+
:SDL_realloc => :pointer,
|
419
|
+
:SDL_free => :void,
|
420
|
+
:SDL_GetMemoryFunctions => :void,
|
421
|
+
:SDL_SetMemoryFunctions => :int,
|
422
|
+
:SDL_GetNumAllocations => :int,
|
423
|
+
:SDL_getenv => :pointer,
|
424
|
+
:SDL_setenv => :int,
|
425
|
+
:SDL_qsort => :void,
|
426
|
+
:SDL_abs => :int,
|
427
|
+
:SDL_isalpha => :int,
|
428
|
+
:SDL_isalnum => :int,
|
429
|
+
:SDL_isblank => :int,
|
430
|
+
:SDL_iscntrl => :int,
|
431
|
+
:SDL_isdigit => :int,
|
432
|
+
:SDL_isxdigit => :int,
|
433
|
+
:SDL_ispunct => :int,
|
434
|
+
:SDL_isspace => :int,
|
435
|
+
:SDL_isupper => :int,
|
436
|
+
:SDL_islower => :int,
|
437
|
+
:SDL_isprint => :int,
|
438
|
+
:SDL_isgraph => :int,
|
439
|
+
:SDL_toupper => :int,
|
440
|
+
:SDL_tolower => :int,
|
441
|
+
:SDL_crc32 => :uint,
|
442
|
+
:SDL_memset => :pointer,
|
443
|
+
:SDL_memcpy => :pointer,
|
444
|
+
:SDL_memmove => :pointer,
|
445
|
+
:SDL_memcmp => :int,
|
446
|
+
:SDL_wcslen => :size_t,
|
447
|
+
:SDL_wcslcpy => :size_t,
|
448
|
+
:SDL_wcslcat => :size_t,
|
449
|
+
:SDL_wcsdup => :pointer,
|
450
|
+
:SDL_wcsstr => :pointer,
|
451
|
+
:SDL_wcscmp => :int,
|
452
|
+
:SDL_wcsncmp => :int,
|
453
|
+
:SDL_wcscasecmp => :int,
|
454
|
+
:SDL_wcsncasecmp => :int,
|
455
|
+
:SDL_strlen => :size_t,
|
456
|
+
:SDL_strlcpy => :size_t,
|
457
|
+
:SDL_utf8strlcpy => :size_t,
|
458
|
+
:SDL_strlcat => :size_t,
|
459
|
+
:SDL_strdup => :pointer,
|
460
|
+
:SDL_strrev => :pointer,
|
461
|
+
:SDL_strupr => :pointer,
|
462
|
+
:SDL_strlwr => :pointer,
|
463
|
+
:SDL_strchr => :pointer,
|
464
|
+
:SDL_strrchr => :pointer,
|
465
|
+
:SDL_strstr => :pointer,
|
466
|
+
:SDL_strtokr => :pointer,
|
467
|
+
:SDL_utf8strlen => :size_t,
|
468
|
+
:SDL_itoa => :pointer,
|
469
|
+
:SDL_uitoa => :pointer,
|
470
|
+
:SDL_ltoa => :pointer,
|
471
|
+
:SDL_ultoa => :pointer,
|
472
|
+
:SDL_lltoa => :pointer,
|
473
|
+
:SDL_ulltoa => :pointer,
|
474
|
+
:SDL_atoi => :int,
|
475
|
+
:SDL_atof => :double,
|
476
|
+
:SDL_strtol => :long,
|
477
|
+
:SDL_strtoul => :ulong,
|
478
|
+
:SDL_strtoll => :long_long,
|
479
|
+
:SDL_strtoull => :ulong_long,
|
480
|
+
:SDL_strtod => :double,
|
481
|
+
:SDL_strcmp => :int,
|
482
|
+
:SDL_strncmp => :int,
|
483
|
+
:SDL_strcasecmp => :int,
|
484
|
+
:SDL_strncasecmp => :int,
|
485
|
+
:SDL_sscanf => :int,
|
486
|
+
:SDL_vsscanf => :int,
|
487
|
+
:SDL_snprintf => :int,
|
488
|
+
:SDL_vsnprintf => :int,
|
489
|
+
:SDL_asprintf => :int,
|
490
|
+
:SDL_vasprintf => :int,
|
491
|
+
:SDL_acos => :double,
|
492
|
+
:SDL_acosf => :float,
|
493
|
+
:SDL_asin => :double,
|
494
|
+
:SDL_asinf => :float,
|
495
|
+
:SDL_atan => :double,
|
496
|
+
:SDL_atanf => :float,
|
497
|
+
:SDL_atan2 => :double,
|
498
|
+
:SDL_atan2f => :float,
|
499
|
+
:SDL_ceil => :double,
|
500
|
+
:SDL_ceilf => :float,
|
501
|
+
:SDL_copysign => :double,
|
502
|
+
:SDL_copysignf => :float,
|
503
|
+
:SDL_cos => :double,
|
504
|
+
:SDL_cosf => :float,
|
505
|
+
:SDL_exp => :double,
|
506
|
+
:SDL_expf => :float,
|
507
|
+
:SDL_fabs => :double,
|
508
|
+
:SDL_fabsf => :float,
|
509
|
+
:SDL_floor => :double,
|
510
|
+
:SDL_floorf => :float,
|
511
|
+
:SDL_trunc => :double,
|
512
|
+
:SDL_truncf => :float,
|
513
|
+
:SDL_fmod => :double,
|
514
|
+
:SDL_fmodf => :float,
|
515
|
+
:SDL_log => :double,
|
516
|
+
:SDL_logf => :float,
|
517
|
+
:SDL_log10 => :double,
|
518
|
+
:SDL_log10f => :float,
|
519
|
+
:SDL_pow => :double,
|
520
|
+
:SDL_powf => :float,
|
521
|
+
:SDL_round => :double,
|
522
|
+
:SDL_roundf => :float,
|
523
|
+
:SDL_lround => :long,
|
524
|
+
:SDL_lroundf => :long,
|
525
|
+
:SDL_scalbn => :double,
|
526
|
+
:SDL_scalbnf => :float,
|
527
|
+
:SDL_sin => :double,
|
528
|
+
:SDL_sinf => :float,
|
529
|
+
:SDL_sqrt => :double,
|
530
|
+
:SDL_sqrtf => :float,
|
531
|
+
:SDL_tan => :double,
|
532
|
+
:SDL_tanf => :float,
|
533
|
+
:SDL_iconv_open => :pointer,
|
534
|
+
:SDL_iconv_close => :int,
|
535
|
+
:SDL_iconv => :size_t,
|
536
|
+
:SDL_iconv_string => :pointer,
|
537
|
+
}
|
538
|
+
symbols.each do |sym|
|
539
|
+
begin
|
540
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
541
|
+
rescue FFI::NotFoundError => error
|
542
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
543
|
+
end
|
544
|
+
end
|
545
|
+
end
|
546
|
+
|
547
|
+
end
|
548
|
+
|