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.
- checksums.yaml +4 -4
- data/ChangeLog +145 -134
- data/LICENSE.txt +0 -0
- data/README.md +108 -86
- data/lib/sdl2.rb +131 -131
- data/lib/sdl2_audio.rb +265 -261
- data/lib/sdl2_blendmode.rb +72 -72
- data/lib/sdl2_clipboard.rb +56 -56
- data/lib/sdl2_cpuinfo.rb +137 -129
- data/lib/sdl2_error.rb +71 -71
- data/lib/sdl2_events.rb +575 -564
- data/lib/sdl2_filesystem.rb +52 -52
- data/lib/sdl2_framerate.rb +74 -74
- data/lib/sdl2_gamecontroller.rb +345 -329
- data/lib/sdl2_gesture.rb +61 -61
- data/lib/sdl2_gfxPrimitives.rb +283 -283
- data/lib/sdl2_guid.rb +58 -0
- data/lib/sdl2_haptic.rb +301 -301
- data/lib/sdl2_hidapi.rb +139 -139
- data/lib/sdl2_hints.rb +240 -221
- data/lib/sdl2_image.rb +296 -296
- data/lib/sdl2_imageFilter.rb +164 -164
- data/lib/sdl2_joystick.rb +332 -294
- data/lib/sdl2_keyboard.rb +129 -125
- data/lib/sdl2_keycode.rb +311 -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 -464
- 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 -145
- data/lib/sdl2_render.rb +408 -408
- data/lib/sdl2_rotozoom.rb +76 -76
- data/lib/sdl2_rwops.rb +242 -242
- data/lib/sdl2_scancode.rb +293 -289
- data/lib/sdl2_sensor.rb +115 -115
- data/lib/sdl2_shape.rb +83 -83
- data/lib/sdl2_sound.rb +154 -154
- data/lib/sdl2_stdinc.rb +572 -548
- 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 -86
- data/lib/sdl2_ttf.rb +414 -414
- data/lib/sdl2_version.rb +67 -67
- data/lib/sdl2_video.rb +549 -540
- data/lib/sdl2_vulkan.rb +72 -72
- metadata +4 -3
data/lib/sdl2_video.rb
CHANGED
@@ -1,540 +1,549 @@
|
|
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
|
-
WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000
|
14
|
-
WINDOWPOS_CENTERED_MASK = 0x2FFF0000
|
15
|
-
|
16
|
-
# Enum
|
17
|
-
|
18
|
-
WINDOW_FULLSCREEN = 1
|
19
|
-
WINDOW_OPENGL = 2
|
20
|
-
WINDOW_SHOWN = 4
|
21
|
-
WINDOW_HIDDEN = 8
|
22
|
-
WINDOW_BORDERLESS = 16
|
23
|
-
WINDOW_RESIZABLE = 32
|
24
|
-
WINDOW_MINIMIZED = 64
|
25
|
-
WINDOW_MAXIMIZED = 128
|
26
|
-
WINDOW_MOUSE_GRABBED = 256
|
27
|
-
WINDOW_INPUT_FOCUS = 512
|
28
|
-
WINDOW_MOUSE_FOCUS = 1024
|
29
|
-
WINDOW_FULLSCREEN_DESKTOP = 4097
|
30
|
-
WINDOW_FOREIGN = 2048
|
31
|
-
WINDOW_ALLOW_HIGHDPI = 8192
|
32
|
-
WINDOW_MOUSE_CAPTURE = 16384
|
33
|
-
WINDOW_ALWAYS_ON_TOP = 32768
|
34
|
-
WINDOW_SKIP_TASKBAR = 65536
|
35
|
-
WINDOW_UTILITY = 131072
|
36
|
-
WINDOW_TOOLTIP = 262144
|
37
|
-
WINDOW_POPUP_MENU = 524288
|
38
|
-
WINDOW_KEYBOARD_GRABBED = 1048576
|
39
|
-
WINDOW_VULKAN = 268435456
|
40
|
-
WINDOW_METAL = 536870912
|
41
|
-
WINDOW_INPUT_GRABBED = 256
|
42
|
-
WINDOWEVENT_NONE = 0
|
43
|
-
WINDOWEVENT_SHOWN = 1
|
44
|
-
WINDOWEVENT_HIDDEN = 2
|
45
|
-
WINDOWEVENT_EXPOSED = 3
|
46
|
-
WINDOWEVENT_MOVED = 4
|
47
|
-
WINDOWEVENT_RESIZED = 5
|
48
|
-
WINDOWEVENT_SIZE_CHANGED = 6
|
49
|
-
WINDOWEVENT_MINIMIZED = 7
|
50
|
-
WINDOWEVENT_MAXIMIZED = 8
|
51
|
-
WINDOWEVENT_RESTORED = 9
|
52
|
-
WINDOWEVENT_ENTER = 10
|
53
|
-
WINDOWEVENT_LEAVE = 11
|
54
|
-
WINDOWEVENT_FOCUS_GAINED = 12
|
55
|
-
WINDOWEVENT_FOCUS_LOST = 13
|
56
|
-
WINDOWEVENT_CLOSE = 14
|
57
|
-
WINDOWEVENT_TAKE_FOCUS = 15
|
58
|
-
WINDOWEVENT_HIT_TEST = 16
|
59
|
-
WINDOWEVENT_ICCPROF_CHANGED = 17
|
60
|
-
WINDOWEVENT_DISPLAY_CHANGED = 18
|
61
|
-
DISPLAYEVENT_NONE = 0
|
62
|
-
DISPLAYEVENT_ORIENTATION = 1
|
63
|
-
DISPLAYEVENT_CONNECTED = 2
|
64
|
-
DISPLAYEVENT_DISCONNECTED = 3
|
65
|
-
ORIENTATION_UNKNOWN = 0
|
66
|
-
ORIENTATION_LANDSCAPE = 1
|
67
|
-
ORIENTATION_LANDSCAPE_FLIPPED = 2
|
68
|
-
ORIENTATION_PORTRAIT = 3
|
69
|
-
ORIENTATION_PORTRAIT_FLIPPED = 4
|
70
|
-
FLASH_CANCEL = 0
|
71
|
-
FLASH_BRIEFLY = 1
|
72
|
-
FLASH_UNTIL_FOCUSED = 2
|
73
|
-
GL_RED_SIZE = 0
|
74
|
-
GL_GREEN_SIZE = 1
|
75
|
-
GL_BLUE_SIZE = 2
|
76
|
-
GL_ALPHA_SIZE = 3
|
77
|
-
GL_BUFFER_SIZE = 4
|
78
|
-
GL_DOUBLEBUFFER = 5
|
79
|
-
GL_DEPTH_SIZE = 6
|
80
|
-
GL_STENCIL_SIZE = 7
|
81
|
-
GL_ACCUM_RED_SIZE = 8
|
82
|
-
GL_ACCUM_GREEN_SIZE = 9
|
83
|
-
GL_ACCUM_BLUE_SIZE = 10
|
84
|
-
GL_ACCUM_ALPHA_SIZE = 11
|
85
|
-
GL_STEREO = 12
|
86
|
-
GL_MULTISAMPLEBUFFERS = 13
|
87
|
-
GL_MULTISAMPLESAMPLES = 14
|
88
|
-
GL_ACCELERATED_VISUAL = 15
|
89
|
-
GL_RETAINED_BACKING = 16
|
90
|
-
GL_CONTEXT_MAJOR_VERSION = 17
|
91
|
-
GL_CONTEXT_MINOR_VERSION = 18
|
92
|
-
GL_CONTEXT_EGL = 19
|
93
|
-
GL_CONTEXT_FLAGS = 20
|
94
|
-
GL_CONTEXT_PROFILE_MASK = 21
|
95
|
-
GL_SHARE_WITH_CURRENT_CONTEXT = 22
|
96
|
-
GL_FRAMEBUFFER_SRGB_CAPABLE = 23
|
97
|
-
GL_CONTEXT_RELEASE_BEHAVIOR = 24
|
98
|
-
GL_CONTEXT_RESET_NOTIFICATION = 25
|
99
|
-
GL_CONTEXT_NO_ERROR = 26
|
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
|
-
typedef :int, :
|
126
|
-
typedef :int, :
|
127
|
-
typedef :int, :
|
128
|
-
typedef :int, :
|
129
|
-
typedef :
|
130
|
-
typedef :
|
131
|
-
typedef :int, :
|
132
|
-
typedef :int, :
|
133
|
-
typedef :int, :
|
134
|
-
typedef :int, :
|
135
|
-
typedef :int, :
|
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
|
-
|
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
|
+
WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000
|
14
|
+
WINDOWPOS_CENTERED_MASK = 0x2FFF0000
|
15
|
+
|
16
|
+
# Enum
|
17
|
+
|
18
|
+
WINDOW_FULLSCREEN = 1
|
19
|
+
WINDOW_OPENGL = 2
|
20
|
+
WINDOW_SHOWN = 4
|
21
|
+
WINDOW_HIDDEN = 8
|
22
|
+
WINDOW_BORDERLESS = 16
|
23
|
+
WINDOW_RESIZABLE = 32
|
24
|
+
WINDOW_MINIMIZED = 64
|
25
|
+
WINDOW_MAXIMIZED = 128
|
26
|
+
WINDOW_MOUSE_GRABBED = 256
|
27
|
+
WINDOW_INPUT_FOCUS = 512
|
28
|
+
WINDOW_MOUSE_FOCUS = 1024
|
29
|
+
WINDOW_FULLSCREEN_DESKTOP = 4097
|
30
|
+
WINDOW_FOREIGN = 2048
|
31
|
+
WINDOW_ALLOW_HIGHDPI = 8192
|
32
|
+
WINDOW_MOUSE_CAPTURE = 16384
|
33
|
+
WINDOW_ALWAYS_ON_TOP = 32768
|
34
|
+
WINDOW_SKIP_TASKBAR = 65536
|
35
|
+
WINDOW_UTILITY = 131072
|
36
|
+
WINDOW_TOOLTIP = 262144
|
37
|
+
WINDOW_POPUP_MENU = 524288
|
38
|
+
WINDOW_KEYBOARD_GRABBED = 1048576
|
39
|
+
WINDOW_VULKAN = 268435456
|
40
|
+
WINDOW_METAL = 536870912
|
41
|
+
WINDOW_INPUT_GRABBED = 256
|
42
|
+
WINDOWEVENT_NONE = 0
|
43
|
+
WINDOWEVENT_SHOWN = 1
|
44
|
+
WINDOWEVENT_HIDDEN = 2
|
45
|
+
WINDOWEVENT_EXPOSED = 3
|
46
|
+
WINDOWEVENT_MOVED = 4
|
47
|
+
WINDOWEVENT_RESIZED = 5
|
48
|
+
WINDOWEVENT_SIZE_CHANGED = 6
|
49
|
+
WINDOWEVENT_MINIMIZED = 7
|
50
|
+
WINDOWEVENT_MAXIMIZED = 8
|
51
|
+
WINDOWEVENT_RESTORED = 9
|
52
|
+
WINDOWEVENT_ENTER = 10
|
53
|
+
WINDOWEVENT_LEAVE = 11
|
54
|
+
WINDOWEVENT_FOCUS_GAINED = 12
|
55
|
+
WINDOWEVENT_FOCUS_LOST = 13
|
56
|
+
WINDOWEVENT_CLOSE = 14
|
57
|
+
WINDOWEVENT_TAKE_FOCUS = 15
|
58
|
+
WINDOWEVENT_HIT_TEST = 16
|
59
|
+
WINDOWEVENT_ICCPROF_CHANGED = 17
|
60
|
+
WINDOWEVENT_DISPLAY_CHANGED = 18
|
61
|
+
DISPLAYEVENT_NONE = 0
|
62
|
+
DISPLAYEVENT_ORIENTATION = 1
|
63
|
+
DISPLAYEVENT_CONNECTED = 2
|
64
|
+
DISPLAYEVENT_DISCONNECTED = 3
|
65
|
+
ORIENTATION_UNKNOWN = 0
|
66
|
+
ORIENTATION_LANDSCAPE = 1
|
67
|
+
ORIENTATION_LANDSCAPE_FLIPPED = 2
|
68
|
+
ORIENTATION_PORTRAIT = 3
|
69
|
+
ORIENTATION_PORTRAIT_FLIPPED = 4
|
70
|
+
FLASH_CANCEL = 0
|
71
|
+
FLASH_BRIEFLY = 1
|
72
|
+
FLASH_UNTIL_FOCUSED = 2
|
73
|
+
GL_RED_SIZE = 0
|
74
|
+
GL_GREEN_SIZE = 1
|
75
|
+
GL_BLUE_SIZE = 2
|
76
|
+
GL_ALPHA_SIZE = 3
|
77
|
+
GL_BUFFER_SIZE = 4
|
78
|
+
GL_DOUBLEBUFFER = 5
|
79
|
+
GL_DEPTH_SIZE = 6
|
80
|
+
GL_STENCIL_SIZE = 7
|
81
|
+
GL_ACCUM_RED_SIZE = 8
|
82
|
+
GL_ACCUM_GREEN_SIZE = 9
|
83
|
+
GL_ACCUM_BLUE_SIZE = 10
|
84
|
+
GL_ACCUM_ALPHA_SIZE = 11
|
85
|
+
GL_STEREO = 12
|
86
|
+
GL_MULTISAMPLEBUFFERS = 13
|
87
|
+
GL_MULTISAMPLESAMPLES = 14
|
88
|
+
GL_ACCELERATED_VISUAL = 15
|
89
|
+
GL_RETAINED_BACKING = 16
|
90
|
+
GL_CONTEXT_MAJOR_VERSION = 17
|
91
|
+
GL_CONTEXT_MINOR_VERSION = 18
|
92
|
+
GL_CONTEXT_EGL = 19
|
93
|
+
GL_CONTEXT_FLAGS = 20
|
94
|
+
GL_CONTEXT_PROFILE_MASK = 21
|
95
|
+
GL_SHARE_WITH_CURRENT_CONTEXT = 22
|
96
|
+
GL_FRAMEBUFFER_SRGB_CAPABLE = 23
|
97
|
+
GL_CONTEXT_RELEASE_BEHAVIOR = 24
|
98
|
+
GL_CONTEXT_RESET_NOTIFICATION = 25
|
99
|
+
GL_CONTEXT_NO_ERROR = 26
|
100
|
+
GL_FLOATBUFFERS = 27
|
101
|
+
GL_CONTEXT_PROFILE_CORE = 1
|
102
|
+
GL_CONTEXT_PROFILE_COMPATIBILITY = 2
|
103
|
+
GL_CONTEXT_PROFILE_ES = 4
|
104
|
+
GL_CONTEXT_DEBUG_FLAG = 1
|
105
|
+
GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 2
|
106
|
+
GL_CONTEXT_ROBUST_ACCESS_FLAG = 4
|
107
|
+
GL_CONTEXT_RESET_ISOLATION_FLAG = 8
|
108
|
+
GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0
|
109
|
+
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 1
|
110
|
+
GL_CONTEXT_RESET_NO_NOTIFICATION = 0
|
111
|
+
GL_CONTEXT_RESET_LOSE_CONTEXT = 1
|
112
|
+
HITTEST_NORMAL = 0
|
113
|
+
HITTEST_DRAGGABLE = 1
|
114
|
+
HITTEST_RESIZE_TOPLEFT = 2
|
115
|
+
HITTEST_RESIZE_TOP = 3
|
116
|
+
HITTEST_RESIZE_TOPRIGHT = 4
|
117
|
+
HITTEST_RESIZE_RIGHT = 5
|
118
|
+
HITTEST_RESIZE_BOTTOMRIGHT = 6
|
119
|
+
HITTEST_RESIZE_BOTTOM = 7
|
120
|
+
HITTEST_RESIZE_BOTTOMLEFT = 8
|
121
|
+
HITTEST_RESIZE_LEFT = 9
|
122
|
+
|
123
|
+
# Typedef
|
124
|
+
|
125
|
+
typedef :int, :SDL_WindowFlags
|
126
|
+
typedef :int, :SDL_WindowEventID
|
127
|
+
typedef :int, :SDL_DisplayEventID
|
128
|
+
typedef :int, :SDL_DisplayOrientation
|
129
|
+
typedef :int, :SDL_FlashOperation
|
130
|
+
typedef :pointer, :SDL_GLContext
|
131
|
+
typedef :int, :SDL_GLattr
|
132
|
+
typedef :int, :SDL_GLprofile
|
133
|
+
typedef :int, :SDL_GLcontextFlag
|
134
|
+
typedef :int, :SDL_GLcontextReleaseFlag
|
135
|
+
typedef :int, :SDL_GLContextResetNotification
|
136
|
+
typedef :int, :SDL_HitTestResult
|
137
|
+
callback :SDL_HitTest, [:pointer, :pointer, :pointer], :int
|
138
|
+
|
139
|
+
# Struct
|
140
|
+
|
141
|
+
class DisplayMode < FFI::Struct
|
142
|
+
layout(
|
143
|
+
:format, :uint,
|
144
|
+
:w, :int,
|
145
|
+
:h, :int,
|
146
|
+
:refresh_rate, :int,
|
147
|
+
:driverdata, :pointer,
|
148
|
+
)
|
149
|
+
end
|
150
|
+
|
151
|
+
|
152
|
+
# Function
|
153
|
+
|
154
|
+
def self.setup_video_symbols(output_error = false)
|
155
|
+
symbols = [
|
156
|
+
:SDL_GetNumVideoDrivers,
|
157
|
+
:SDL_GetVideoDriver,
|
158
|
+
:SDL_VideoInit,
|
159
|
+
:SDL_VideoQuit,
|
160
|
+
:SDL_GetCurrentVideoDriver,
|
161
|
+
:SDL_GetNumVideoDisplays,
|
162
|
+
:SDL_GetDisplayName,
|
163
|
+
:SDL_GetDisplayBounds,
|
164
|
+
:SDL_GetDisplayUsableBounds,
|
165
|
+
:SDL_GetDisplayDPI,
|
166
|
+
:SDL_GetDisplayOrientation,
|
167
|
+
:SDL_GetNumDisplayModes,
|
168
|
+
:SDL_GetDisplayMode,
|
169
|
+
:SDL_GetDesktopDisplayMode,
|
170
|
+
:SDL_GetCurrentDisplayMode,
|
171
|
+
:SDL_GetClosestDisplayMode,
|
172
|
+
:SDL_GetPointDisplayIndex,
|
173
|
+
:SDL_GetRectDisplayIndex,
|
174
|
+
:SDL_GetWindowDisplayIndex,
|
175
|
+
:SDL_SetWindowDisplayMode,
|
176
|
+
:SDL_GetWindowDisplayMode,
|
177
|
+
:SDL_GetWindowICCProfile,
|
178
|
+
:SDL_GetWindowPixelFormat,
|
179
|
+
:SDL_CreateWindow,
|
180
|
+
:SDL_CreateWindowFrom,
|
181
|
+
:SDL_GetWindowID,
|
182
|
+
:SDL_GetWindowFromID,
|
183
|
+
:SDL_GetWindowFlags,
|
184
|
+
:SDL_SetWindowTitle,
|
185
|
+
:SDL_GetWindowTitle,
|
186
|
+
:SDL_SetWindowIcon,
|
187
|
+
:SDL_SetWindowData,
|
188
|
+
:SDL_GetWindowData,
|
189
|
+
:SDL_SetWindowPosition,
|
190
|
+
:SDL_GetWindowPosition,
|
191
|
+
:SDL_SetWindowSize,
|
192
|
+
:SDL_GetWindowSize,
|
193
|
+
:SDL_GetWindowBordersSize,
|
194
|
+
:SDL_SetWindowMinimumSize,
|
195
|
+
:SDL_GetWindowMinimumSize,
|
196
|
+
:SDL_SetWindowMaximumSize,
|
197
|
+
:SDL_GetWindowMaximumSize,
|
198
|
+
:SDL_SetWindowBordered,
|
199
|
+
:SDL_SetWindowResizable,
|
200
|
+
:SDL_SetWindowAlwaysOnTop,
|
201
|
+
:SDL_ShowWindow,
|
202
|
+
:SDL_HideWindow,
|
203
|
+
:SDL_RaiseWindow,
|
204
|
+
:SDL_MaximizeWindow,
|
205
|
+
:SDL_MinimizeWindow,
|
206
|
+
:SDL_RestoreWindow,
|
207
|
+
:SDL_SetWindowFullscreen,
|
208
|
+
:SDL_GetWindowSurface,
|
209
|
+
:SDL_UpdateWindowSurface,
|
210
|
+
:SDL_UpdateWindowSurfaceRects,
|
211
|
+
:SDL_SetWindowGrab,
|
212
|
+
:SDL_SetWindowKeyboardGrab,
|
213
|
+
:SDL_SetWindowMouseGrab,
|
214
|
+
:SDL_GetWindowGrab,
|
215
|
+
:SDL_GetWindowKeyboardGrab,
|
216
|
+
:SDL_GetWindowMouseGrab,
|
217
|
+
:SDL_GetGrabbedWindow,
|
218
|
+
:SDL_SetWindowMouseRect,
|
219
|
+
:SDL_GetWindowMouseRect,
|
220
|
+
:SDL_SetWindowBrightness,
|
221
|
+
:SDL_GetWindowBrightness,
|
222
|
+
:SDL_SetWindowOpacity,
|
223
|
+
:SDL_GetWindowOpacity,
|
224
|
+
:SDL_SetWindowModalFor,
|
225
|
+
:SDL_SetWindowInputFocus,
|
226
|
+
:SDL_SetWindowGammaRamp,
|
227
|
+
:SDL_GetWindowGammaRamp,
|
228
|
+
:SDL_SetWindowHitTest,
|
229
|
+
:SDL_FlashWindow,
|
230
|
+
:SDL_DestroyWindow,
|
231
|
+
:SDL_IsScreenSaverEnabled,
|
232
|
+
:SDL_EnableScreenSaver,
|
233
|
+
:SDL_DisableScreenSaver,
|
234
|
+
:SDL_GL_LoadLibrary,
|
235
|
+
:SDL_GL_GetProcAddress,
|
236
|
+
:SDL_GL_UnloadLibrary,
|
237
|
+
:SDL_GL_ExtensionSupported,
|
238
|
+
:SDL_GL_ResetAttributes,
|
239
|
+
:SDL_GL_SetAttribute,
|
240
|
+
:SDL_GL_GetAttribute,
|
241
|
+
:SDL_GL_CreateContext,
|
242
|
+
:SDL_GL_MakeCurrent,
|
243
|
+
:SDL_GL_GetCurrentWindow,
|
244
|
+
:SDL_GL_GetCurrentContext,
|
245
|
+
:SDL_GL_GetDrawableSize,
|
246
|
+
:SDL_GL_SetSwapInterval,
|
247
|
+
:SDL_GL_GetSwapInterval,
|
248
|
+
:SDL_GL_SwapWindow,
|
249
|
+
:SDL_GL_DeleteContext,
|
250
|
+
]
|
251
|
+
apis = {
|
252
|
+
:SDL_GetNumVideoDrivers => :GetNumVideoDrivers,
|
253
|
+
:SDL_GetVideoDriver => :GetVideoDriver,
|
254
|
+
:SDL_VideoInit => :VideoInit,
|
255
|
+
:SDL_VideoQuit => :VideoQuit,
|
256
|
+
:SDL_GetCurrentVideoDriver => :GetCurrentVideoDriver,
|
257
|
+
:SDL_GetNumVideoDisplays => :GetNumVideoDisplays,
|
258
|
+
:SDL_GetDisplayName => :GetDisplayName,
|
259
|
+
:SDL_GetDisplayBounds => :GetDisplayBounds,
|
260
|
+
:SDL_GetDisplayUsableBounds => :GetDisplayUsableBounds,
|
261
|
+
:SDL_GetDisplayDPI => :GetDisplayDPI,
|
262
|
+
:SDL_GetDisplayOrientation => :GetDisplayOrientation,
|
263
|
+
:SDL_GetNumDisplayModes => :GetNumDisplayModes,
|
264
|
+
:SDL_GetDisplayMode => :GetDisplayMode,
|
265
|
+
:SDL_GetDesktopDisplayMode => :GetDesktopDisplayMode,
|
266
|
+
:SDL_GetCurrentDisplayMode => :GetCurrentDisplayMode,
|
267
|
+
:SDL_GetClosestDisplayMode => :GetClosestDisplayMode,
|
268
|
+
:SDL_GetPointDisplayIndex => :GetPointDisplayIndex,
|
269
|
+
:SDL_GetRectDisplayIndex => :GetRectDisplayIndex,
|
270
|
+
:SDL_GetWindowDisplayIndex => :GetWindowDisplayIndex,
|
271
|
+
:SDL_SetWindowDisplayMode => :SetWindowDisplayMode,
|
272
|
+
:SDL_GetWindowDisplayMode => :GetWindowDisplayMode,
|
273
|
+
:SDL_GetWindowICCProfile => :GetWindowICCProfile,
|
274
|
+
:SDL_GetWindowPixelFormat => :GetWindowPixelFormat,
|
275
|
+
:SDL_CreateWindow => :CreateWindow,
|
276
|
+
:SDL_CreateWindowFrom => :CreateWindowFrom,
|
277
|
+
:SDL_GetWindowID => :GetWindowID,
|
278
|
+
:SDL_GetWindowFromID => :GetWindowFromID,
|
279
|
+
:SDL_GetWindowFlags => :GetWindowFlags,
|
280
|
+
:SDL_SetWindowTitle => :SetWindowTitle,
|
281
|
+
:SDL_GetWindowTitle => :GetWindowTitle,
|
282
|
+
:SDL_SetWindowIcon => :SetWindowIcon,
|
283
|
+
:SDL_SetWindowData => :SetWindowData,
|
284
|
+
:SDL_GetWindowData => :GetWindowData,
|
285
|
+
:SDL_SetWindowPosition => :SetWindowPosition,
|
286
|
+
:SDL_GetWindowPosition => :GetWindowPosition,
|
287
|
+
:SDL_SetWindowSize => :SetWindowSize,
|
288
|
+
:SDL_GetWindowSize => :GetWindowSize,
|
289
|
+
:SDL_GetWindowBordersSize => :GetWindowBordersSize,
|
290
|
+
:SDL_SetWindowMinimumSize => :SetWindowMinimumSize,
|
291
|
+
:SDL_GetWindowMinimumSize => :GetWindowMinimumSize,
|
292
|
+
:SDL_SetWindowMaximumSize => :SetWindowMaximumSize,
|
293
|
+
:SDL_GetWindowMaximumSize => :GetWindowMaximumSize,
|
294
|
+
:SDL_SetWindowBordered => :SetWindowBordered,
|
295
|
+
:SDL_SetWindowResizable => :SetWindowResizable,
|
296
|
+
:SDL_SetWindowAlwaysOnTop => :SetWindowAlwaysOnTop,
|
297
|
+
:SDL_ShowWindow => :ShowWindow,
|
298
|
+
:SDL_HideWindow => :HideWindow,
|
299
|
+
:SDL_RaiseWindow => :RaiseWindow,
|
300
|
+
:SDL_MaximizeWindow => :MaximizeWindow,
|
301
|
+
:SDL_MinimizeWindow => :MinimizeWindow,
|
302
|
+
:SDL_RestoreWindow => :RestoreWindow,
|
303
|
+
:SDL_SetWindowFullscreen => :SetWindowFullscreen,
|
304
|
+
:SDL_GetWindowSurface => :GetWindowSurface,
|
305
|
+
:SDL_UpdateWindowSurface => :UpdateWindowSurface,
|
306
|
+
:SDL_UpdateWindowSurfaceRects => :UpdateWindowSurfaceRects,
|
307
|
+
:SDL_SetWindowGrab => :SetWindowGrab,
|
308
|
+
:SDL_SetWindowKeyboardGrab => :SetWindowKeyboardGrab,
|
309
|
+
:SDL_SetWindowMouseGrab => :SetWindowMouseGrab,
|
310
|
+
:SDL_GetWindowGrab => :GetWindowGrab,
|
311
|
+
:SDL_GetWindowKeyboardGrab => :GetWindowKeyboardGrab,
|
312
|
+
:SDL_GetWindowMouseGrab => :GetWindowMouseGrab,
|
313
|
+
:SDL_GetGrabbedWindow => :GetGrabbedWindow,
|
314
|
+
:SDL_SetWindowMouseRect => :SetWindowMouseRect,
|
315
|
+
:SDL_GetWindowMouseRect => :GetWindowMouseRect,
|
316
|
+
:SDL_SetWindowBrightness => :SetWindowBrightness,
|
317
|
+
:SDL_GetWindowBrightness => :GetWindowBrightness,
|
318
|
+
:SDL_SetWindowOpacity => :SetWindowOpacity,
|
319
|
+
:SDL_GetWindowOpacity => :GetWindowOpacity,
|
320
|
+
:SDL_SetWindowModalFor => :SetWindowModalFor,
|
321
|
+
:SDL_SetWindowInputFocus => :SetWindowInputFocus,
|
322
|
+
:SDL_SetWindowGammaRamp => :SetWindowGammaRamp,
|
323
|
+
:SDL_GetWindowGammaRamp => :GetWindowGammaRamp,
|
324
|
+
:SDL_SetWindowHitTest => :SetWindowHitTest,
|
325
|
+
:SDL_FlashWindow => :FlashWindow,
|
326
|
+
:SDL_DestroyWindow => :DestroyWindow,
|
327
|
+
:SDL_IsScreenSaverEnabled => :IsScreenSaverEnabled,
|
328
|
+
:SDL_EnableScreenSaver => :EnableScreenSaver,
|
329
|
+
:SDL_DisableScreenSaver => :DisableScreenSaver,
|
330
|
+
:SDL_GL_LoadLibrary => :GL_LoadLibrary,
|
331
|
+
:SDL_GL_GetProcAddress => :GL_GetProcAddress,
|
332
|
+
:SDL_GL_UnloadLibrary => :GL_UnloadLibrary,
|
333
|
+
:SDL_GL_ExtensionSupported => :GL_ExtensionSupported,
|
334
|
+
:SDL_GL_ResetAttributes => :GL_ResetAttributes,
|
335
|
+
:SDL_GL_SetAttribute => :GL_SetAttribute,
|
336
|
+
:SDL_GL_GetAttribute => :GL_GetAttribute,
|
337
|
+
:SDL_GL_CreateContext => :GL_CreateContext,
|
338
|
+
:SDL_GL_MakeCurrent => :GL_MakeCurrent,
|
339
|
+
:SDL_GL_GetCurrentWindow => :GL_GetCurrentWindow,
|
340
|
+
:SDL_GL_GetCurrentContext => :GL_GetCurrentContext,
|
341
|
+
:SDL_GL_GetDrawableSize => :GL_GetDrawableSize,
|
342
|
+
:SDL_GL_SetSwapInterval => :GL_SetSwapInterval,
|
343
|
+
:SDL_GL_GetSwapInterval => :GL_GetSwapInterval,
|
344
|
+
:SDL_GL_SwapWindow => :GL_SwapWindow,
|
345
|
+
:SDL_GL_DeleteContext => :GL_DeleteContext,
|
346
|
+
}
|
347
|
+
args = {
|
348
|
+
:SDL_GetNumVideoDrivers => [],
|
349
|
+
:SDL_GetVideoDriver => [:int],
|
350
|
+
:SDL_VideoInit => [:pointer],
|
351
|
+
:SDL_VideoQuit => [],
|
352
|
+
:SDL_GetCurrentVideoDriver => [],
|
353
|
+
:SDL_GetNumVideoDisplays => [],
|
354
|
+
:SDL_GetDisplayName => [:int],
|
355
|
+
:SDL_GetDisplayBounds => [:int, :pointer],
|
356
|
+
:SDL_GetDisplayUsableBounds => [:int, :pointer],
|
357
|
+
:SDL_GetDisplayDPI => [:int, :pointer, :pointer, :pointer],
|
358
|
+
:SDL_GetDisplayOrientation => [:int],
|
359
|
+
:SDL_GetNumDisplayModes => [:int],
|
360
|
+
:SDL_GetDisplayMode => [:int, :int, :pointer],
|
361
|
+
:SDL_GetDesktopDisplayMode => [:int, :pointer],
|
362
|
+
:SDL_GetCurrentDisplayMode => [:int, :pointer],
|
363
|
+
:SDL_GetClosestDisplayMode => [:int, :pointer, :pointer],
|
364
|
+
:SDL_GetPointDisplayIndex => [:pointer],
|
365
|
+
:SDL_GetRectDisplayIndex => [:pointer],
|
366
|
+
:SDL_GetWindowDisplayIndex => [:pointer],
|
367
|
+
:SDL_SetWindowDisplayMode => [:pointer, :pointer],
|
368
|
+
:SDL_GetWindowDisplayMode => [:pointer, :pointer],
|
369
|
+
:SDL_GetWindowICCProfile => [:pointer, :pointer],
|
370
|
+
:SDL_GetWindowPixelFormat => [:pointer],
|
371
|
+
:SDL_CreateWindow => [:pointer, :int, :int, :int, :int, :uint],
|
372
|
+
:SDL_CreateWindowFrom => [:pointer],
|
373
|
+
:SDL_GetWindowID => [:pointer],
|
374
|
+
:SDL_GetWindowFromID => [:uint],
|
375
|
+
:SDL_GetWindowFlags => [:pointer],
|
376
|
+
:SDL_SetWindowTitle => [:pointer, :pointer],
|
377
|
+
:SDL_GetWindowTitle => [:pointer],
|
378
|
+
:SDL_SetWindowIcon => [:pointer, :pointer],
|
379
|
+
:SDL_SetWindowData => [:pointer, :pointer, :pointer],
|
380
|
+
:SDL_GetWindowData => [:pointer, :pointer],
|
381
|
+
:SDL_SetWindowPosition => [:pointer, :int, :int],
|
382
|
+
:SDL_GetWindowPosition => [:pointer, :pointer, :pointer],
|
383
|
+
:SDL_SetWindowSize => [:pointer, :int, :int],
|
384
|
+
:SDL_GetWindowSize => [:pointer, :pointer, :pointer],
|
385
|
+
:SDL_GetWindowBordersSize => [:pointer, :pointer, :pointer, :pointer, :pointer],
|
386
|
+
:SDL_SetWindowMinimumSize => [:pointer, :int, :int],
|
387
|
+
:SDL_GetWindowMinimumSize => [:pointer, :pointer, :pointer],
|
388
|
+
:SDL_SetWindowMaximumSize => [:pointer, :int, :int],
|
389
|
+
:SDL_GetWindowMaximumSize => [:pointer, :pointer, :pointer],
|
390
|
+
:SDL_SetWindowBordered => [:pointer, :int],
|
391
|
+
:SDL_SetWindowResizable => [:pointer, :int],
|
392
|
+
:SDL_SetWindowAlwaysOnTop => [:pointer, :int],
|
393
|
+
:SDL_ShowWindow => [:pointer],
|
394
|
+
:SDL_HideWindow => [:pointer],
|
395
|
+
:SDL_RaiseWindow => [:pointer],
|
396
|
+
:SDL_MaximizeWindow => [:pointer],
|
397
|
+
:SDL_MinimizeWindow => [:pointer],
|
398
|
+
:SDL_RestoreWindow => [:pointer],
|
399
|
+
:SDL_SetWindowFullscreen => [:pointer, :uint],
|
400
|
+
:SDL_GetWindowSurface => [:pointer],
|
401
|
+
:SDL_UpdateWindowSurface => [:pointer],
|
402
|
+
:SDL_UpdateWindowSurfaceRects => [:pointer, :pointer, :int],
|
403
|
+
:SDL_SetWindowGrab => [:pointer, :int],
|
404
|
+
:SDL_SetWindowKeyboardGrab => [:pointer, :int],
|
405
|
+
:SDL_SetWindowMouseGrab => [:pointer, :int],
|
406
|
+
:SDL_GetWindowGrab => [:pointer],
|
407
|
+
:SDL_GetWindowKeyboardGrab => [:pointer],
|
408
|
+
:SDL_GetWindowMouseGrab => [:pointer],
|
409
|
+
:SDL_GetGrabbedWindow => [],
|
410
|
+
:SDL_SetWindowMouseRect => [:pointer, :pointer],
|
411
|
+
:SDL_GetWindowMouseRect => [:pointer],
|
412
|
+
:SDL_SetWindowBrightness => [:pointer, :float],
|
413
|
+
:SDL_GetWindowBrightness => [:pointer],
|
414
|
+
:SDL_SetWindowOpacity => [:pointer, :float],
|
415
|
+
:SDL_GetWindowOpacity => [:pointer, :pointer],
|
416
|
+
:SDL_SetWindowModalFor => [:pointer, :pointer],
|
417
|
+
:SDL_SetWindowInputFocus => [:pointer],
|
418
|
+
:SDL_SetWindowGammaRamp => [:pointer, :pointer, :pointer, :pointer],
|
419
|
+
:SDL_GetWindowGammaRamp => [:pointer, :pointer, :pointer, :pointer],
|
420
|
+
:SDL_SetWindowHitTest => [:pointer, :SDL_HitTest, :pointer],
|
421
|
+
:SDL_FlashWindow => [:pointer, :int],
|
422
|
+
:SDL_DestroyWindow => [:pointer],
|
423
|
+
:SDL_IsScreenSaverEnabled => [],
|
424
|
+
:SDL_EnableScreenSaver => [],
|
425
|
+
:SDL_DisableScreenSaver => [],
|
426
|
+
:SDL_GL_LoadLibrary => [:pointer],
|
427
|
+
:SDL_GL_GetProcAddress => [:pointer],
|
428
|
+
:SDL_GL_UnloadLibrary => [],
|
429
|
+
:SDL_GL_ExtensionSupported => [:pointer],
|
430
|
+
:SDL_GL_ResetAttributes => [],
|
431
|
+
:SDL_GL_SetAttribute => [:int, :int],
|
432
|
+
:SDL_GL_GetAttribute => [:int, :pointer],
|
433
|
+
:SDL_GL_CreateContext => [:pointer],
|
434
|
+
:SDL_GL_MakeCurrent => [:pointer, :pointer],
|
435
|
+
:SDL_GL_GetCurrentWindow => [],
|
436
|
+
:SDL_GL_GetCurrentContext => [],
|
437
|
+
:SDL_GL_GetDrawableSize => [:pointer, :pointer, :pointer],
|
438
|
+
:SDL_GL_SetSwapInterval => [:int],
|
439
|
+
:SDL_GL_GetSwapInterval => [],
|
440
|
+
:SDL_GL_SwapWindow => [:pointer],
|
441
|
+
:SDL_GL_DeleteContext => [:pointer],
|
442
|
+
}
|
443
|
+
retvals = {
|
444
|
+
:SDL_GetNumVideoDrivers => :int,
|
445
|
+
:SDL_GetVideoDriver => :pointer,
|
446
|
+
:SDL_VideoInit => :int,
|
447
|
+
:SDL_VideoQuit => :void,
|
448
|
+
:SDL_GetCurrentVideoDriver => :pointer,
|
449
|
+
:SDL_GetNumVideoDisplays => :int,
|
450
|
+
:SDL_GetDisplayName => :pointer,
|
451
|
+
:SDL_GetDisplayBounds => :int,
|
452
|
+
:SDL_GetDisplayUsableBounds => :int,
|
453
|
+
:SDL_GetDisplayDPI => :int,
|
454
|
+
:SDL_GetDisplayOrientation => :int,
|
455
|
+
:SDL_GetNumDisplayModes => :int,
|
456
|
+
:SDL_GetDisplayMode => :int,
|
457
|
+
:SDL_GetDesktopDisplayMode => :int,
|
458
|
+
:SDL_GetCurrentDisplayMode => :int,
|
459
|
+
:SDL_GetClosestDisplayMode => :pointer,
|
460
|
+
:SDL_GetPointDisplayIndex => :int,
|
461
|
+
:SDL_GetRectDisplayIndex => :int,
|
462
|
+
:SDL_GetWindowDisplayIndex => :int,
|
463
|
+
:SDL_SetWindowDisplayMode => :int,
|
464
|
+
:SDL_GetWindowDisplayMode => :int,
|
465
|
+
:SDL_GetWindowICCProfile => :pointer,
|
466
|
+
:SDL_GetWindowPixelFormat => :uint,
|
467
|
+
:SDL_CreateWindow => :pointer,
|
468
|
+
:SDL_CreateWindowFrom => :pointer,
|
469
|
+
:SDL_GetWindowID => :uint,
|
470
|
+
:SDL_GetWindowFromID => :pointer,
|
471
|
+
:SDL_GetWindowFlags => :uint,
|
472
|
+
:SDL_SetWindowTitle => :void,
|
473
|
+
:SDL_GetWindowTitle => :pointer,
|
474
|
+
:SDL_SetWindowIcon => :void,
|
475
|
+
:SDL_SetWindowData => :pointer,
|
476
|
+
:SDL_GetWindowData => :pointer,
|
477
|
+
:SDL_SetWindowPosition => :void,
|
478
|
+
:SDL_GetWindowPosition => :void,
|
479
|
+
:SDL_SetWindowSize => :void,
|
480
|
+
:SDL_GetWindowSize => :void,
|
481
|
+
:SDL_GetWindowBordersSize => :int,
|
482
|
+
:SDL_SetWindowMinimumSize => :void,
|
483
|
+
:SDL_GetWindowMinimumSize => :void,
|
484
|
+
:SDL_SetWindowMaximumSize => :void,
|
485
|
+
:SDL_GetWindowMaximumSize => :void,
|
486
|
+
:SDL_SetWindowBordered => :void,
|
487
|
+
:SDL_SetWindowResizable => :void,
|
488
|
+
:SDL_SetWindowAlwaysOnTop => :void,
|
489
|
+
:SDL_ShowWindow => :void,
|
490
|
+
:SDL_HideWindow => :void,
|
491
|
+
:SDL_RaiseWindow => :void,
|
492
|
+
:SDL_MaximizeWindow => :void,
|
493
|
+
:SDL_MinimizeWindow => :void,
|
494
|
+
:SDL_RestoreWindow => :void,
|
495
|
+
:SDL_SetWindowFullscreen => :int,
|
496
|
+
:SDL_GetWindowSurface => :pointer,
|
497
|
+
:SDL_UpdateWindowSurface => :int,
|
498
|
+
:SDL_UpdateWindowSurfaceRects => :int,
|
499
|
+
:SDL_SetWindowGrab => :void,
|
500
|
+
:SDL_SetWindowKeyboardGrab => :void,
|
501
|
+
:SDL_SetWindowMouseGrab => :void,
|
502
|
+
:SDL_GetWindowGrab => :int,
|
503
|
+
:SDL_GetWindowKeyboardGrab => :int,
|
504
|
+
:SDL_GetWindowMouseGrab => :int,
|
505
|
+
:SDL_GetGrabbedWindow => :pointer,
|
506
|
+
:SDL_SetWindowMouseRect => :int,
|
507
|
+
:SDL_GetWindowMouseRect => :pointer,
|
508
|
+
:SDL_SetWindowBrightness => :int,
|
509
|
+
:SDL_GetWindowBrightness => :float,
|
510
|
+
:SDL_SetWindowOpacity => :int,
|
511
|
+
:SDL_GetWindowOpacity => :int,
|
512
|
+
:SDL_SetWindowModalFor => :int,
|
513
|
+
:SDL_SetWindowInputFocus => :int,
|
514
|
+
:SDL_SetWindowGammaRamp => :int,
|
515
|
+
:SDL_GetWindowGammaRamp => :int,
|
516
|
+
:SDL_SetWindowHitTest => :int,
|
517
|
+
:SDL_FlashWindow => :int,
|
518
|
+
:SDL_DestroyWindow => :void,
|
519
|
+
:SDL_IsScreenSaverEnabled => :int,
|
520
|
+
:SDL_EnableScreenSaver => :void,
|
521
|
+
:SDL_DisableScreenSaver => :void,
|
522
|
+
:SDL_GL_LoadLibrary => :int,
|
523
|
+
:SDL_GL_GetProcAddress => :pointer,
|
524
|
+
:SDL_GL_UnloadLibrary => :void,
|
525
|
+
:SDL_GL_ExtensionSupported => :int,
|
526
|
+
:SDL_GL_ResetAttributes => :void,
|
527
|
+
:SDL_GL_SetAttribute => :int,
|
528
|
+
:SDL_GL_GetAttribute => :int,
|
529
|
+
:SDL_GL_CreateContext => :pointer,
|
530
|
+
:SDL_GL_MakeCurrent => :int,
|
531
|
+
:SDL_GL_GetCurrentWindow => :pointer,
|
532
|
+
:SDL_GL_GetCurrentContext => :pointer,
|
533
|
+
:SDL_GL_GetDrawableSize => :void,
|
534
|
+
:SDL_GL_SetSwapInterval => :int,
|
535
|
+
:SDL_GL_GetSwapInterval => :int,
|
536
|
+
:SDL_GL_SwapWindow => :void,
|
537
|
+
:SDL_GL_DeleteContext => :void,
|
538
|
+
}
|
539
|
+
symbols.each do |sym|
|
540
|
+
begin
|
541
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
542
|
+
rescue FFI::NotFoundError => error
|
543
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
544
|
+
end
|
545
|
+
end
|
546
|
+
end
|
547
|
+
|
548
|
+
end
|
549
|
+
|