SDLRuby 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/SDLRuby/event/accessor.rb +62 -63
  4. data/lib/SDLRuby/event/type.rb +1 -1
  5. data/lib/SDLRuby/event.rb +98 -80
  6. data/lib/SDLRuby/sdl/include/SDL.h.rb +11 -0
  7. data/lib/SDLRuby/sdl/include/SDL_audio.h.rb +125 -14
  8. data/lib/SDLRuby/sdl/include/SDL_blendmode.h.rb +24 -0
  9. data/lib/SDLRuby/sdl/include/SDL_endian.h.rb +10 -1
  10. data/lib/SDLRuby/sdl/include/SDL_error.h.rb +21 -2
  11. data/lib/SDLRuby/sdl/include/SDL_events.h.rb +458 -18
  12. data/lib/SDLRuby/sdl/include/SDL_gamecontroller.h.rb +92 -11
  13. data/lib/SDLRuby/sdl/include/SDL_guid.h.rb +10 -4
  14. data/lib/SDLRuby/sdl/include/SDL_hints.h.rb +186 -1
  15. data/lib/SDLRuby/sdl/include/SDL_joystick.h.rb +72 -10
  16. data/lib/SDLRuby/sdl/include/SDL_keyboard.h.rb +13 -4
  17. data/lib/SDLRuby/sdl/include/SDL_keycode.h.rb +287 -2
  18. data/lib/SDLRuby/sdl/include/SDL_locale.h.rb +9 -2
  19. data/lib/SDLRuby/sdl/include/SDL_messagebox.h.rb +50 -2
  20. data/lib/SDLRuby/sdl/include/SDL_mouse.h.rb +39 -8
  21. data/lib/SDLRuby/sdl/include/SDL_pixels.h.rb +271 -11
  22. data/lib/SDLRuby/sdl/include/SDL_rect.h.rb +43 -14
  23. data/lib/SDLRuby/sdl/include/SDL_render.h.rb +112 -75
  24. data/lib/SDLRuby/sdl/include/SDL_rwops.h.rb +63 -19
  25. data/lib/SDLRuby/sdl/include/SDL_scancode.h.rb +248 -1
  26. data/lib/SDLRuby/sdl/include/SDL_shape.h.rb +33 -6
  27. data/lib/SDLRuby/sdl/include/SDL_stdinc.h.rb +42 -4
  28. data/lib/SDLRuby/sdl/include/SDL_surface.h.rb +92 -29
  29. data/lib/SDLRuby/sdl/include/SDL_syswm.h.rb +1 -7
  30. data/lib/SDLRuby/sdl/include/SDL_timer.h.rb +11 -3
  31. data/lib/SDLRuby/sdl/include/SDL_version.h.rb +10 -2
  32. data/lib/SDLRuby/sdl/include/SDL_video.h.rb +221 -74
  33. data/lib/SDLRuby/sdl/sdl.rb +0 -50
  34. data/lib/SDLRuby/sdl.rb +7 -8
  35. data/lib/SDLRuby/version.rb +1 -1
  36. data/sig/lib/SDLRuby/event/accessor.rbs +157 -0
  37. data/sig/lib/SDLRuby/event/type.rbs +67 -0
  38. data/sig/lib/SDLRuby/event.rbs +47 -0
  39. data/sig/lib/SDLRuby/sdl.rbs +655 -0
  40. metadata +6 -22
  41. data/lib/SDLRuby/sdl/sdl_audio.rb +0 -75
  42. data/lib/SDLRuby/sdl/sdl_blendmode.rb +0 -10
  43. data/lib/SDLRuby/sdl/sdl_error.rb +0 -5
  44. data/lib/SDLRuby/sdl/sdl_events.rb +0 -470
  45. data/lib/SDLRuby/sdl/sdl_hints.rb +0 -9
  46. data/lib/SDLRuby/sdl/sdl_keyboard.rb +0 -12
  47. data/lib/SDLRuby/sdl/sdl_locale.rb +0 -8
  48. data/lib/SDLRuby/sdl/sdl_message_box.rb +0 -7
  49. data/lib/SDLRuby/sdl/sdl_mouse.rb +0 -32
  50. data/lib/SDLRuby/sdl/sdl_palette.rb +0 -12
  51. data/lib/SDLRuby/sdl/sdl_pixels.rb +0 -138
  52. data/lib/SDLRuby/sdl/sdl_rect.rb +0 -11
  53. data/lib/SDLRuby/sdl/sdl_render.rb +0 -35
  54. data/lib/SDLRuby/sdl/sdl_rw_ops.rb +0 -29
  55. data/lib/SDLRuby/sdl/sdl_scancode.rb +0 -255
  56. data/lib/SDLRuby/sdl/sdl_surface.rb +0 -27
  57. data/lib/SDLRuby/sdl/sdl_version.rb +0 -5
  58. data/lib/SDLRuby/sdl/sdl_video.rb +0 -104
  59. data/sig/SDLRuby/event.rbs +0 -104
  60. data/sig/SDLRuby/sdl.rbs +0 -606
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SDLRuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - shinokaro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-30 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: SDLRuby is a GEM that allows calling the SDL library from Ruby, enabling
14
14
  window creation, image display, audio playback, and more. It easily manages C pointers
