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