SDLRuby 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/SDLRuby/event/accessor.rb +62 -63
- data/lib/SDLRuby/event/type.rb +1 -1
- data/lib/SDLRuby/event.rb +101 -80
- data/lib/SDLRuby/sdl/include/SDL.h.rb +11 -0
- data/lib/SDLRuby/sdl/include/SDL_audio.h.rb +125 -14
- data/lib/SDLRuby/sdl/include/SDL_blendmode.h.rb +24 -0
- data/lib/SDLRuby/sdl/include/SDL_endian.h.rb +10 -1
- data/lib/SDLRuby/sdl/include/SDL_error.h.rb +21 -2
- data/lib/SDLRuby/sdl/include/SDL_events.h.rb +458 -18
- data/lib/SDLRuby/sdl/include/SDL_gamecontroller.h.rb +92 -11
- data/lib/SDLRuby/sdl/include/SDL_guid.h.rb +10 -4
- data/lib/SDLRuby/sdl/include/SDL_hints.h.rb +186 -1
- data/lib/SDLRuby/sdl/include/SDL_joystick.h.rb +72 -10
- data/lib/SDLRuby/sdl/include/SDL_keyboard.h.rb +13 -4
- data/lib/SDLRuby/sdl/include/SDL_keycode.h.rb +287 -2
- data/lib/SDLRuby/sdl/include/SDL_locale.h.rb +9 -2
- data/lib/SDLRuby/sdl/include/SDL_messagebox.h.rb +50 -2
- data/lib/SDLRuby/sdl/include/SDL_mouse.h.rb +39 -8
- data/lib/SDLRuby/sdl/include/SDL_pixels.h.rb +271 -11
- data/lib/SDLRuby/sdl/include/SDL_rect.h.rb +43 -14
- data/lib/SDLRuby/sdl/include/SDL_render.h.rb +112 -75
- data/lib/SDLRuby/sdl/include/SDL_rwops.h.rb +63 -19
- data/lib/SDLRuby/sdl/include/SDL_scancode.h.rb +248 -1
- data/lib/SDLRuby/sdl/include/SDL_shape.h.rb +33 -6
- data/lib/SDLRuby/sdl/include/SDL_stdinc.h.rb +42 -4
- data/lib/SDLRuby/sdl/include/SDL_surface.h.rb +92 -29
- data/lib/SDLRuby/sdl/include/SDL_syswm.h.rb +1 -7
- data/lib/SDLRuby/sdl/include/SDL_timer.h.rb +11 -3
- data/lib/SDLRuby/sdl/include/SDL_version.h.rb +10 -2
- data/lib/SDLRuby/sdl/include/SDL_video.h.rb +221 -74
- data/lib/SDLRuby/sdl/sdl.rb +0 -50
- data/lib/SDLRuby/sdl.rb +7 -8
- data/lib/SDLRuby/version.rb +1 -1
- data/sig/lib/SDLRuby/event/accessor.rbs +157 -0
- data/sig/lib/SDLRuby/event/type.rbs +67 -0
- data/sig/lib/SDLRuby/event.rbs +47 -0
- data/sig/lib/SDLRuby/sdl.rbs +655 -0
- metadata +6 -22
- data/lib/SDLRuby/sdl/sdl_audio.rb +0 -75
- data/lib/SDLRuby/sdl/sdl_blendmode.rb +0 -10
- data/lib/SDLRuby/sdl/sdl_error.rb +0 -5
- data/lib/SDLRuby/sdl/sdl_events.rb +0 -470
- data/lib/SDLRuby/sdl/sdl_hints.rb +0 -9
- data/lib/SDLRuby/sdl/sdl_keyboard.rb +0 -12
- data/lib/SDLRuby/sdl/sdl_locale.rb +0 -8
- data/lib/SDLRuby/sdl/sdl_message_box.rb +0 -7
- data/lib/SDLRuby/sdl/sdl_mouse.rb +0 -32
- data/lib/SDLRuby/sdl/sdl_palette.rb +0 -12
- data/lib/SDLRuby/sdl/sdl_pixels.rb +0 -138
- data/lib/SDLRuby/sdl/sdl_rect.rb +0 -11
- data/lib/SDLRuby/sdl/sdl_render.rb +0 -35
- data/lib/SDLRuby/sdl/sdl_rw_ops.rb +0 -29
- data/lib/SDLRuby/sdl/sdl_scancode.rb +0 -255
- data/lib/SDLRuby/sdl/sdl_surface.rb +0 -27
- data/lib/SDLRuby/sdl/sdl_version.rb +0 -5
- data/lib/SDLRuby/sdl/sdl_video.rb +0 -104
- data/sig/SDLRuby/event.rbs +0 -104
- data/sig/SDLRuby/sdl.rbs +0 -606
@@ -1,32 +1,472 @@
|
|
1
1
|
module SDLRuby::SDL
|
2
|
-
require_relative
|
3
|
-
require_relative
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
10
|
-
require_relative
|
11
|
-
|
12
|
-
|
2
|
+
require_relative "SDL_stdinc.h"
|
3
|
+
require_relative "SDL_error.h"
|
4
|
+
require_relative "SDL_video.h"
|
5
|
+
require_relative "SDL_keyboard.h"
|
6
|
+
require_relative "SDL_mouse.h"
|
7
|
+
require_relative "SDL_joystick.h"
|
8
|
+
require_relative "SDL_gamecontroller.h"
|
9
|
+
require_relative "SDL_gesture.h"
|
10
|
+
require_relative "SDL_touch.h"
|
11
|
+
|
12
|
+
SDL_RELEASED = 0
|
13
|
+
SDL_PRESSED = 1
|
14
|
+
|
15
|
+
SDL_FIRSTEVENT = 0
|
16
|
+
SDL_QUIT = 0x100
|
17
|
+
SDL_APP_TERMINATING = 0x101
|
18
|
+
SDL_APP_LOWMEMORY = 0x102
|
19
|
+
SDL_APP_WILLENTERBACKGROUND = 0x103
|
20
|
+
SDL_APP_DIDENTERBACKGROUND = 0x104
|
21
|
+
SDL_APP_WILLENTERFOREGROUND = 0x105
|
22
|
+
SDL_APP_DIDENTERFOREGROUND = 0x106
|
23
|
+
SDL_LOCALECHANGED = 0x107
|
24
|
+
SDL_DISPLAYEVENT = 0x150
|
25
|
+
SDL_WINDOWEVENT = 0x200
|
26
|
+
SDL_SYSWMEVENT = 0x201
|
27
|
+
SDL_KEYDOWN = 0x300
|
28
|
+
SDL_KEYUP = 0x301
|
29
|
+
SDL_TEXTEDITING = 0x302
|
30
|
+
SDL_TEXTINPUT = 0x303
|
31
|
+
SDL_KEYMAPCHANGED = 0x304
|
32
|
+
SDL_TEXTEDITING_EXT = 0x305
|
33
|
+
SDL_MOUSEMOTION = 0x400
|
34
|
+
SDL_MOUSEBUTTONDOWN = 0x401
|
35
|
+
SDL_MOUSEBUTTONUP = 0x402
|
36
|
+
SDL_MOUSEWHEEL = 0x403
|
37
|
+
SDL_JOYAXISMOTION = 0x600
|
38
|
+
SDL_JOYBALLMOTION = 0x601
|
39
|
+
SDL_JOYHATMOTION = 0x602
|
40
|
+
SDL_JOYBUTTONDOWN = 0x603
|
41
|
+
SDL_JOYBUTTONUP = 0x604
|
42
|
+
SDL_JOYDEVICEADDED = 0x605
|
43
|
+
SDL_JOYDEVICEREMOVED = 0x606
|
44
|
+
SDL_JOYBATTERYUPDATED = 0x607
|
45
|
+
SDL_CONTROLLERAXISMOTION = 0x650
|
46
|
+
SDL_CONTROLLERBUTTONDOWN = 0x651
|
47
|
+
SDL_CONTROLLERBUTTONUP = 0x652
|
48
|
+
SDL_CONTROLLERDEVICEADDED = 0x653
|
49
|
+
SDL_CONTROLLERDEVICEREMOVED = 0x654
|
50
|
+
SDL_CONTROLLERDEVICEREMAPPED = 0x655
|
51
|
+
SDL_CONTROLLERTOUCHPADDOWN = 0x656
|
52
|
+
SDL_CONTROLLERTOUCHPADMOTION = 0x657
|
53
|
+
SDL_CONTROLLERTOUCHPADUP = 0x658
|
54
|
+
SDL_CONTROLLERSENSORUPDATE = 0x659
|
55
|
+
SDL_FINGERDOWN = 0x700
|
56
|
+
SDL_FINGERUP = 0x701
|
57
|
+
SDL_FINGERMOTION = 0x702
|
58
|
+
SDL_DOLLARGESTURE = 0x800
|
59
|
+
SDL_DOLLARRECORD = 0x801
|
60
|
+
SDL_MULTIGESTURE = 0x802
|
61
|
+
SDL_CLIPBOARDUPDATE = 0x900
|
62
|
+
SDL_DROPFILE = 0x1000
|
63
|
+
SDL_DROPTEXT = 0x1001
|
64
|
+
SDL_DROPBEGIN = 0x1002
|
65
|
+
SDL_DROPCOMPLETE = 0x1003
|
66
|
+
SDL_AUDIODEVICEADDED = 0x1100
|
67
|
+
SDL_AUDIODEVICEREMOVED = 0x1101
|
68
|
+
SDL_SENSORUPDATE = 0x1200
|
69
|
+
SDL_RENDER_TARGETS_RESET = 0x2000
|
70
|
+
SDL_RENDER_DEVICE_RESET = 0x2001
|
71
|
+
SDL_POLLSENTINEL = 0x7F00
|
72
|
+
SDL_USEREVENT = 0x8000
|
73
|
+
SDL_LASTEVENT = 0xFFFF
|
13
74
|
typealias "SDL_EventType", "int"
|
14
|
-
|
75
|
+
|
76
|
+
SDL_CommonEvent = struct(
|
77
|
+
[
|
78
|
+
"Uint32 type",
|
79
|
+
"Uint32 timestamp",
|
80
|
+
]
|
81
|
+
)
|
82
|
+
SDL_DisplayEvent = struct(
|
83
|
+
[
|
84
|
+
"Uint32 type",
|
85
|
+
"Uint32 timestamp",
|
86
|
+
"Uint32 display",
|
87
|
+
"Uint8 event",
|
88
|
+
"Uint8 padding1",
|
89
|
+
"Uint8 padding2",
|
90
|
+
"Uint8 padding3",
|
91
|
+
"Sint32 data1",
|
92
|
+
]
|
93
|
+
)
|
94
|
+
SDL_WindowEvent = struct(
|
95
|
+
[
|
96
|
+
"Uint32 type",
|
97
|
+
"Uint32 timestamp",
|
98
|
+
"Uint32 windowID",
|
99
|
+
"Uint8 event",
|
100
|
+
"Uint8 padding1",
|
101
|
+
"Uint8 padding2",
|
102
|
+
"Uint8 padding3",
|
103
|
+
"Sint32 data1",
|
104
|
+
"Sint32 data2",
|
105
|
+
]
|
106
|
+
)
|
107
|
+
SDL_KeyboardEvent = struct(
|
108
|
+
[
|
109
|
+
"Uint32 type",
|
110
|
+
"Uint32 timestamp",
|
111
|
+
"Uint32 windowID",
|
112
|
+
"Uint8 state",
|
113
|
+
"Uint8 repeat",
|
114
|
+
"Uint8 padding2",
|
115
|
+
"Uint8 padding3",
|
116
|
+
{ keysym: SDL_Keysym },
|
117
|
+
]
|
118
|
+
)
|
119
|
+
SDL_TEXTEDITINGEVENT_TEXT_SIZE = (32)
|
120
|
+
SDL_TextEditingEvent = struct(
|
121
|
+
[
|
122
|
+
"Uint32 type",
|
123
|
+
"Uint32 timestamp",
|
124
|
+
"Uint32 windowID",
|
125
|
+
"char text[#{SDL_TEXTEDITINGEVENT_TEXT_SIZE}]",
|
126
|
+
"Sint32 start",
|
127
|
+
"Sint32 length",
|
128
|
+
]
|
129
|
+
)
|
130
|
+
SDL_TextEditingExtEvent = struct(
|
131
|
+
[
|
132
|
+
"Uint32 type",
|
133
|
+
"Uint32 timestamp",
|
134
|
+
"Uint32 windowID",
|
135
|
+
"char* text",
|
136
|
+
"Sint32 start",
|
137
|
+
"Sint32 length",
|
138
|
+
]
|
139
|
+
)
|
140
|
+
SDL_TEXTINPUTEVENT_TEXT_SIZE = (32)
|
141
|
+
SDL_TextInputEvent = struct(
|
142
|
+
[
|
143
|
+
"Uint32 type",
|
144
|
+
"Uint32 timestamp",
|
145
|
+
"Uint32 windowID",
|
146
|
+
"char text[#{SDL_TEXTINPUTEVENT_TEXT_SIZE}]",
|
147
|
+
]
|
148
|
+
)
|
149
|
+
SDL_MouseMotionEvent = struct(
|
150
|
+
[
|
151
|
+
"Uint32 type",
|
152
|
+
"Uint32 timestamp",
|
153
|
+
"Uint32 windowID",
|
154
|
+
"Uint32 which",
|
155
|
+
"Uint32 state",
|
156
|
+
"Sint32 x",
|
157
|
+
"Sint32 y",
|
158
|
+
"Sint32 xrel",
|
159
|
+
"Sint32 yrel",
|
160
|
+
]
|
161
|
+
)
|
162
|
+
SDL_MouseButtonEvent = struct(
|
163
|
+
[
|
164
|
+
"Uint32 type",
|
165
|
+
"Uint32 timestamp",
|
166
|
+
"Uint32 windowID",
|
167
|
+
"Uint32 which",
|
168
|
+
"Uint8 button",
|
169
|
+
"Uint8 state",
|
170
|
+
"Uint8 clicks",
|
171
|
+
"Uint8 padding1",
|
172
|
+
"Sint32 x",
|
173
|
+
"Sint32 y",
|
174
|
+
]
|
175
|
+
)
|
176
|
+
SDL_MouseWheelEvent = struct(
|
177
|
+
[
|
178
|
+
"Uint32 type",
|
179
|
+
"Uint32 timestamp",
|
180
|
+
"Uint32 windowID",
|
181
|
+
"Uint32 which",
|
182
|
+
"Sint32 x",
|
183
|
+
"Sint32 y",
|
184
|
+
"Uint32 direction",
|
185
|
+
"float preciseX",
|
186
|
+
"float preciseY",
|
187
|
+
"Sint32 mouseX",
|
188
|
+
"Sint32 mouseY",
|
189
|
+
]
|
190
|
+
)
|
191
|
+
SDL_JoyAxisEvent = struct(
|
192
|
+
[
|
193
|
+
"Uint32 type",
|
194
|
+
"Uint32 timestamp",
|
195
|
+
"SDL_JoystickID which",
|
196
|
+
"Uint8 axis",
|
197
|
+
"Uint8 padding1",
|
198
|
+
"Uint8 padding2",
|
199
|
+
"Uint8 padding3",
|
200
|
+
"Sint16 value",
|
201
|
+
"Uint16 padding4",
|
202
|
+
]
|
203
|
+
)
|
204
|
+
SDL_JoyBallEvent = struct(
|
205
|
+
[
|
206
|
+
"Uint32 type",
|
207
|
+
"Uint32 timestamp",
|
208
|
+
"SDL_JoystickID which",
|
209
|
+
"Uint8 ball",
|
210
|
+
"Uint8 padding1",
|
211
|
+
"Uint8 padding2",
|
212
|
+
"Uint8 padding3",
|
213
|
+
"Sint16 xrel",
|
214
|
+
"Sint16 yrel",
|
215
|
+
]
|
216
|
+
)
|
217
|
+
SDL_JoyHatEvent = struct(
|
218
|
+
[
|
219
|
+
"Uint32 type",
|
220
|
+
"Uint32 timestamp",
|
221
|
+
"SDL_JoystickID which",
|
222
|
+
"Uint8 hat",
|
223
|
+
"Uint8 value",
|
224
|
+
"Uint8 padding1",
|
225
|
+
"Uint8 padding2",
|
226
|
+
]
|
227
|
+
)
|
228
|
+
SDL_JoyButtonEvent = struct(
|
229
|
+
[
|
230
|
+
"Uint32 type",
|
231
|
+
"Uint32 timestamp",
|
232
|
+
"SDL_JoystickID which",
|
233
|
+
"Uint8 button",
|
234
|
+
"Uint8 state",
|
235
|
+
"Uint8 padding1",
|
236
|
+
"Uint8 padding2",
|
237
|
+
]
|
238
|
+
)
|
239
|
+
SDL_JoyDeviceEvent = struct(
|
240
|
+
[
|
241
|
+
"Uint32 type",
|
242
|
+
"Uint32 timestamp",
|
243
|
+
"Sint32 which",
|
244
|
+
]
|
245
|
+
)
|
246
|
+
SDL_JoyBatteryEvent = struct(
|
247
|
+
[
|
248
|
+
"Uint32 type",
|
249
|
+
"Uint32 timestamp",
|
250
|
+
"SDL_JoystickID which",
|
251
|
+
"SDL_JoystickPowerLevel level",
|
252
|
+
]
|
253
|
+
)
|
254
|
+
SDL_ControllerAxisEvent = struct(
|
255
|
+
[
|
256
|
+
"Uint32 type",
|
257
|
+
"Uint32 timestamp",
|
258
|
+
"SDL_JoystickID which",
|
259
|
+
"Uint8 axis",
|
260
|
+
"Uint8 padding1",
|
261
|
+
"Uint8 padding2",
|
262
|
+
"Uint8 padding3",
|
263
|
+
"Sint16 value",
|
264
|
+
"Uint16 padding4",
|
265
|
+
]
|
266
|
+
)
|
267
|
+
SDL_ControllerButtonEvent = struct(
|
268
|
+
[
|
269
|
+
"Uint32 type",
|
270
|
+
"Uint32 timestamp",
|
271
|
+
"SDL_JoystickID which",
|
272
|
+
"Uint8 button",
|
273
|
+
"Uint8 state",
|
274
|
+
"Uint8 padding1",
|
275
|
+
"Uint8 padding2",
|
276
|
+
]
|
277
|
+
)
|
278
|
+
SDL_ControllerDeviceEvent = struct(
|
279
|
+
[
|
280
|
+
"Uint32 type",
|
281
|
+
"Uint32 timestamp",
|
282
|
+
"Sint32 which",
|
283
|
+
]
|
284
|
+
)
|
285
|
+
SDL_ControllerTouchpadEvent = struct(
|
286
|
+
[
|
287
|
+
"Uint32 type",
|
288
|
+
"Uint32 timestamp",
|
289
|
+
"SDL_JoystickID which",
|
290
|
+
"Sint32 touchpad",
|
291
|
+
"Sint32 finger",
|
292
|
+
"float x",
|
293
|
+
"float y",
|
294
|
+
"float pressure",
|
295
|
+
]
|
296
|
+
)
|
297
|
+
SDL_ControllerSensorEvent = struct(
|
298
|
+
[
|
299
|
+
"Uint32 type",
|
300
|
+
"Uint32 timestamp",
|
301
|
+
"SDL_JoystickID which",
|
302
|
+
"Sint32 sensor",
|
303
|
+
"float data[3]",
|
304
|
+
"Uint64 timestamp_us",
|
305
|
+
]
|
306
|
+
)
|
307
|
+
SDL_AudioDeviceEvent = struct(
|
308
|
+
[
|
309
|
+
"Uint32 type",
|
310
|
+
"Uint32 timestamp",
|
311
|
+
"Uint32 which",
|
312
|
+
"Uint8 iscapture",
|
313
|
+
"Uint8 padding1",
|
314
|
+
"Uint8 padding2",
|
315
|
+
"Uint8 padding3",
|
316
|
+
]
|
317
|
+
)
|
318
|
+
SDL_TouchFingerEvent = struct(
|
319
|
+
[
|
320
|
+
"Uint32 type",
|
321
|
+
"Uint32 timestamp",
|
322
|
+
"SDL_TouchID touchId",
|
323
|
+
"SDL_FingerID fingerId",
|
324
|
+
"float x",
|
325
|
+
"float y",
|
326
|
+
"float dx",
|
327
|
+
"float dy",
|
328
|
+
"float pressure",
|
329
|
+
"Uint32 windowID",
|
330
|
+
]
|
331
|
+
)
|
332
|
+
SDL_MultiGestureEvent = struct(
|
333
|
+
[
|
334
|
+
"Uint32 type",
|
335
|
+
"Uint32 timestamp",
|
336
|
+
"SDL_TouchID touchId",
|
337
|
+
"float dTheta",
|
338
|
+
"float dDist",
|
339
|
+
"float x",
|
340
|
+
"float y",
|
341
|
+
"Uint16 numFingers",
|
342
|
+
"Uint16 padding",
|
343
|
+
]
|
344
|
+
)
|
345
|
+
SDL_DollarGestureEvent = struct(
|
346
|
+
[
|
347
|
+
"Uint32 type",
|
348
|
+
"Uint32 timestamp",
|
349
|
+
"SDL_TouchID touchId",
|
350
|
+
"SDL_GestureID gestureId",
|
351
|
+
"Uint32 numFingers",
|
352
|
+
"float error",
|
353
|
+
"float x",
|
354
|
+
"float y",
|
355
|
+
]
|
356
|
+
)
|
357
|
+
SDL_DropEvent = struct(
|
358
|
+
[
|
359
|
+
"Uint32 type",
|
360
|
+
"Uint32 timestamp",
|
361
|
+
"char *file",
|
362
|
+
"Uint32 windowID",
|
363
|
+
]
|
364
|
+
)
|
365
|
+
SDL_SensorEvent = struct(
|
366
|
+
[
|
367
|
+
"Uint32 type",
|
368
|
+
"Uint32 timestamp",
|
369
|
+
"Sint32 which",
|
370
|
+
"float data[6]",
|
371
|
+
"Uint64 timestamp_us",
|
372
|
+
]
|
373
|
+
)
|
374
|
+
SDL_QuitEvent = struct(
|
375
|
+
[
|
376
|
+
"Uint32 type",
|
377
|
+
"Uint32 timestamp",
|
378
|
+
]
|
379
|
+
)
|
380
|
+
SDL_OSEvent = struct(
|
381
|
+
[
|
382
|
+
"Uint32 type",
|
383
|
+
"Uint32 timestamp",
|
384
|
+
]
|
385
|
+
)
|
386
|
+
SDL_UserEvent = struct(
|
387
|
+
[
|
388
|
+
"Uint32 type",
|
389
|
+
"Uint32 timestamp",
|
390
|
+
"Uint32 windowID",
|
391
|
+
"Sint32 code",
|
392
|
+
"void *data1",
|
393
|
+
"void *data2",
|
394
|
+
]
|
395
|
+
)
|
396
|
+
SDL_SysWMEvent = struct(
|
397
|
+
[
|
398
|
+
"Uint32 type",
|
399
|
+
"Uint32 timestamp",
|
400
|
+
"SDL_SysWMmsg *msg",
|
401
|
+
]
|
402
|
+
)
|
403
|
+
SDL_Event = union(
|
404
|
+
[
|
405
|
+
"Uint32 type",
|
406
|
+
{ common: SDL_CommonEvent },
|
407
|
+
{ display: SDL_DisplayEvent },
|
408
|
+
{ window: SDL_WindowEvent },
|
409
|
+
{ key: SDL_KeyboardEvent },
|
410
|
+
{ edit: SDL_TextEditingEvent },
|
411
|
+
{ editExt: SDL_TextEditingExtEvent },
|
412
|
+
{ text: SDL_TextInputEvent },
|
413
|
+
{ motion: SDL_MouseMotionEvent },
|
414
|
+
{ button: SDL_MouseButtonEvent },
|
415
|
+
{ wheel: SDL_MouseWheelEvent },
|
416
|
+
{ jaxis: SDL_JoyAxisEvent },
|
417
|
+
{ jball: SDL_JoyBallEvent },
|
418
|
+
{ jhat: SDL_JoyHatEvent },
|
419
|
+
{ jbutton: SDL_JoyButtonEvent },
|
420
|
+
{ jdevice: SDL_JoyDeviceEvent },
|
421
|
+
{ jbattery: SDL_JoyBatteryEvent },
|
422
|
+
{ caxis: SDL_ControllerAxisEvent },
|
423
|
+
{ cbutton: SDL_ControllerButtonEvent },
|
424
|
+
{ cdevice: SDL_ControllerDeviceEvent },
|
425
|
+
{ ctouchpad: SDL_ControllerTouchpadEvent },
|
426
|
+
{ csensor: SDL_ControllerSensorEvent },
|
427
|
+
{ adevice: SDL_AudioDeviceEvent },
|
428
|
+
{ sensor: SDL_SensorEvent },
|
429
|
+
{ quit: SDL_QuitEvent },
|
430
|
+
{ user: SDL_UserEvent },
|
431
|
+
{ syswm: SDL_SysWMEvent },
|
432
|
+
{ tfinger: SDL_TouchFingerEvent },
|
433
|
+
{ mgesture: SDL_MultiGestureEvent },
|
434
|
+
{ dgesture: SDL_DollarGestureEvent },
|
435
|
+
{ drop: SDL_DropEvent },
|
436
|
+
"Uint8 padding[#{Fiddle::SIZEOF_VOIDP <= 8 ? 56 : Fiddle::SIZEOF_VOIDP == 16 ? 64 : 3 * Fiddle::SIZEOF_VOIDP}]",
|
437
|
+
]
|
438
|
+
)
|
439
|
+
|
15
440
|
extern "void SDL_PumpEvents(void)"
|
16
|
-
|
441
|
+
|
442
|
+
SDL_ADDEVENT = 0
|
443
|
+
SDL_PEEKEVENT = 1
|
444
|
+
SDL_GETEVENT = 2
|
445
|
+
typealias "SDL_eventaction", "int"
|
446
|
+
|
447
|
+
extern "int SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType)"
|
17
448
|
extern "SDL_bool SDL_HasEvent(Uint32 type)"
|
18
449
|
extern "SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType)"
|
19
450
|
extern "void SDL_FlushEvent(Uint32 type)"
|
20
451
|
extern "void SDL_FlushEvents(Uint32 minType, Uint32 maxType)"
|
21
|
-
extern "int SDL_PollEvent(SDL_Event *event)"
|
22
|
-
extern "int SDL_WaitEvent(SDL_Event *event)"
|
23
|
-
extern "int SDL_WaitEventTimeout(SDL_Event *event, int timeout)"
|
24
|
-
extern "int SDL_PushEvent(SDL_Event *event)"
|
452
|
+
extern "int SDL_PollEvent(SDL_Event * event)"
|
453
|
+
extern "int SDL_WaitEvent(SDL_Event * event)"
|
454
|
+
extern "int SDL_WaitEventTimeout(SDL_Event * event, int timeout)"
|
455
|
+
extern "int SDL_PushEvent(SDL_Event * event)"
|
456
|
+
|
457
|
+
typealias "SDL_EventFilter", "void*"
|
458
|
+
|
25
459
|
extern "void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)"
|
26
|
-
extern "SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)"
|
460
|
+
extern "SDL_bool SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata)"
|
27
461
|
extern "void SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)"
|
28
462
|
extern "void SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)"
|
29
463
|
extern "void SDL_FilterEvents(SDL_EventFilter filter, void *userdata)"
|
464
|
+
|
465
|
+
SDL_QUERY = -1
|
466
|
+
SDL_IGNORE = 0
|
467
|
+
SDL_DISABLE = 0
|
468
|
+
SDL_ENABLE = 1
|
469
|
+
|
30
470
|
extern "Uint8 SDL_EventState(Uint32 type, int state)"
|
31
471
|
extern "Uint32 SDL_RegisterEvents(int numevents)"
|
32
472
|
end
|
@@ -1,20 +1,60 @@
|
|
1
1
|
module SDLRuby::SDL
|
2
|
-
require_relative
|
3
|
-
require_relative
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
2
|
+
require_relative "SDL_stdinc.h"
|
3
|
+
require_relative "SDL_error.h"
|
4
|
+
require_relative "SDL_rwops.h"
|
5
|
+
require_relative "SDL_sensor.h"
|
6
|
+
require_relative "SDL_joystick.h"
|
7
7
|
|
8
|
-
|
8
|
+
SDL_CONTROLLER_TYPE_UNKNOWN = 0
|
9
|
+
SDL_CONTROLLER_TYPE_XBOX360 = 1
|
10
|
+
SDL_CONTROLLER_TYPE_XBOXONE = 2
|
11
|
+
SDL_CONTROLLER_TYPE_PS3 = 3
|
12
|
+
SDL_CONTROLLER_TYPE_PS4 = 4
|
13
|
+
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO = 5
|
14
|
+
SDL_CONTROLLER_TYPE_VIRTUAL = 6
|
15
|
+
SDL_CONTROLLER_TYPE_PS5 = 7
|
16
|
+
SDL_CONTROLLER_TYPE_AMAZON_LUNA = 8
|
17
|
+
SDL_CONTROLLER_TYPE_GOOGLE_STADIA = 9
|
18
|
+
SDL_CONTROLLER_TYPE_NVIDIA_SHIELD = 10
|
19
|
+
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT = 11
|
20
|
+
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT = 12
|
21
|
+
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR = 13
|
9
22
|
typealias "SDL_GameControllerType", "int"
|
23
|
+
|
24
|
+
SDL_CONTROLLER_BINDTYPE_NONE = 0
|
25
|
+
SDL_CONTROLLER_BINDTYPE_BUTTON = 1
|
26
|
+
SDL_CONTROLLER_BINDTYPE_AXIS = 2
|
27
|
+
SDL_CONTROLLER_BINDTYPE_HAT = 3
|
10
28
|
typealias "SDL_GameControllerBindType", "int"
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
29
|
+
|
30
|
+
SDL_GameControllerButtonBind = struct(
|
31
|
+
[
|
32
|
+
"SDL_GameControllerBindType bindType",
|
33
|
+
{ value: union(
|
34
|
+
[
|
35
|
+
"int button",
|
36
|
+
"int axis",
|
37
|
+
{ hat: struct(
|
38
|
+
[
|
39
|
+
"int hat",
|
40
|
+
"int hat_mask",
|
41
|
+
]
|
42
|
+
) }
|
43
|
+
]
|
44
|
+
) }
|
45
|
+
]
|
46
|
+
)
|
47
|
+
|
48
|
+
extern "int SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw)"
|
49
|
+
|
50
|
+
def self.SDL_GameControllerAddMappingsFromFile(file)
|
51
|
+
SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
|
52
|
+
end
|
53
|
+
|
54
|
+
extern "int SDL_GameControllerAddMapping(const char* mappingString)"
|
15
55
|
extern "int SDL_GameControllerNumMappings(void)"
|
16
56
|
extern "char * SDL_GameControllerMappingForIndex(int mapping_index)"
|
17
|
-
extern "char * SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)"
|
57
|
+
# extern "char * SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)"
|
18
58
|
extern "char * SDL_GameControllerMapping(SDL_GameController *gamecontroller)"
|
19
59
|
extern "SDL_bool SDL_IsGameController(int joystick_index)"
|
20
60
|
extern "const char * SDL_GameControllerNameForIndex(int joystick_index)"
|
@@ -38,10 +78,51 @@ module SDLRuby::SDL
|
|
38
78
|
extern "SDL_Joystick * SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller)"
|
39
79
|
extern "int SDL_GameControllerEventState(int state)"
|
40
80
|
extern "void SDL_GameControllerUpdate(void)"
|
81
|
+
|
82
|
+
SDL_CONTROLLER_AXIS_INVALID = -1
|
83
|
+
SDL_CONTROLLER_AXIS_LEFTX = 0
|
84
|
+
SDL_CONTROLLER_AXIS_LEFTY = 1
|
85
|
+
SDL_CONTROLLER_AXIS_RIGHTX = 2
|
86
|
+
SDL_CONTROLLER_AXIS_RIGHTY = 3
|
87
|
+
SDL_CONTROLLER_AXIS_TRIGGERLEFT = 4
|
88
|
+
SDL_CONTROLLER_AXIS_TRIGGERRIGHT = 5
|
89
|
+
SDL_CONTROLLER_AXIS_MAX = 6
|
90
|
+
typealias "SDL_GameControllerAxis", "int"
|
91
|
+
|
41
92
|
extern "SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *str)"
|
42
93
|
extern "const char* SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis)"
|
94
|
+
# extern "SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)"
|
95
|
+
extern "SDL_bool SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)"
|
96
|
+
extern "Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)"
|
97
|
+
|
98
|
+
SDL_CONTROLLER_BUTTON_INVALID = -1
|
99
|
+
SDL_CONTROLLER_BUTTON_A = 0
|
100
|
+
SDL_CONTROLLER_BUTTON_B = 1
|
101
|
+
SDL_CONTROLLER_BUTTON_X = 2
|
102
|
+
SDL_CONTROLLER_BUTTON_Y = 3
|
103
|
+
SDL_CONTROLLER_BUTTON_BACK = 4
|
104
|
+
SDL_CONTROLLER_BUTTON_GUIDE = 5
|
105
|
+
SDL_CONTROLLER_BUTTON_START = 6
|
106
|
+
SDL_CONTROLLER_BUTTON_LEFTSTICK = 7
|
107
|
+
SDL_CONTROLLER_BUTTON_RIGHTSTICK = 8
|
108
|
+
SDL_CONTROLLER_BUTTON_LEFTSHOULDER = 9
|
109
|
+
SDL_CONTROLLER_BUTTON_RIGHTSHOULDER = 10
|
110
|
+
SDL_CONTROLLER_BUTTON_DPAD_UP = 11
|
111
|
+
SDL_CONTROLLER_BUTTON_DPAD_DOWN = 12
|
112
|
+
SDL_CONTROLLER_BUTTON_DPAD_LEFT = 13
|
113
|
+
SDL_CONTROLLER_BUTTON_DPAD_RIGHT = 14
|
114
|
+
SDL_CONTROLLER_BUTTON_MISC1 = 15
|
115
|
+
SDL_CONTROLLER_BUTTON_PADDLE1 = 16
|
116
|
+
SDL_CONTROLLER_BUTTON_PADDLE2 = 17
|
117
|
+
SDL_CONTROLLER_BUTTON_PADDLE3 = 18
|
118
|
+
SDL_CONTROLLER_BUTTON_PADDLE4 = 19
|
119
|
+
SDL_CONTROLLER_BUTTON_TOUCHPAD = 20
|
120
|
+
SDL_CONTROLLER_BUTTON_MAX = 21
|
121
|
+
typealias "SDL_GameControllerButton", "int"
|
122
|
+
|
43
123
|
extern "SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *str)"
|
44
124
|
extern "const char* SDL_GameControllerGetStringForButton(SDL_GameControllerButton button)"
|
125
|
+
# extern "SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)"
|
45
126
|
extern "SDL_bool SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)"
|
46
127
|
extern "Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)"
|
47
128
|
extern "int SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller)"
|
@@ -1,7 +1,13 @@
|
|
1
1
|
module SDLRuby::SDL
|
2
|
-
require_relative
|
3
|
-
require_relative
|
2
|
+
require_relative "SDL_stdinc.h"
|
3
|
+
require_relative "SDL_error.h"
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
SDL_GUID = struct(
|
6
|
+
[
|
7
|
+
"Uint8 data[16]"
|
8
|
+
]
|
9
|
+
)
|
10
|
+
|
11
|
+
# extern "void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)"
|
12
|
+
# extern "SDL_GUID SDL_GUIDFromString(const char *pchGUID)"
|
7
13
|
end
|