@@ -96,24 +96,6 @@ files:
96
96
  - lib/SDLRuby/sdl/include/SDL_version.h.rb
97
97
  - lib/SDLRuby/sdl/include/SDL_video.h.rb
98
98
  - lib/SDLRuby/sdl/sdl.rb
99
- - lib/SDLRuby/sdl/sdl_audio.rb
100
- - lib/SDLRuby/sdl/sdl_blendmode.rb
101
- - lib/SDLRuby/sdl/sdl_error.rb
102
- - lib/SDLRuby/sdl/sdl_events.rb
103
- - lib/SDLRuby/sdl/sdl_hints.rb
104
- - lib/SDLRuby/sdl/sdl_keyboard.rb
105
- - lib/SDLRuby/sdl/sdl_locale.rb
106
- - lib/SDLRuby/sdl/sdl_message_box.rb
107
- - lib/SDLRuby/sdl/sdl_mouse.rb
108
- - lib/SDLRuby/sdl/sdl_palette.rb
109
- - lib/SDLRuby/sdl/sdl_pixels.rb
110
- - lib/SDLRuby/sdl/sdl_rect.rb
111
- - lib/SDLRuby/sdl/sdl_render.rb
112
- - lib/SDLRuby/sdl/sdl_rw_ops.rb
113
- - lib/SDLRuby/sdl/sdl_scancode.rb
114
- - lib/SDLRuby/sdl/sdl_surface.rb
115
- - lib/SDLRuby/sdl/sdl_version.rb
116
- - lib/SDLRuby/sdl/sdl_video.rb
117
99
  - lib/SDLRuby/sdl_error.rb
118
100
  - lib/SDLRuby/surface.rb
119
101
  - lib/SDLRuby/surface/pixel_format.rb
@@ -135,10 +117,12 @@ files:
135
117
  - lib/SDLRuby/window/surfacer.rb
136
118
  - lib/SDLRuby/window/window_renderer.rb
137
119
  - sig/SDLRuby.rbs
138
- - sig/SDLRuby/event.rbs
139
120
  - sig/SDLRuby/pixel_formmater.rbs
140
121
  - sig/SDLRuby/rect.rbs
141
- - sig/SDLRuby/sdl.rbs
122
+ - sig/lib/SDLRuby/event.rbs
123
+ - sig/lib/SDLRuby/event/accessor.rbs
124
+ - sig/lib/SDLRuby/event/type.rbs
125
+ - sig/lib/SDLRuby/sdl.rbs
142
126
  homepage: https://github.com/shinokaro/SDLRuby
143
127
  licenses:
144
128
  - MIT
