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_video.rb
CHANGED
@@ -1,446 +1,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
|
10
|
-
extend FFI::Library
|
11
|
-
# Define/Macro
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
# Enum
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
# Typedef
|
123
|
-
|
124
|
-
typedef :int, :SDL_WindowFlags
|
125
|
-
typedef :int, :SDL_WindowEventID
|
126
|
-
typedef :int, :SDL_DisplayEventID
|
127
|
-
typedef :int, :SDL_DisplayOrientation
|
128
|
-
typedef :int, :SDL_FlashOperation
|
129
|
-
typedef :pointer, :SDL_GLContext
|
130
|
-
typedef :int, :SDL_GLattr
|
131
|
-
typedef :int, :SDL_GLprofile
|
132
|
-
typedef :int, :SDL_GLcontextFlag
|
133
|
-
typedef :int, :SDL_GLcontextReleaseFlag
|
134
|
-
typedef :int, :SDL_GLContextResetNotification
|
135
|
-
typedef :int, :SDL_HitTestResult
|
136
|
-
callback :SDL_HitTest, [:pointer, :pointer, :pointer], :int
|
137
|
-
|
138
|
-
# Struct
|
139
|
-
|
140
|
-
class
|
141
|
-
layout(
|
142
|
-
:format, :uint,
|
143
|
-
:w, :int,
|
144
|
-
:h, :int,
|
145
|
-
:refresh_rate, :int,
|
146
|
-
:driverdata, :pointer,
|
147
|
-
)
|
148
|
-
end
|
149
|
-
|
150
|
-
|
151
|
-
# Function
|
152
|
-
|
153
|
-
def self.setup_video_symbols()
|
154
|
-
symbols = [
|
155
|
-
:SDL_GetNumVideoDrivers,
|
156
|
-
:SDL_GetVideoDriver,
|
157
|
-
:SDL_VideoInit,
|
158
|
-
:SDL_VideoQuit,
|
159
|
-
:SDL_GetCurrentVideoDriver,
|
160
|
-
:SDL_GetNumVideoDisplays,
|
161
|
-
:SDL_GetDisplayName,
|
162
|
-
:SDL_GetDisplayBounds,
|
163
|
-
:SDL_GetDisplayUsableBounds,
|
164
|
-
:SDL_GetDisplayDPI,
|
165
|
-
:SDL_GetDisplayOrientation,
|
166
|
-
:SDL_GetNumDisplayModes,
|
167
|
-
:SDL_GetDisplayMode,
|
168
|
-
:SDL_GetDesktopDisplayMode,
|
169
|
-
:SDL_GetCurrentDisplayMode,
|
170
|
-
:SDL_GetClosestDisplayMode,
|
171
|
-
:SDL_GetWindowDisplayIndex,
|
172
|
-
:SDL_SetWindowDisplayMode,
|
173
|
-
:SDL_GetWindowDisplayMode,
|
174
|
-
:SDL_GetWindowICCProfile,
|
175
|
-
:SDL_GetWindowPixelFormat,
|
176
|
-
:SDL_CreateWindow,
|
177
|
-
:SDL_CreateWindowFrom,
|
178
|
-
:SDL_GetWindowID,
|
179
|
-
:SDL_GetWindowFromID,
|
180
|
-
:SDL_GetWindowFlags,
|
181
|
-
:SDL_SetWindowTitle,
|
182
|
-
:SDL_GetWindowTitle,
|
183
|
-
:SDL_SetWindowIcon,
|
184
|
-
:SDL_SetWindowData,
|
185
|
-
:SDL_GetWindowData,
|
186
|
-
:SDL_SetWindowPosition,
|
187
|
-
:SDL_GetWindowPosition,
|
188
|
-
:SDL_SetWindowSize,
|
189
|
-
:SDL_GetWindowSize,
|
190
|
-
:SDL_GetWindowBordersSize,
|
191
|
-
:SDL_SetWindowMinimumSize,
|
192
|
-
:SDL_GetWindowMinimumSize,
|
193
|
-
:SDL_SetWindowMaximumSize,
|
194
|
-
:SDL_GetWindowMaximumSize,
|
195
|
-
:SDL_SetWindowBordered,
|
196
|
-
:SDL_SetWindowResizable,
|
197
|
-
:SDL_SetWindowAlwaysOnTop,
|
198
|
-
:SDL_ShowWindow,
|
199
|
-
:SDL_HideWindow,
|
200
|
-
:SDL_RaiseWindow,
|
201
|
-
:SDL_MaximizeWindow,
|
202
|
-
:SDL_MinimizeWindow,
|
203
|
-
:SDL_RestoreWindow,
|
204
|
-
:SDL_SetWindowFullscreen,
|
205
|
-
:SDL_GetWindowSurface,
|
206
|
-
:SDL_UpdateWindowSurface,
|
207
|
-
:SDL_UpdateWindowSurfaceRects,
|
208
|
-
:SDL_SetWindowGrab,
|
209
|
-
:SDL_SetWindowKeyboardGrab,
|
210
|
-
:SDL_SetWindowMouseGrab,
|
211
|
-
:SDL_GetWindowGrab,
|
212
|
-
:SDL_GetWindowKeyboardGrab,
|
213
|
-
:SDL_GetWindowMouseGrab,
|
214
|
-
:SDL_GetGrabbedWindow,
|
215
|
-
:SDL_SetWindowMouseRect,
|
216
|
-
:SDL_GetWindowMouseRect,
|
217
|
-
:SDL_SetWindowBrightness,
|
218
|
-
:SDL_GetWindowBrightness,
|
219
|
-
:SDL_SetWindowOpacity,
|
220
|
-
:SDL_GetWindowOpacity,
|
221
|
-
:SDL_SetWindowModalFor,
|
222
|
-
:SDL_SetWindowInputFocus,
|
223
|
-
:SDL_SetWindowGammaRamp,
|
224
|
-
:SDL_GetWindowGammaRamp,
|
225
|
-
:SDL_SetWindowHitTest,
|
226
|
-
:SDL_FlashWindow,
|
227
|
-
:SDL_DestroyWindow,
|
228
|
-
:SDL_IsScreenSaverEnabled,
|
229
|
-
:SDL_EnableScreenSaver,
|
230
|
-
:SDL_DisableScreenSaver,
|
231
|
-
:SDL_GL_LoadLibrary,
|
232
|
-
:SDL_GL_GetProcAddress,
|
233
|
-
:SDL_GL_UnloadLibrary,
|
234
|
-
:SDL_GL_ExtensionSupported,
|
235
|
-
:SDL_GL_ResetAttributes,
|
236
|
-
:SDL_GL_SetAttribute,
|
237
|
-
:SDL_GL_GetAttribute,
|
238
|
-
:SDL_GL_CreateContext,
|
239
|
-
:SDL_GL_MakeCurrent,
|
240
|
-
:SDL_GL_GetCurrentWindow,
|
241
|
-
:SDL_GL_GetCurrentContext,
|
242
|
-
:SDL_GL_GetDrawableSize,
|
243
|
-
:SDL_GL_SetSwapInterval,
|
244
|
-
:SDL_GL_GetSwapInterval,
|
245
|
-
:SDL_GL_SwapWindow,
|
246
|
-
:SDL_GL_DeleteContext,
|
247
|
-
]
|
248
|
-
|
249
|
-
:SDL_GetNumVideoDrivers =>
|
250
|
-
:SDL_GetVideoDriver =>
|
251
|
-
:SDL_VideoInit =>
|
252
|
-
:SDL_VideoQuit =>
|
253
|
-
:SDL_GetCurrentVideoDriver =>
|
254
|
-
:SDL_GetNumVideoDisplays =>
|
255
|
-
:SDL_GetDisplayName =>
|
256
|
-
:SDL_GetDisplayBounds =>
|
257
|
-
:SDL_GetDisplayUsableBounds =>
|
258
|
-
:SDL_GetDisplayDPI =>
|
259
|
-
:SDL_GetDisplayOrientation =>
|
260
|
-
:SDL_GetNumDisplayModes =>
|
261
|
-
:SDL_GetDisplayMode =>
|
262
|
-
:SDL_GetDesktopDisplayMode =>
|
263
|
-
:SDL_GetCurrentDisplayMode =>
|
264
|
-
:SDL_GetClosestDisplayMode =>
|
265
|
-
:SDL_GetWindowDisplayIndex =>
|
266
|
-
:SDL_SetWindowDisplayMode =>
|
267
|
-
:SDL_GetWindowDisplayMode =>
|
268
|
-
:SDL_GetWindowICCProfile =>
|
269
|
-
:SDL_GetWindowPixelFormat =>
|
270
|
-
:SDL_CreateWindow =>
|
271
|
-
:SDL_CreateWindowFrom =>
|
272
|
-
:SDL_GetWindowID =>
|
273
|
-
:SDL_GetWindowFromID =>
|
274
|
-
:SDL_GetWindowFlags =>
|
275
|
-
:SDL_SetWindowTitle =>
|
276
|
-
:SDL_GetWindowTitle =>
|
277
|
-
:SDL_SetWindowIcon =>
|
278
|
-
:SDL_SetWindowData =>
|
279
|
-
:SDL_GetWindowData =>
|
280
|
-
:SDL_SetWindowPosition =>
|
281
|
-
:SDL_GetWindowPosition =>
|
282
|
-
:SDL_SetWindowSize =>
|
283
|
-
:SDL_GetWindowSize =>
|
284
|
-
:SDL_GetWindowBordersSize =>
|
285
|
-
:SDL_SetWindowMinimumSize =>
|
286
|
-
:SDL_GetWindowMinimumSize =>
|
287
|
-
:SDL_SetWindowMaximumSize =>
|
288
|
-
:SDL_GetWindowMaximumSize =>
|
289
|
-
:SDL_SetWindowBordered =>
|
290
|
-
:SDL_SetWindowResizable =>
|
291
|
-
:SDL_SetWindowAlwaysOnTop =>
|
292
|
-
:SDL_ShowWindow =>
|
293
|
-
:SDL_HideWindow =>
|
294
|
-
:SDL_RaiseWindow =>
|
295
|
-
:SDL_MaximizeWindow =>
|
296
|
-
:SDL_MinimizeWindow =>
|
297
|
-
:SDL_RestoreWindow =>
|
298
|
-
:SDL_SetWindowFullscreen =>
|
299
|
-
:SDL_GetWindowSurface =>
|
300
|
-
:SDL_UpdateWindowSurface =>
|
301
|
-
:SDL_UpdateWindowSurfaceRects =>
|
302
|
-
:SDL_SetWindowGrab =>
|
303
|
-
:SDL_SetWindowKeyboardGrab =>
|
304
|
-
:SDL_SetWindowMouseGrab =>
|
305
|
-
:SDL_GetWindowGrab =>
|
306
|
-
:SDL_GetWindowKeyboardGrab =>
|
307
|
-
:SDL_GetWindowMouseGrab =>
|
308
|
-
:SDL_GetGrabbedWindow =>
|
309
|
-
:SDL_SetWindowMouseRect =>
|
310
|
-
:SDL_GetWindowMouseRect =>
|
311
|
-
:SDL_SetWindowBrightness =>
|
312
|
-
:SDL_GetWindowBrightness =>
|
313
|
-
:SDL_SetWindowOpacity =>
|
314
|
-
:SDL_GetWindowOpacity =>
|
315
|
-
:SDL_SetWindowModalFor =>
|
316
|
-
:SDL_SetWindowInputFocus =>
|
317
|
-
:SDL_SetWindowGammaRamp =>
|
318
|
-
:SDL_GetWindowGammaRamp =>
|
319
|
-
:SDL_SetWindowHitTest =>
|
320
|
-
:SDL_FlashWindow =>
|
321
|
-
:SDL_DestroyWindow =>
|
322
|
-
:SDL_IsScreenSaverEnabled =>
|
323
|
-
:SDL_EnableScreenSaver =>
|
324
|
-
:SDL_DisableScreenSaver =>
|
325
|
-
:SDL_GL_LoadLibrary =>
|
326
|
-
:SDL_GL_GetProcAddress =>
|
327
|
-
:SDL_GL_UnloadLibrary =>
|
328
|
-
:SDL_GL_ExtensionSupported =>
|
329
|
-
:SDL_GL_ResetAttributes =>
|
330
|
-
:SDL_GL_SetAttribute =>
|
331
|
-
:SDL_GL_GetAttribute =>
|
332
|
-
:SDL_GL_CreateContext =>
|
333
|
-
:SDL_GL_MakeCurrent =>
|
334
|
-
:SDL_GL_GetCurrentWindow =>
|
335
|
-
:SDL_GL_GetCurrentContext =>
|
336
|
-
:SDL_GL_GetDrawableSize =>
|
337
|
-
:SDL_GL_SetSwapInterval =>
|
338
|
-
:SDL_GL_GetSwapInterval =>
|
339
|
-
:SDL_GL_SwapWindow =>
|
340
|
-
:SDL_GL_DeleteContext =>
|
341
|
-
}
|
342
|
-
|
343
|
-
:SDL_GetNumVideoDrivers =>
|
344
|
-
:SDL_GetVideoDriver => :
|
345
|
-
:SDL_VideoInit => :
|
346
|
-
:SDL_VideoQuit =>
|
347
|
-
:SDL_GetCurrentVideoDriver =>
|
348
|
-
:SDL_GetNumVideoDisplays =>
|
349
|
-
:SDL_GetDisplayName => :
|
350
|
-
:SDL_GetDisplayBounds => :int,
|
351
|
-
:SDL_GetDisplayUsableBounds => :int,
|
352
|
-
:SDL_GetDisplayDPI => :int,
|
353
|
-
:SDL_GetDisplayOrientation => :int,
|
354
|
-
:SDL_GetNumDisplayModes => :int,
|
355
|
-
:SDL_GetDisplayMode => :int,
|
356
|
-
:SDL_GetDesktopDisplayMode => :int,
|
357
|
-
:SDL_GetCurrentDisplayMode => :int,
|
358
|
-
:SDL_GetClosestDisplayMode => :pointer,
|
359
|
-
:SDL_GetWindowDisplayIndex => :
|
360
|
-
:SDL_SetWindowDisplayMode => :
|
361
|
-
:SDL_GetWindowDisplayMode => :
|
362
|
-
:SDL_GetWindowICCProfile => :pointer,
|
363
|
-
:SDL_GetWindowPixelFormat => :
|
364
|
-
:SDL_CreateWindow => :pointer,
|
365
|
-
:SDL_CreateWindowFrom => :pointer,
|
366
|
-
:SDL_GetWindowID => :
|
367
|
-
:SDL_GetWindowFromID => :
|
368
|
-
:SDL_GetWindowFlags => :
|
369
|
-
:SDL_SetWindowTitle => :
|
370
|
-
:SDL_GetWindowTitle => :pointer,
|
371
|
-
:SDL_SetWindowIcon => :
|
372
|
-
:SDL_SetWindowData => :pointer,
|
373
|
-
:SDL_GetWindowData => :pointer,
|
374
|
-
:SDL_SetWindowPosition => :
|
375
|
-
:SDL_GetWindowPosition => :
|
376
|
-
:SDL_SetWindowSize => :
|
377
|
-
:SDL_GetWindowSize => :
|
378
|
-
:SDL_GetWindowBordersSize => :
|
379
|
-
:SDL_SetWindowMinimumSize => :
|
380
|
-
:SDL_GetWindowMinimumSize => :
|
381
|
-
:SDL_SetWindowMaximumSize => :
|
382
|
-
:SDL_GetWindowMaximumSize => :
|
383
|
-
:SDL_SetWindowBordered => :
|
384
|
-
:SDL_SetWindowResizable => :
|
385
|
-
:SDL_SetWindowAlwaysOnTop => :
|
386
|
-
:SDL_ShowWindow => :
|
387
|
-
:SDL_HideWindow => :
|
388
|
-
:SDL_RaiseWindow => :
|
389
|
-
:SDL_MaximizeWindow => :
|
390
|
-
:SDL_MinimizeWindow => :
|
391
|
-
:SDL_RestoreWindow => :
|
392
|
-
:SDL_SetWindowFullscreen => :
|
393
|
-
:SDL_GetWindowSurface => :pointer,
|
394
|
-
:SDL_UpdateWindowSurface => :
|
395
|
-
:SDL_UpdateWindowSurfaceRects => :int,
|
396
|
-
:SDL_SetWindowGrab => :
|
397
|
-
:SDL_SetWindowKeyboardGrab => :
|
398
|
-
:SDL_SetWindowMouseGrab => :
|
399
|
-
:SDL_GetWindowGrab => :
|
400
|
-
:SDL_GetWindowKeyboardGrab => :
|
401
|
-
:SDL_GetWindowMouseGrab => :
|
402
|
-
:SDL_GetGrabbedWindow =>
|
403
|
-
:SDL_SetWindowMouseRect => :
|
404
|
-
:SDL_GetWindowMouseRect => :pointer,
|
405
|
-
:SDL_SetWindowBrightness => :
|
406
|
-
:SDL_GetWindowBrightness => :
|
407
|
-
:SDL_SetWindowOpacity => :
|
408
|
-
:SDL_GetWindowOpacity => :
|
409
|
-
:SDL_SetWindowModalFor => :
|
410
|
-
:SDL_SetWindowInputFocus => :
|
411
|
-
:SDL_SetWindowGammaRamp => :
|
412
|
-
:SDL_GetWindowGammaRamp => :
|
413
|
-
:SDL_SetWindowHitTest => :
|
414
|
-
:SDL_FlashWindow => :int,
|
415
|
-
:SDL_DestroyWindow => :
|
416
|
-
:SDL_IsScreenSaverEnabled =>
|
417
|
-
:SDL_EnableScreenSaver =>
|
418
|
-
:SDL_DisableScreenSaver =>
|
419
|
-
:SDL_GL_LoadLibrary => :
|
420
|
-
:SDL_GL_GetProcAddress => :pointer,
|
421
|
-
:SDL_GL_UnloadLibrary =>
|
422
|
-
:SDL_GL_ExtensionSupported => :
|
423
|
-
:SDL_GL_ResetAttributes =>
|
424
|
-
:SDL_GL_SetAttribute => :int,
|
425
|
-
:SDL_GL_GetAttribute => :int,
|
426
|
-
:SDL_GL_CreateContext => :pointer,
|
427
|
-
:SDL_GL_MakeCurrent => :
|
428
|
-
:SDL_GL_GetCurrentWindow =>
|
429
|
-
:SDL_GL_GetCurrentContext =>
|
430
|
-
:SDL_GL_GetDrawableSize => :
|
431
|
-
:SDL_GL_SetSwapInterval => :int,
|
432
|
-
:SDL_GL_GetSwapInterval =>
|
433
|
-
:SDL_GL_SwapWindow => :
|
434
|
-
:SDL_GL_DeleteContext => :
|
435
|
-
}
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
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_CONTEXT_PROFILE_CORE = 1
|
101
|
+
GL_CONTEXT_PROFILE_COMPATIBILITY = 2
|
102
|
+
GL_CONTEXT_PROFILE_ES = 4
|
103
|
+
GL_CONTEXT_DEBUG_FLAG = 1
|
104
|
+
GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 2
|
105
|
+
GL_CONTEXT_ROBUST_ACCESS_FLAG = 4
|
106
|
+
GL_CONTEXT_RESET_ISOLATION_FLAG = 8
|
107
|
+
GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0
|
108
|
+
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 1
|
109
|
+
GL_CONTEXT_RESET_NO_NOTIFICATION = 0
|
110
|
+
GL_CONTEXT_RESET_LOSE_CONTEXT = 1
|
111
|
+
HITTEST_NORMAL = 0
|
112
|
+
HITTEST_DRAGGABLE = 1
|
113
|
+
HITTEST_RESIZE_TOPLEFT = 2
|
114
|
+
HITTEST_RESIZE_TOP = 3
|
115
|
+
HITTEST_RESIZE_TOPRIGHT = 4
|
116
|
+
HITTEST_RESIZE_RIGHT = 5
|
117
|
+
HITTEST_RESIZE_BOTTOMRIGHT = 6
|
118
|
+
HITTEST_RESIZE_BOTTOM = 7
|
119
|
+
HITTEST_RESIZE_BOTTOMLEFT = 8
|
120
|
+
HITTEST_RESIZE_LEFT = 9
|
121
|
+
|
122
|
+
# Typedef
|
123
|
+
|
124
|
+
typedef :int, :SDL_WindowFlags
|
125
|
+
typedef :int, :SDL_WindowEventID
|
126
|
+
typedef :int, :SDL_DisplayEventID
|
127
|
+
typedef :int, :SDL_DisplayOrientation
|
128
|
+
typedef :int, :SDL_FlashOperation
|
129
|
+
typedef :pointer, :SDL_GLContext
|
130
|
+
typedef :int, :SDL_GLattr
|
131
|
+
typedef :int, :SDL_GLprofile
|
132
|
+
typedef :int, :SDL_GLcontextFlag
|
133
|
+
typedef :int, :SDL_GLcontextReleaseFlag
|
134
|
+
typedef :int, :SDL_GLContextResetNotification
|
135
|
+
typedef :int, :SDL_HitTestResult
|
136
|
+
callback :SDL_HitTest, [:pointer, :pointer, :pointer], :int
|
137
|
+
|
138
|
+
# Struct
|
139
|
+
|
140
|
+
class DisplayMode < FFI::Struct
|
141
|
+
layout(
|
142
|
+
:format, :uint,
|
143
|
+
:w, :int,
|
144
|
+
:h, :int,
|
145
|
+
:refresh_rate, :int,
|
146
|
+
:driverdata, :pointer,
|
147
|
+
)
|
148
|
+
end
|
149
|
+
|
150
|
+
|
151
|
+
# Function
|
152
|
+
|
153
|
+
def self.setup_video_symbols(output_error = false)
|
154
|
+
symbols = [
|
155
|
+
:SDL_GetNumVideoDrivers,
|
156
|
+
:SDL_GetVideoDriver,
|
157
|
+
:SDL_VideoInit,
|
158
|
+
:SDL_VideoQuit,
|
159
|
+
:SDL_GetCurrentVideoDriver,
|
160
|
+
:SDL_GetNumVideoDisplays,
|
161
|
+
:SDL_GetDisplayName,
|
162
|
+
:SDL_GetDisplayBounds,
|
163
|
+
:SDL_GetDisplayUsableBounds,
|
164
|
+
:SDL_GetDisplayDPI,
|
165
|
+
:SDL_GetDisplayOrientation,
|
166
|
+
:SDL_GetNumDisplayModes,
|
167
|
+
:SDL_GetDisplayMode,
|
168
|
+
:SDL_GetDesktopDisplayMode,
|
169
|
+
:SDL_GetCurrentDisplayMode,
|
170
|
+
:SDL_GetClosestDisplayMode,
|
171
|
+
:SDL_GetWindowDisplayIndex,
|
172
|
+
:SDL_SetWindowDisplayMode,
|
173
|
+
:SDL_GetWindowDisplayMode,
|
174
|
+
:SDL_GetWindowICCProfile,
|
175
|
+
:SDL_GetWindowPixelFormat,
|
176
|
+
:SDL_CreateWindow,
|
177
|
+
:SDL_CreateWindowFrom,
|
178
|
+
:SDL_GetWindowID,
|
179
|
+
:SDL_GetWindowFromID,
|
180
|
+
:SDL_GetWindowFlags,
|
181
|
+
:SDL_SetWindowTitle,
|
182
|
+
:SDL_GetWindowTitle,
|
183
|
+
:SDL_SetWindowIcon,
|
184
|
+
:SDL_SetWindowData,
|
185
|
+
:SDL_GetWindowData,
|
186
|
+
:SDL_SetWindowPosition,
|
187
|
+
:SDL_GetWindowPosition,
|
188
|
+
:SDL_SetWindowSize,
|
189
|
+
:SDL_GetWindowSize,
|
190
|
+
:SDL_GetWindowBordersSize,
|
191
|
+
:SDL_SetWindowMinimumSize,
|
192
|
+
:SDL_GetWindowMinimumSize,
|
193
|
+
:SDL_SetWindowMaximumSize,
|
194
|
+
:SDL_GetWindowMaximumSize,
|
195
|
+
:SDL_SetWindowBordered,
|
196
|
+
:SDL_SetWindowResizable,
|
197
|
+
:SDL_SetWindowAlwaysOnTop,
|
198
|
+
:SDL_ShowWindow,
|
199
|
+
:SDL_HideWindow,
|
200
|
+
:SDL_RaiseWindow,
|
201
|
+
:SDL_MaximizeWindow,
|
202
|
+
:SDL_MinimizeWindow,
|
203
|
+
:SDL_RestoreWindow,
|
204
|
+
:SDL_SetWindowFullscreen,
|
205
|
+
:SDL_GetWindowSurface,
|
206
|
+
:SDL_UpdateWindowSurface,
|
207
|
+
:SDL_UpdateWindowSurfaceRects,
|
208
|
+
:SDL_SetWindowGrab,
|
209
|
+
:SDL_SetWindowKeyboardGrab,
|
210
|
+
:SDL_SetWindowMouseGrab,
|
211
|
+
:SDL_GetWindowGrab,
|
212
|
+
:SDL_GetWindowKeyboardGrab,
|
213
|
+
:SDL_GetWindowMouseGrab,
|
214
|
+
:SDL_GetGrabbedWindow,
|
215
|
+
:SDL_SetWindowMouseRect,
|
216
|
+
:SDL_GetWindowMouseRect,
|
217
|
+
:SDL_SetWindowBrightness,
|
218
|
+
:SDL_GetWindowBrightness,
|
219
|
+
:SDL_SetWindowOpacity,
|
220
|
+
:SDL_GetWindowOpacity,
|
221
|
+
:SDL_SetWindowModalFor,
|
222
|
+
:SDL_SetWindowInputFocus,
|
223
|
+
:SDL_SetWindowGammaRamp,
|
224
|
+
:SDL_GetWindowGammaRamp,
|
225
|
+
:SDL_SetWindowHitTest,
|
226
|
+
:SDL_FlashWindow,
|
227
|
+
:SDL_DestroyWindow,
|
228
|
+
:SDL_IsScreenSaverEnabled,
|
229
|
+
:SDL_EnableScreenSaver,
|
230
|
+
:SDL_DisableScreenSaver,
|
231
|
+
:SDL_GL_LoadLibrary,
|
232
|
+
:SDL_GL_GetProcAddress,
|
233
|
+
:SDL_GL_UnloadLibrary,
|
234
|
+
:SDL_GL_ExtensionSupported,
|
235
|
+
:SDL_GL_ResetAttributes,
|
236
|
+
:SDL_GL_SetAttribute,
|
237
|
+
:SDL_GL_GetAttribute,
|
238
|
+
:SDL_GL_CreateContext,
|
239
|
+
:SDL_GL_MakeCurrent,
|
240
|
+
:SDL_GL_GetCurrentWindow,
|
241
|
+
:SDL_GL_GetCurrentContext,
|
242
|
+
:SDL_GL_GetDrawableSize,
|
243
|
+
:SDL_GL_SetSwapInterval,
|
244
|
+
:SDL_GL_GetSwapInterval,
|
245
|
+
:SDL_GL_SwapWindow,
|
246
|
+
:SDL_GL_DeleteContext,
|
247
|
+
]
|
248
|
+
apis = {
|
249
|
+
:SDL_GetNumVideoDrivers => :GetNumVideoDrivers,
|
250
|
+
:SDL_GetVideoDriver => :GetVideoDriver,
|
251
|
+
:SDL_VideoInit => :VideoInit,
|
252
|
+
:SDL_VideoQuit => :VideoQuit,
|
253
|
+
:SDL_GetCurrentVideoDriver => :GetCurrentVideoDriver,
|
254
|
+
:SDL_GetNumVideoDisplays => :GetNumVideoDisplays,
|
255
|
+
:SDL_GetDisplayName => :GetDisplayName,
|
256
|
+
:SDL_GetDisplayBounds => :GetDisplayBounds,
|
257
|
+
:SDL_GetDisplayUsableBounds => :GetDisplayUsableBounds,
|
258
|
+
:SDL_GetDisplayDPI => :GetDisplayDPI,
|
259
|
+
:SDL_GetDisplayOrientation => :GetDisplayOrientation,
|
260
|
+
:SDL_GetNumDisplayModes => :GetNumDisplayModes,
|
261
|
+
:SDL_GetDisplayMode => :GetDisplayMode,
|
262
|
+
:SDL_GetDesktopDisplayMode => :GetDesktopDisplayMode,
|
263
|
+
:SDL_GetCurrentDisplayMode => :GetCurrentDisplayMode,
|
264
|
+
:SDL_GetClosestDisplayMode => :GetClosestDisplayMode,
|
265
|
+
:SDL_GetWindowDisplayIndex => :GetWindowDisplayIndex,
|
266
|
+
:SDL_SetWindowDisplayMode => :SetWindowDisplayMode,
|
267
|
+
:SDL_GetWindowDisplayMode => :GetWindowDisplayMode,
|
268
|
+
:SDL_GetWindowICCProfile => :GetWindowICCProfile,
|
269
|
+
:SDL_GetWindowPixelFormat => :GetWindowPixelFormat,
|
270
|
+
:SDL_CreateWindow => :CreateWindow,
|
271
|
+
:SDL_CreateWindowFrom => :CreateWindowFrom,
|
272
|
+
:SDL_GetWindowID => :GetWindowID,
|
273
|
+
:SDL_GetWindowFromID => :GetWindowFromID,
|
274
|
+
:SDL_GetWindowFlags => :GetWindowFlags,
|
275
|
+
:SDL_SetWindowTitle => :SetWindowTitle,
|
276
|
+
:SDL_GetWindowTitle => :GetWindowTitle,
|
277
|
+
:SDL_SetWindowIcon => :SetWindowIcon,
|
278
|
+
:SDL_SetWindowData => :SetWindowData,
|
279
|
+
:SDL_GetWindowData => :GetWindowData,
|
280
|
+
:SDL_SetWindowPosition => :SetWindowPosition,
|
281
|
+
:SDL_GetWindowPosition => :GetWindowPosition,
|
282
|
+
:SDL_SetWindowSize => :SetWindowSize,
|
283
|
+
:SDL_GetWindowSize => :GetWindowSize,
|
284
|
+
:SDL_GetWindowBordersSize => :GetWindowBordersSize,
|
285
|
+
:SDL_SetWindowMinimumSize => :SetWindowMinimumSize,
|
286
|
+
:SDL_GetWindowMinimumSize => :GetWindowMinimumSize,
|
287
|
+
:SDL_SetWindowMaximumSize => :SetWindowMaximumSize,
|
288
|
+
:SDL_GetWindowMaximumSize => :GetWindowMaximumSize,
|
289
|
+
:SDL_SetWindowBordered => :SetWindowBordered,
|
290
|
+
:SDL_SetWindowResizable => :SetWindowResizable,
|
291
|
+
:SDL_SetWindowAlwaysOnTop => :SetWindowAlwaysOnTop,
|
292
|
+
:SDL_ShowWindow => :ShowWindow,
|
293
|
+
:SDL_HideWindow => :HideWindow,
|
294
|
+
:SDL_RaiseWindow => :RaiseWindow,
|
295
|
+
:SDL_MaximizeWindow => :MaximizeWindow,
|
296
|
+
:SDL_MinimizeWindow => :MinimizeWindow,
|
297
|
+
:SDL_RestoreWindow => :RestoreWindow,
|
298
|
+
:SDL_SetWindowFullscreen => :SetWindowFullscreen,
|
299
|
+
:SDL_GetWindowSurface => :GetWindowSurface,
|
300
|
+
:SDL_UpdateWindowSurface => :UpdateWindowSurface,
|
301
|
+
:SDL_UpdateWindowSurfaceRects => :UpdateWindowSurfaceRects,
|
302
|
+
:SDL_SetWindowGrab => :SetWindowGrab,
|
303
|
+
:SDL_SetWindowKeyboardGrab => :SetWindowKeyboardGrab,
|
304
|
+
:SDL_SetWindowMouseGrab => :SetWindowMouseGrab,
|
305
|
+
:SDL_GetWindowGrab => :GetWindowGrab,
|
306
|
+
:SDL_GetWindowKeyboardGrab => :GetWindowKeyboardGrab,
|
307
|
+
:SDL_GetWindowMouseGrab => :GetWindowMouseGrab,
|
308
|
+
:SDL_GetGrabbedWindow => :GetGrabbedWindow,
|
309
|
+
:SDL_SetWindowMouseRect => :SetWindowMouseRect,
|
310
|
+
:SDL_GetWindowMouseRect => :GetWindowMouseRect,
|
311
|
+
:SDL_SetWindowBrightness => :SetWindowBrightness,
|
312
|
+
:SDL_GetWindowBrightness => :GetWindowBrightness,
|
313
|
+
:SDL_SetWindowOpacity => :SetWindowOpacity,
|
314
|
+
:SDL_GetWindowOpacity => :GetWindowOpacity,
|
315
|
+
:SDL_SetWindowModalFor => :SetWindowModalFor,
|
316
|
+
:SDL_SetWindowInputFocus => :SetWindowInputFocus,
|
317
|
+
:SDL_SetWindowGammaRamp => :SetWindowGammaRamp,
|
318
|
+
:SDL_GetWindowGammaRamp => :GetWindowGammaRamp,
|
319
|
+
:SDL_SetWindowHitTest => :SetWindowHitTest,
|
320
|
+
:SDL_FlashWindow => :FlashWindow,
|
321
|
+
:SDL_DestroyWindow => :DestroyWindow,
|
322
|
+
:SDL_IsScreenSaverEnabled => :IsScreenSaverEnabled,
|
323
|
+
:SDL_EnableScreenSaver => :EnableScreenSaver,
|
324
|
+
:SDL_DisableScreenSaver => :DisableScreenSaver,
|
325
|
+
:SDL_GL_LoadLibrary => :GL_LoadLibrary,
|
326
|
+
:SDL_GL_GetProcAddress => :GL_GetProcAddress,
|
327
|
+
:SDL_GL_UnloadLibrary => :GL_UnloadLibrary,
|
328
|
+
:SDL_GL_ExtensionSupported => :GL_ExtensionSupported,
|
329
|
+
:SDL_GL_ResetAttributes => :GL_ResetAttributes,
|
330
|
+
:SDL_GL_SetAttribute => :GL_SetAttribute,
|
331
|
+
:SDL_GL_GetAttribute => :GL_GetAttribute,
|
332
|
+
:SDL_GL_CreateContext => :GL_CreateContext,
|
333
|
+
:SDL_GL_MakeCurrent => :GL_MakeCurrent,
|
334
|
+
:SDL_GL_GetCurrentWindow => :GL_GetCurrentWindow,
|
335
|
+
:SDL_GL_GetCurrentContext => :GL_GetCurrentContext,
|
336
|
+
:SDL_GL_GetDrawableSize => :GL_GetDrawableSize,
|
337
|
+
:SDL_GL_SetSwapInterval => :GL_SetSwapInterval,
|
338
|
+
:SDL_GL_GetSwapInterval => :GL_GetSwapInterval,
|
339
|
+
:SDL_GL_SwapWindow => :GL_SwapWindow,
|
340
|
+
:SDL_GL_DeleteContext => :GL_DeleteContext,
|
341
|
+
}
|
342
|
+
args = {
|
343
|
+
:SDL_GetNumVideoDrivers => [],
|
344
|
+
:SDL_GetVideoDriver => [:int],
|
345
|
+
:SDL_VideoInit => [:pointer],
|
346
|
+
:SDL_VideoQuit => [],
|
347
|
+
:SDL_GetCurrentVideoDriver => [],
|
348
|
+
:SDL_GetNumVideoDisplays => [],
|
349
|
+
:SDL_GetDisplayName => [:int],
|
350
|
+
:SDL_GetDisplayBounds => [:int, :pointer],
|
351
|
+
:SDL_GetDisplayUsableBounds => [:int, :pointer],
|
352
|
+
:SDL_GetDisplayDPI => [:int, :pointer, :pointer, :pointer],
|
353
|
+
:SDL_GetDisplayOrientation => [:int],
|
354
|
+
:SDL_GetNumDisplayModes => [:int],
|
355
|
+
:SDL_GetDisplayMode => [:int, :int, :pointer],
|
356
|
+
:SDL_GetDesktopDisplayMode => [:int, :pointer],
|
357
|
+
:SDL_GetCurrentDisplayMode => [:int, :pointer],
|
358
|
+
:SDL_GetClosestDisplayMode => [:int, :pointer, :pointer],
|
359
|
+
:SDL_GetWindowDisplayIndex => [:pointer],
|
360
|
+
:SDL_SetWindowDisplayMode => [:pointer, :pointer],
|
361
|
+
:SDL_GetWindowDisplayMode => [:pointer, :pointer],
|
362
|
+
:SDL_GetWindowICCProfile => [:pointer, :pointer],
|
363
|
+
:SDL_GetWindowPixelFormat => [:pointer],
|
364
|
+
:SDL_CreateWindow => [:pointer, :int, :int, :int, :int, :uint],
|
365
|
+
:SDL_CreateWindowFrom => [:pointer],
|
366
|
+
:SDL_GetWindowID => [:pointer],
|
367
|
+
:SDL_GetWindowFromID => [:uint],
|
368
|
+
:SDL_GetWindowFlags => [:pointer],
|
369
|
+
:SDL_SetWindowTitle => [:pointer, :pointer],
|
370
|
+
:SDL_GetWindowTitle => [:pointer],
|
371
|
+
:SDL_SetWindowIcon => [:pointer, :pointer],
|
372
|
+
:SDL_SetWindowData => [:pointer, :pointer, :pointer],
|
373
|
+
:SDL_GetWindowData => [:pointer, :pointer],
|
374
|
+
:SDL_SetWindowPosition => [:pointer, :int, :int],
|
375
|
+
:SDL_GetWindowPosition => [:pointer, :pointer, :pointer],
|
376
|
+
:SDL_SetWindowSize => [:pointer, :int, :int],
|
377
|
+
:SDL_GetWindowSize => [:pointer, :pointer, :pointer],
|
378
|
+
:SDL_GetWindowBordersSize => [:pointer, :pointer, :pointer, :pointer, :pointer],
|
379
|
+
:SDL_SetWindowMinimumSize => [:pointer, :int, :int],
|
380
|
+
:SDL_GetWindowMinimumSize => [:pointer, :pointer, :pointer],
|
381
|
+
:SDL_SetWindowMaximumSize => [:pointer, :int, :int],
|
382
|
+
:SDL_GetWindowMaximumSize => [:pointer, :pointer, :pointer],
|
383
|
+
:SDL_SetWindowBordered => [:pointer, :int],
|
384
|
+
:SDL_SetWindowResizable => [:pointer, :int],
|
385
|
+
:SDL_SetWindowAlwaysOnTop => [:pointer, :int],
|
386
|
+
:SDL_ShowWindow => [:pointer],
|
387
|
+
:SDL_HideWindow => [:pointer],
|
388
|
+
:SDL_RaiseWindow => [:pointer],
|
389
|
+
:SDL_MaximizeWindow => [:pointer],
|
390
|
+
:SDL_MinimizeWindow => [:pointer],
|
391
|
+
:SDL_RestoreWindow => [:pointer],
|
392
|
+
:SDL_SetWindowFullscreen => [:pointer, :uint],
|
393
|
+
:SDL_GetWindowSurface => [:pointer],
|
394
|
+
:SDL_UpdateWindowSurface => [:pointer],
|
395
|
+
:SDL_UpdateWindowSurfaceRects => [:pointer, :pointer, :int],
|
396
|
+
:SDL_SetWindowGrab => [:pointer, :int],
|
397
|
+
:SDL_SetWindowKeyboardGrab => [:pointer, :int],
|
398
|
+
:SDL_SetWindowMouseGrab => [:pointer, :int],
|
399
|
+
:SDL_GetWindowGrab => [:pointer],
|
400
|
+
:SDL_GetWindowKeyboardGrab => [:pointer],
|
401
|
+
:SDL_GetWindowMouseGrab => [:pointer],
|
402
|
+
:SDL_GetGrabbedWindow => [],
|
403
|
+
:SDL_SetWindowMouseRect => [:pointer, :pointer],
|
404
|
+
:SDL_GetWindowMouseRect => [:pointer],
|
405
|
+
:SDL_SetWindowBrightness => [:pointer, :float],
|
406
|
+
:SDL_GetWindowBrightness => [:pointer],
|
407
|
+
:SDL_SetWindowOpacity => [:pointer, :float],
|
408
|
+
:SDL_GetWindowOpacity => [:pointer, :pointer],
|
409
|
+
:SDL_SetWindowModalFor => [:pointer, :pointer],
|
410
|
+
:SDL_SetWindowInputFocus => [:pointer],
|
411
|
+
:SDL_SetWindowGammaRamp => [:pointer, :pointer, :pointer, :pointer],
|
412
|
+
:SDL_GetWindowGammaRamp => [:pointer, :pointer, :pointer, :pointer],
|
413
|
+
:SDL_SetWindowHitTest => [:pointer, :SDL_HitTest, :pointer],
|
414
|
+
:SDL_FlashWindow => [:pointer, :int],
|
415
|
+
:SDL_DestroyWindow => [:pointer],
|
416
|
+
:SDL_IsScreenSaverEnabled => [],
|
417
|
+
:SDL_EnableScreenSaver => [],
|
418
|
+
:SDL_DisableScreenSaver => [],
|
419
|
+
:SDL_GL_LoadLibrary => [:pointer],
|
420
|
+
:SDL_GL_GetProcAddress => [:pointer],
|
421
|
+
:SDL_GL_UnloadLibrary => [],
|
422
|
+
:SDL_GL_ExtensionSupported => [:pointer],
|
423
|
+
:SDL_GL_ResetAttributes => [],
|
424
|
+
:SDL_GL_SetAttribute => [:int, :int],
|
425
|
+
:SDL_GL_GetAttribute => [:int, :pointer],
|
426
|
+
:SDL_GL_CreateContext => [:pointer],
|
427
|
+
:SDL_GL_MakeCurrent => [:pointer, :pointer],
|
428
|
+
:SDL_GL_GetCurrentWindow => [],
|
429
|
+
:SDL_GL_GetCurrentContext => [],
|
430
|
+
:SDL_GL_GetDrawableSize => [:pointer, :pointer, :pointer],
|
431
|
+
:SDL_GL_SetSwapInterval => [:int],
|
432
|
+
:SDL_GL_GetSwapInterval => [],
|
433
|
+
:SDL_GL_SwapWindow => [:pointer],
|
434
|
+
:SDL_GL_DeleteContext => [:pointer],
|
435
|
+
}
|
436
|
+
retvals = {
|
437
|
+
:SDL_GetNumVideoDrivers => :int,
|
438
|
+
:SDL_GetVideoDriver => :pointer,
|
439
|
+
:SDL_VideoInit => :int,
|
440
|
+
:SDL_VideoQuit => :void,
|
441
|
+
:SDL_GetCurrentVideoDriver => :pointer,
|
442
|
+
:SDL_GetNumVideoDisplays => :int,
|
443
|
+
:SDL_GetDisplayName => :pointer,
|
444
|
+
:SDL_GetDisplayBounds => :int,
|
445
|
+
:SDL_GetDisplayUsableBounds => :int,
|
446
|
+
:SDL_GetDisplayDPI => :int,
|
447
|
+
:SDL_GetDisplayOrientation => :int,
|
448
|
+
:SDL_GetNumDisplayModes => :int,
|
449
|
+
:SDL_GetDisplayMode => :int,
|
450
|
+
:SDL_GetDesktopDisplayMode => :int,
|
451
|
+
:SDL_GetCurrentDisplayMode => :int,
|
452
|
+
:SDL_GetClosestDisplayMode => :pointer,
|
453
|
+
:SDL_GetWindowDisplayIndex => :int,
|
454
|
+
:SDL_SetWindowDisplayMode => :int,
|
455
|
+
:SDL_GetWindowDisplayMode => :int,
|
456
|
+
:SDL_GetWindowICCProfile => :pointer,
|
457
|
+
:SDL_GetWindowPixelFormat => :uint,
|
458
|
+
:SDL_CreateWindow => :pointer,
|
459
|
+
:SDL_CreateWindowFrom => :pointer,
|
460
|
+
:SDL_GetWindowID => :uint,
|
461
|
+
:SDL_GetWindowFromID => :pointer,
|
462
|
+
:SDL_GetWindowFlags => :uint,
|
463
|
+
:SDL_SetWindowTitle => :void,
|
464
|
+
:SDL_GetWindowTitle => :pointer,
|
465
|
+
:SDL_SetWindowIcon => :void,
|
466
|
+
:SDL_SetWindowData => :pointer,
|
467
|
+
:SDL_GetWindowData => :pointer,
|
468
|
+
:SDL_SetWindowPosition => :void,
|
469
|
+
:SDL_GetWindowPosition => :void,
|
470
|
+
:SDL_SetWindowSize => :void,
|
471
|
+
:SDL_GetWindowSize => :void,
|
472
|
+
:SDL_GetWindowBordersSize => :int,
|
473
|
+
:SDL_SetWindowMinimumSize => :void,
|
474
|
+
:SDL_GetWindowMinimumSize => :void,
|
475
|
+
:SDL_SetWindowMaximumSize => :void,
|
476
|
+
:SDL_GetWindowMaximumSize => :void,
|
477
|
+
:SDL_SetWindowBordered => :void,
|
478
|
+
:SDL_SetWindowResizable => :void,
|
479
|
+
:SDL_SetWindowAlwaysOnTop => :void,
|
480
|
+
:SDL_ShowWindow => :void,
|
481
|
+
:SDL_HideWindow => :void,
|
482
|
+
:SDL_RaiseWindow => :void,
|
483
|
+
:SDL_MaximizeWindow => :void,
|
484
|
+
:SDL_MinimizeWindow => :void,
|
485
|
+
:SDL_RestoreWindow => :void,
|
486
|
+
:SDL_SetWindowFullscreen => :int,
|
487
|
+
:SDL_GetWindowSurface => :pointer,
|
488
|
+
:SDL_UpdateWindowSurface => :int,
|
489
|
+
:SDL_UpdateWindowSurfaceRects => :int,
|
490
|
+
:SDL_SetWindowGrab => :void,
|
491
|
+
:SDL_SetWindowKeyboardGrab => :void,
|
492
|
+
:SDL_SetWindowMouseGrab => :void,
|
493
|
+
:SDL_GetWindowGrab => :int,
|
494
|
+
:SDL_GetWindowKeyboardGrab => :int,
|
495
|
+
:SDL_GetWindowMouseGrab => :int,
|
496
|
+
:SDL_GetGrabbedWindow => :pointer,
|
497
|
+
:SDL_SetWindowMouseRect => :int,
|
498
|
+
:SDL_GetWindowMouseRect => :pointer,
|
499
|
+
:SDL_SetWindowBrightness => :int,
|
500
|
+
:SDL_GetWindowBrightness => :float,
|
501
|
+
:SDL_SetWindowOpacity => :int,
|
502
|
+
:SDL_GetWindowOpacity => :int,
|
503
|
+
:SDL_SetWindowModalFor => :int,
|
504
|
+
:SDL_SetWindowInputFocus => :int,
|
505
|
+
:SDL_SetWindowGammaRamp => :int,
|
506
|
+
:SDL_GetWindowGammaRamp => :int,
|
507
|
+
:SDL_SetWindowHitTest => :int,
|
508
|
+
:SDL_FlashWindow => :int,
|
509
|
+
:SDL_DestroyWindow => :void,
|
510
|
+
:SDL_IsScreenSaverEnabled => :int,
|
511
|
+
:SDL_EnableScreenSaver => :void,
|
512
|
+
:SDL_DisableScreenSaver => :void,
|
513
|
+
:SDL_GL_LoadLibrary => :int,
|
514
|
+
:SDL_GL_GetProcAddress => :pointer,
|
515
|
+
:SDL_GL_UnloadLibrary => :void,
|
516
|
+
:SDL_GL_ExtensionSupported => :int,
|
517
|
+
:SDL_GL_ResetAttributes => :void,
|
518
|
+
:SDL_GL_SetAttribute => :int,
|
519
|
+
:SDL_GL_GetAttribute => :int,
|
520
|
+
:SDL_GL_CreateContext => :pointer,
|
521
|
+
:SDL_GL_MakeCurrent => :int,
|
522
|
+
:SDL_GL_GetCurrentWindow => :pointer,
|
523
|
+
:SDL_GL_GetCurrentContext => :pointer,
|
524
|
+
:SDL_GL_GetDrawableSize => :void,
|
525
|
+
:SDL_GL_SetSwapInterval => :int,
|
526
|
+
:SDL_GL_GetSwapInterval => :int,
|
527
|
+
:SDL_GL_SwapWindow => :void,
|
528
|
+
:SDL_GL_DeleteContext => :void,
|
529
|
+
}
|
530
|
+
symbols.each do |sym|
|
531
|
+
begin
|
532
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
533
|
+
rescue FFI::NotFoundError => error
|
534
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
535
|
+
end
|
536
|
+
end
|
537
|
+
end
|
538
|
+
|
539
|
+
end
|
540
|
+
|