@@ -1,75 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- # SDL_AUDIO_MASK_BITSIZE = (0xFF)
4
- # SDL_AUDIO_MASK_DATATYPE = (1<<8)
5
- # SDL_AUDIO_MASK_ENDIAN = (1<<12)
6
- # SDL_AUDIO_MASK_SIGNED = (1<<15)
7
- # SDL_AUDIO_BITSIZE(x) = (x & SDL_AUDIO_MASK_BITSIZE)
8
- # SDL_AUDIO_ISFLOAT(x) = (x & SDL_AUDIO_MASK_DATATYPE)
9
- # SDL_AUDIO_ISBIGENDIAN(x) = (x & SDL_AUDIO_MASK_ENDIAN)
10
- # SDL_AUDIO_ISSIGNED(x) = (x & SDL_AUDIO_MASK_SIGNED)
11
- # SDL_AUDIO_ISINT(x) = (!SDL_AUDIO_ISFLOAT(x))
12
- # SDL_AUDIO_ISLITTLEENDIAN(x) = (!SDL_AUDIO_ISBIGENDIAN(x))
13
- # SDL_AUDIO_ISUNSIGNED(x) = (!SDL_AUDIO_ISSIGNED(x))
14
-
15
- AUDIO_U8 = 0x0008
16
- AUDIO_S8 = 0x8008
17
- AUDIO_U16LSB = 0x0010
18
- AUDIO_S16LSB = 0x8010
19
- AUDIO_U16MSB = 0x1010
20
- AUDIO_S16MSB = 0x9010
21
- AUDIO_U16 = AUDIO_U16LSB
22
- AUDIO_S16 = AUDIO_S16LSB
23
- AUDIO_S32LSB = 0x8020
24
- AUDIO_S32MSB = 0x9020
25
- AUDIO_S32 = AUDIO_S32LSB
26
- AUDIO_F32LSB = 0x8120
27
- AUDIO_F32MSB = 0x9120
28
- AUDIO_F32 = AUDIO_F32LSB
29
-
30
- #if SDL_BYTEORDER == SDL_LIL_ENDIAN
31
- AUDIO_U16SYS = AUDIO_U16LSB
32
- AUDIO_S16SYS = AUDIO_S16LSB
33
- AUDIO_S32SYS = AUDIO_S32LSB
34
- AUDIO_F32SYS = AUDIO_F32LSB
35
- #else
36
- # AUDIO_U16SYS = AUDIO_U16MSB
37
- # AUDIO_S16SYS = AUDIO_S16MSB
38
- # AUDIO_S32SYS = AUDIO_S32MSB
39
- # AUDIO_F32SYS = AUDIO_F32MSB
40
- #endif
41
-
42
- SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
43
- SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
44
- SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
45
- SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
46
- SDL_AUDIO_ALLOW_ANY_CHANGE =
47
- SDL_AUDIO_ALLOW_FREQUENCY_CHANGE |
48
- SDL_AUDIO_ALLOW_FORMAT_CHANGE |
49
- SDL_AUDIO_ALLOW_CHANNELS_CHANGE |
50
- SDL_AUDIO_ALLOW_SAMPLES_CHANGE
51
-
52
- typealias "SDL_AudioCallback", "void*"
53
-
54
- SDL_AudioSpec = struct(
55
- [
56
- "int freq",
57
- "SDL_AudioFormat format",
58
- "Uint8 channels",
59
- "Uint8 silence",
60
- "Uint16 samples",
61
- "Uint16 padding",
62
- "Uint32 size",
63
- "SDL_AudioCallback callback",
64
- "void *userdata"
65
- ]
66
- )
67
-
68
- SDL_AUDIO_STOPPED = 0
69
- SDL_AUDIO_PLAYING = 1
70
- SDL_AUDIO_PAUSED = 2
71
- typealias "SDL_AudioStatus", "int"
72
-
73
- SDL_MIX_MAXVOLUME = 128
74
- end
75
- end
@@ -1,10 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- SDL_BLENDMODE_NONE = 0x00000000
4
- SDL_BLENDMODE_BLEND = 0x00000001
5
- SDL_BLENDMODE_ADD = 0x00000002
6
- SDL_BLENDMODE_MOD = 0x00000004
7
- SDL_BLENDMODE_MUL = 0x00000008
8
- SDL_BLENDMODE_INVALID = 0x7FFFFFFF
9
- end
10
- end
@@ -1,5 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- extern "int SDL_SetError(const char* fmt, ...)"
4
- end
5
- end
@@ -1,470 +0,0 @@
1
- require_relative 'sdl_keyboard'
2
-
3
- module SDLRuby
4
- module SDL
5
- SDL_RELEASED = 0
6
- SDL_PRESSED = 1
7
-
8
- # SDL_EventType
9
- #
10
- SDL_FIRSTEVENT = 0
11
- SDL_QUIT = 0x100
12
- SDL_APP_TERMINATING = 0x101
13
- SDL_APP_LOWMEMORY = 0x102
14
- SDL_APP_WILLENTERBACKGROUND = 0x103
15
- SDL_APP_DIDENTERBACKGROUND = 0x104
16
- SDL_APP_WILLENTERFOREGROUND = 0x105
17
- SDL_APP_DIDENTERFOREGROUND = 0x106
18
- SDL_LOCALECHANGED = 0x107
19
- SDL_DISPLAYEVENT = 0x150
20
- SDL_WINDOWEVENT = 0x200
21
- SDL_SYSWMEVENT = 0x201
22
- SDL_KEYDOWN = 0x300
23
- SDL_KEYUP = 0x301
24
- SDL_TEXTEDITING = 0x302
25
- SDL_TEXTINPUT = 0x303
26
- SDL_KEYMAPCHANGED = 0x304
27
- SDL_TEXTEDITING_EXT = 0x305
28
- SDL_MOUSEMOTION = 0x400
29
- SDL_MOUSEBUTTONDOWN = 0x401
30
- SDL_MOUSEBUTTONUP = 0x402
31
- SDL_MOUSEWHEEL = 0x403
32
- SDL_JOYAXISMOTION = 0x600
33
- SDL_JOYBALLMOTION = 0x601
34
- SDL_JOYHATMOTION = 0x602
35
- SDL_JOYBUTTONDOWN = 0x603
36
- SDL_JOYBUTTONUP = 0x604
37
- SDL_JOYDEVICEADDED = 0x605
38
- SDL_JOYDEVICEREMOVED = 0x606
39
- SDL_JOYBATTERYUPDATED = 0x607
40
- SDL_CONTROLLERAXISMOTION = 0x650
41
- SDL_CONTROLLERBUTTONDOWN = 0x651
42
- SDL_CONTROLLERBUTTONUP = 0x652
43
- SDL_CONTROLLERDEVICEADDED = 0x653
44
- SDL_CONTROLLERDEVICEREMOVED = 0x654
45
- SDL_CONTROLLERDEVICEREMAPPED = 0x655
46
- SDL_CONTROLLERTOUCHPADDOWN = 0x656
47
- SDL_CONTROLLERTOUCHPADMOTION = 0x657
48
- SDL_CONTROLLERTOUCHPADUP = 0x658
49
- SDL_CONTROLLERSENSORUPDATE = 0x659
50
- SDL_FINGERDOWN = 0x700
51
- SDL_FINGERUP = 0x701
52
- SDL_FINGERMOTION = 0x702
53
- SDL_DOLLARGESTURE = 0x800
54
- SDL_DOLLARRECORD = 0x801
55
- SDL_MULTIGESTURE = 0x802
56
- SDL_CLIPBOARDUPDATE = 0x900
57
- SDL_DROPFILE = 0x1000
58
- SDL_DROPTEXT = 0x1001
59
- SDL_DROPBEGIN = 0x1002
60
- SDL_DROPCOMPLETE = 0x1003
61
- SDL_AUDIODEVICEADDED = 0x1100
62
- SDL_AUDIODEVICEREMOVED = 0x1101
63
- SDL_SENSORUPDATE = 0x1200
64
- SDL_RENDER_TARGETS_RESET = 0x2000
65
- SDL_RENDER_DEVICE_RESET = 0x2001
66
- SDL_POLLSENTINEL = 0x7F00
67
- SDL_USEREVENT = 0x8000
68
- SDL_LASTEVENT = 0xFFFF
69
-
70
- SDL_CommonEvent = struct(["Uint32 type", "Uint32 timestamp"])
71
-
72
- SDL_DisplayEvent = struct(
73
- [
74
- "Uint32 type",
75
- "Uint32 timestamp",
76
- "Uint32 display",
77
- "Uint8 event",
78
- "Uint8 padding1",
79
- "Uint8 padding2",
80
- "Uint8 padding3",
81
- "Sint32 data1"
82
- ]
83
- )
84
-
85
- SDL_WindowEvent = struct(
86
- [
87
- "Uint32 type",
88
- "Uint32 timestamp",
89
- "Uint32 windowID",
90
- "Uint8 event",
91
- "Uint8 padding1",
92
- "Uint8 padding2",
93
- "Uint8 padding3",
94
- "Sint32 data1",
95
- "Sint32 data2"
96
- ]
97
- )
98
-
99
- SDL_KeyboardEvent = struct(
100
- [
101
- "Uint32 type",
102
- "Uint32 timestamp",
103
- "Uint32 windowID",
104
- "Uint8 state",
105
- "Uint8 repeat",
106
- "Uint8 padding2",
107
- "Uint8 padding3",
108
- { keysym: SDL_Keysym }
109
- ]
110
- )
111
-
112
- SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32
113
-
114
- SDL_TextEditingEvent = struct(
115
- [
116
- "Uint32 type",
117
- "Uint32 timestamp",
118
- "Uint32 windowID",
119
- "char text[#{SDL_TEXTEDITINGEVENT_TEXT_SIZE}]",
120
- "Sint32 start",
121
- "Sint32 length"
122
- ]
123
- )
124
-
125
- SDL_TextEditingExtEvent = struct(
126
- [
127
- "Uint32 type",
128
- "Uint32 timestamp",
129
- "Uint32 windowID",
130
- # The editing text, which should be freed with SDL_free(),
131
- # and will not be NULL.
132
- "char* text",
133
- "Sint32 start",
134
- "Sint32 length"
135
- ]
136
- )
137
-
138
- SDL_TEXTINPUTEVENT_TEXT_SIZE = 32
139
-
140
- SDL_TextInputEvent = struct(
141
- [
142
- "Uint32 type",
143
- "Uint32 timestamp",
144
- "Uint32 windowID",
145
- "char text[#{SDL_TEXTINPUTEVENT_TEXT_SIZE}]"
146
- ]
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
-
163
- SDL_MouseButtonEvent = struct(
164
- [
165
- "Uint32 type",
166
- "Uint32 timestamp",
167
- "Uint32 windowID",
168
- "Uint32 which",
169
- "Uint8 button",
170
- "Uint8 state",
171
- "Uint8 clicks",
172
- "Uint8 padding1",
173
- "Sint32 x",
174
- "Sint32 y"
175
- ]
176
- )
177
-
178
- SDL_MouseWheelEvent = struct(
179
- [
180
- "Uint32 type",
181
- "Uint32 timestamp",
182
- "Uint32 windowID",
183
- "Uint32 which",
184
- "Sint32 x",
185
- "Sint32 y",
186
- "Uint32 direction",
187
- "float preciseX",
188
- "float preciseY",
189
- "Sint32 mouseX",
190
- "Sint32 mouseY"
191
- ]
192
- )
193
-
194
- SDL_JoyAxisEvent = struct(
195
- [
196
- "Uint32 type",
197
- "Uint32 timestamp",
198
- "SDL_JoystickID which",
199
- "Uint8 axis",
200
- "Uint8 padding1",
201
- "Uint8 padding2",
202
- "Uint8 padding3",
203
- "Sint16 value",
204
- "Uint16 padding4"
205
- ]
206
- )
207
-
208
- SDL_JoyBallEvent = struct(
209
- [
210
- "Uint32 type",
211
- "Uint32 timestamp",
212
- "SDL_JoystickID which",
213
- "Uint8 ball",
214
- "Uint8 padding1",
215
- "Uint8 padding2",
216
- "Uint8 padding3",
217
- "Sint16 xrel",
218
- "Sint16 yrel"
219
- ]
220
- )
221
-
222
- SDL_JoyHatEvent = struct(
223
- [
224
- "Uint32 type",
225
- "Uint32 timestamp",
226
- "SDL_JoystickID which",
227
- "Uint8 hat",
228
- "Uint8 value",
229
- "Uint8 padding1",
230
- "Uint8 padding2"
231
- ]
232
- )
233
-
234
- SDL_JoyButtonEvent = struct(
235
- [
236
- "Uint32 type",
237
- "Uint32 timestamp",
238
- "SDL_JoystickID which",
239
- "Uint8 button",
240
- "Uint8 state",
241
- "Uint8 padding1",
242
- "Uint8 padding2"
243
- ]
244
- )
245
-
246
- SDL_JoyDeviceEvent = struct(
247
- [
248
- "Uint32 type",
249
- "Uint32 timestamp",
250
- "Sint32 which"
251
- ]
252
- )
253
-
254
- SDL_JoyBatteryEvent = struct(
255
- [
256
- "Uint32 type",
257
- "Uint32 timestamp",
258
- "SDL_JoystickID which",
259
- "SDL_JoystickPowerLevel level"
260
- ]
261
- )
262
-
263
- SDL_ControllerAxisEvent = struct(
264
- [
265
- "Uint32 type",
266
- "Uint32 timestamp",
267
- "SDL_JoystickID which",
268
- "Uint8 axis",
269
- "Uint8 padding1",
270
- "Uint8 padding2",
271
- "Uint8 padding3",
272
- "Sint16 value",
273
- "Uint16 padding4"
274
- ]
275
- )
276
-
277
- SDL_ControllerButtonEvent = struct(
278
- [
279
- "Uint32 type",
280
- "Uint32 timestamp",
281
- "SDL_JoystickID which",
282
- "Uint8 button",
283
- "Uint8 state",
284
- "Uint8 padding1",
285
- "Uint8 padding2"
286
- ]
287
- )
288
-
289
- SDL_ControllerDeviceEvent = struct(
290
- [
291
- "Uint32 type",
292
- "Uint32 timestamp",
293
- "Sint32 which"
294
- ]
295
- )
296
-
297
- SDL_ControllerTouchpadEvent = struct(
298
- [
299
- "Uint32 type",
300
- "Uint32 timestamp",
301
- "SDL_JoystickID which",
302
- "Sint32 touchpad",
303
- "Sint32 finger",
304
- "float x",
305
- "float y",
306
- "float pressure"
307
- ]
308
- )
309
-
310
- SDL_ControllerSensorEvent = struct(
311
- [
312
- "Uint32 type",
313
- "Uint32 timestamp",
314
- "SDL_JoystickID which",
315
- "Sint32 sensor",
316
- "float data[3]",
317
- "Uint64 timestamp_us"
318
- ]
319
- )
320
-
321
- SDL_AudioDeviceEvent = struct(
322
- [
323
- "Uint32 type",
324
- "Uint32 timestamp",
325
- "Uint32 which",
326
- "Uint8 iscapture",
327
- "Uint8 padding1",
328
- "Uint8 padding2",
329
- "Uint8 padding3"
330
- ]
331
- )
332
-
333
- SDL_TouchFingerEvent = struct(
334
- [
335
- "Uint32 type",
336
- "Uint32 timestamp",
337
- "SDL_TouchID touchId",
338
- "SDL_FingerID fingerId",
339
- "float x",
340
- "float y",
341
- "float dx",
342
- "float dy",
343
- "float pressure",
344
- "Uint32 windowID"
345
- ]
346
- )
347
-
348
- SDL_MultiGestureEvent = struct(
349
- [
350
- "Uint32 type",
351
- "Uint32 timestamp",
352
- "SDL_TouchID touchId",
353
- "float dTheta",
354
- "float dDist",
355
- "float x",
356
- "float y",
357
- "Uint16 numFingers",
358
- "Uint16 padding"
359
- ]
360
- )
361
-
362
- SDL_DollarGestureEvent = struct(
363
- [
364
- "Uint32 type",
365
- "Uint32 timestamp",
366
- "SDL_TouchID touchId",
367
- "SDL_GestureID gestureId",
368
- "Uint32 numFingers",
369
- "float error",
370
- "float x",
371
- "float y"
372
- ]
373
- )
374
-
375
- SDL_DropEvent = struct(
376
- [
377
- "Uint32 type",
378
- "Uint32 timestamp",
379
- # The file name, which should be freed with SDL_free(),
380
- # is NULL on begin/complete.
381
- "char *file",
382
- "Uint32 windowID"
383
- ]
384
- )
385
-
386
- SDL_SensorEvent = struct(
387
- [
388
- "Uint32 type",
389
- "Uint32 timestamp",
390
- "Sint32 which",
391
- "float data[6]",
392
- "Uint64 timestamp_us"
393
- ]
394
- )
395
-
396
- SDL_QuitEvent = struct(["Uint32 type", "Uint32 timestamp"])
397
-
398
- SDL_OSEvent = struct(["Uint32 type", "Uint32 timestamp"])
399
-
400
- SDL_UserEvent = struct(
401
- [
402
- "Uint32 type",
403
- "Uint32 timestamp",
404
- "Uint32 windowID",
405
- "Sint32 code",
406
- "void *data1",
407
- "void *data2"
408
- ]
409
- )
410
-
411
- SDL_SysWMEvent = struct(
412
- [
413
- "Uint32 type",
414
- "Uint32 timestamp",
415
- "SDL_SysWMmsg *msg"
416
- ]
417
- )
418
-
419
- SDL_Event = union(
420
- [
421
- "Uint32 type",
422
- { common: SDL_CommonEvent },
423
- { display: SDL_DisplayEvent},
424
- { window: SDL_WindowEvent },
425
- { key: SDL_KeyboardEvent },
426
- { edit: SDL_TextEditingEvent },
427
- { editExt: SDL_TextEditingExtEvent },
428
- { text: SDL_TextInputEvent },
429
- { motion: SDL_MouseMotionEvent },
430
- { button: SDL_MouseButtonEvent },
431
- { wheel: SDL_MouseWheelEvent },
432
- { jaxis: SDL_JoyAxisEvent },
433
- { jball: SDL_JoyBallEvent },
434
- { jhat: SDL_JoyHatEvent },
435
- { jbutton: SDL_JoyButtonEvent },
436
- { jdevice: SDL_JoyDeviceEvent },
437
- { jbattery: SDL_JoyBatteryEvent },
438
- { caxis: SDL_ControllerAxisEvent },
439
- { cbutton: SDL_ControllerButtonEvent },
440
- { cdevice: SDL_ControllerDeviceEvent },
441
- { ctouchpad: SDL_ControllerTouchpadEvent },
442
- { csensor: SDL_ControllerSensorEvent },
443
- { adevice: SDL_AudioDeviceEvent },
444
- { sensor: SDL_SensorEvent },
445
- { quit: SDL_QuitEvent },
446
- { user: SDL_UserEvent },
447
- { syswm: SDL_SysWMEvent },
448
- { tfinger: SDL_TouchFingerEvent },
449
- { mgesture: SDL_MultiGestureEvent },
450
- { dgesture: SDL_DollarGestureEvent },
451
- { drop: SDL_DropEvent },
452
- "Uint8 padding[#{
453
- size = Fiddle::SIZEOF_VOIDP
454
- if size <= 8
455
- 56
456
- elsif size == 16
457
- 64
458
- else
459
- 3 * size
460
- end
461
- }]"
462
- ]
463
- )
464
-
465
- SDL_ADDEVENT = 0
466
- SDL_PEEKEVENT = 1
467
- SDL_GETEVENT = 2
468
- typealias "SDL_eventaction", "int"
469
- end
470
- end
@@ -1,9 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- SDL_HINT_DEFAULT = 0
4
- SDL_HINT_NORMAL = 1
5
- SDL_HINT_OVERRIDE = 2
6
-
7
- typealias "SDL_HintCallback", "void*"
8
- end
9
- end
@@ -1,12 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- SDL_Keysym = struct(
4
- [
5
- "SDL_Scancode scancode",
6
- "SDL_Keycode sym",
7
- "Uint16 mod",
8
- "Uint32 unused"
9
- ]
10
- )
11
- end
12
- end
@@ -1,8 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- SDL_Locale = struct [
4
- "const char *language",
5
- "const char *country"
6
- ]
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- SDL_MESSAGEBOX_ERROR = 0x00000010
4
- SDL_MESSAGEBOX_WARNING = 0x00000020
5
- SDL_MESSAGEBOX_INFORMATION = 0x00000040
6
- end
7
- end
@@ -1,32 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- SDL_SYSTEM_CURSOR_ARROW = 0
4
- SDL_SYSTEM_CURSOR_IBEAM = 1
5
- SDL_SYSTEM_CURSOR_WAIT = 2
6
- SDL_SYSTEM_CURSOR_CROSSHAIR = 3
7
- SDL_SYSTEM_CURSOR_WAITARROW = 4
8
- SDL_SYSTEM_CURSOR_SIZENWSE = 5
9
- SDL_SYSTEM_CURSOR_SIZENESW = 6
10
- SDL_SYSTEM_CURSOR_SIZEWE = 7
11
- SDL_SYSTEM_CURSOR_SIZENS = 8
12
- SDL_SYSTEM_CURSOR_SIZEALL = 9
13
- SDL_SYSTEM_CURSOR_NO = 10
14
- SDL_SYSTEM_CURSOR_HAND = 11
15
- SDL_NUM_SYSTEM_CURSORS = 12
16
-
17
- SDL_MOUSEWHEEL_NORMAL = 0
18
- SDL_MOUSEWHEEL_FLIPPED = 1
19
-
20
- SDL_BUTTON = -> (x) { 1 << (x - 1) }
21
- SDL_BUTTON_LEFT = 1
22
- SDL_BUTTON_MIDDLE = 2
23
- SDL_BUTTON_RIGHT = 3
24
- SDL_BUTTON_X1 = 4
25
- SDL_BUTTON_X2 = 5
26
- SDL_BUTTON_LMASK = SDL_BUTTON.(SDL_BUTTON_LEFT)
27
- SDL_BUTTON_MMASK = SDL_BUTTON.(SDL_BUTTON_MIDDLE)
28
- SDL_BUTTON_RMASK = SDL_BUTTON.(SDL_BUTTON_RIGHT)
29
- SDL_BUTTON_X1MASK = SDL_BUTTON.(SDL_BUTTON_X1)
30
- SDL_BUTTON_X2MASK = SDL_BUTTON.(SDL_BUTTON_X2)
31
- end
32
- end
@@ -1,12 +0,0 @@
1
- module SDLRuby
2
- module SDL
3
- SDL_Palette = struct(
4
- [
5
- "int ncolors",
6
- "SDL_Color* colors",
7
- "Uint32 version",
8
- "int refcount"
9
- ]
10
- )
11
- end
12
- end