sdl2-bindings 0.0.3 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +25 -0
- data/LICENSE.txt +1 -1
- data/README.md +6 -2
- data/lib/sdl2.rb +7 -3
- data/lib/sdl2_audio.rb +22 -0
- data/lib/sdl2_cpuinfo.rb +3 -0
- data/lib/sdl2_error.rb +3 -0
- data/lib/sdl2_events.rb +35 -5
- data/lib/sdl2_gamecontroller.rb +56 -1
- data/lib/sdl2_haptic.rb +1 -0
- data/lib/sdl2_hints.rb +123 -2
- data/lib/sdl2_joystick.rb +34 -0
- data/lib/sdl2_keycode.rb +4 -0
- data/lib/sdl2_log.rb +1 -1
- data/lib/sdl2_misc.rb +45 -0
- data/lib/sdl2_mixer.rb +12 -2
- data/lib/sdl2_pixels.rb +6 -0
- data/lib/sdl2_render.rb +3 -0
- data/lib/sdl2_sensor.rb +96 -0
- data/lib/sdl2_stdinc.rb +60 -1
- data/lib/sdl2_surface.rb +7 -1
- data/lib/sdl2_syswm.rb +155 -0
- data/lib/sdl2_timer.rb +1 -1
- data/lib/sdl2_ttf.rb +12 -0
- data/lib/sdl2_version.rb +1 -1
- data/lib/sdl2_video.rb +30 -2
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a7696c9c474d021291dc6b99dd2320cecdb9731ad3d2988a18b7290234d6edf
|
4
|
+
data.tar.gz: aec02f42298c782d35a7e9ca72a5ac4d160b065ac044077fdd414916fb742f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5260b13b50746a68fc01c8a0d84348dd7c659b1d6f42b69a4e0a730259dc7eb262fec1df113d4a5d2c732479125821f658e29fa6e738fe9052af059d1b329eba
|
7
|
+
data.tar.gz: 2244659492a5427f6d744ff58b257bb3dc4f11eaa33a829cd6166065b0f4a85f45ffd808a0d6133de74259dbd7b5d14839563648fe349fead4a3471fef0b5693
|
data/ChangeLog
CHANGED
@@ -1,6 +1,31 @@
|
|
1
|
+
2021-08-12 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* Added SDL 2.0.14 features (SDL_misc).
|
4
|
+
* Added SDL 2.0.16 features (SDL_sensor).
|
5
|
+
|
6
|
+
2021-02-21 vaiorabbit <http://twitter.com/vaiorabbit>
|
7
|
+
|
8
|
+
* Added defines from Audio, Mixer and TTF
|
9
|
+
|
10
|
+
2020-12-27 vaiorabbit <http://twitter.com/vaiorabbit>
|
11
|
+
|
12
|
+
* Added SDL 2.0.14 features.
|
13
|
+
* third_party/sdl2_build_dll.sh: Added to build x64 DLL for Windows
|
14
|
+
* test/util.rb: Added
|
15
|
+
|
16
|
+
2020-12-20 vaiorabbit <http://twitter.com/vaiorabbit>
|
17
|
+
|
18
|
+
* third_party/sdl2_build_dylib.sh: Added to build x86_64|arm64 Universal Binary
|
19
|
+
|
20
|
+
2020-06-08 vaiorabbit <http://twitter.com/vaiorabbit>
|
21
|
+
|
22
|
+
* lib/sdl2_syswm.rb: Added
|
23
|
+
* lib/sdl2_hints.rb: Added hint string symboles
|
24
|
+
|
1
25
|
2020-03-22 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
26
|
|
3
27
|
* Added SDL 2.0.12 features.
|
28
|
+
* Generate callback types correctly.
|
4
29
|
|
5
30
|
2019-10-27 vaiorabbit <http://twitter.com/vaiorabbit>
|
6
31
|
|
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
sdl2-bindings : Yet another SDL2 wrapper for Ruby
|
2
|
-
Copyright (c) 2015-
|
2
|
+
Copyright (c) 2015-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
3
3
|
|
4
4
|
This software is provided 'as-is', without any express or implied
|
5
5
|
warranty. In no event will the authors be held liable for any damages
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[Notice] Experimental project.
|
6
6
|
|
7
7
|
* Created : 2015-09-19
|
8
|
-
* Last modified :
|
8
|
+
* Last modified : 2021-08-12
|
9
9
|
|
10
10
|
## Features ##
|
11
11
|
|
@@ -30,13 +30,17 @@
|
|
30
30
|
* sdl2_ttf : 2.0.13
|
31
31
|
* [2019-08-31] SDL 2.0.10 (Installed via Homebrew)
|
32
32
|
* [2020-03-22] SDL 2.0.12 (Installed via Homebrew)
|
33
|
+
* [2020-12-27] SDL 2.0.14 (Installed via Homebrew)
|
34
|
+
* macOS Big Sur (11.0.1), ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
|
35
|
+
* [2021-08-12] SDL 2.0.16 (Installed via Homebrew)
|
36
|
+
* macOS Big Sur (11.5), ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]
|
33
37
|
|
34
38
|
## License ##
|
35
39
|
|
36
40
|
The zlib/libpng License ( http://opensource.org/licenses/Zlib ).
|
37
41
|
|
38
42
|
sdl2-bindings : Yet another SDL2 wrapper for Ruby
|
39
|
-
Copyright (c) 2015-
|
43
|
+
Copyright (c) 2015-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
40
44
|
|
41
45
|
This software is provided 'as-is', without any express or implied
|
42
46
|
warranty. In no event will the authors be held liable for any damages
|
data/lib/sdl2.rb
CHANGED
@@ -20,6 +20,7 @@ require_relative 'sdl2_keyboard.rb'
|
|
20
20
|
require_relative 'sdl2_keycode.rb'
|
21
21
|
require_relative 'sdl2_log.rb'
|
22
22
|
require_relative 'sdl2_messagebox.rb'
|
23
|
+
require_relative 'sdl2_misc.rb'
|
23
24
|
require_relative 'sdl2_mouse.rb'
|
24
25
|
require_relative 'sdl2_pixels.rb'
|
25
26
|
require_relative 'sdl2_platform.rb'
|
@@ -28,9 +29,11 @@ require_relative 'sdl2_rect.rb'
|
|
28
29
|
require_relative 'sdl2_render.rb'
|
29
30
|
require_relative 'sdl2_rwops.rb'
|
30
31
|
require_relative 'sdl2_scancode.rb'
|
32
|
+
require_relative 'sdl2_sensor.rb'
|
31
33
|
require_relative 'sdl2_shape.rb'
|
32
34
|
require_relative 'sdl2_stdinc.rb'
|
33
35
|
require_relative 'sdl2_surface.rb'
|
36
|
+
require_relative 'sdl2_syswm.rb'
|
34
37
|
require_relative 'sdl2_timer.rb'
|
35
38
|
require_relative 'sdl2_touch.rb'
|
36
39
|
require_relative 'sdl2_version.rb'
|
@@ -104,6 +107,7 @@ module SDL2
|
|
104
107
|
setup_keycode_symbols()
|
105
108
|
setup_log_symbols()
|
106
109
|
setup_messagebox_symbols()
|
110
|
+
setup_misc_symbols()
|
107
111
|
setup_mouse_symbols()
|
108
112
|
setup_pixels_symbols()
|
109
113
|
setup_platform_symbols()
|
@@ -112,8 +116,10 @@ module SDL2
|
|
112
116
|
setup_render_symbols()
|
113
117
|
setup_rwops_symbols()
|
114
118
|
setup_scancode_symbols()
|
119
|
+
setup_sensor_symbols()
|
115
120
|
setup_shape_symbols()
|
116
121
|
setup_surface_symbols()
|
122
|
+
setup_syswm_symbols()
|
117
123
|
setup_stdinc_symbols()
|
118
124
|
setup_timer_symbols()
|
119
125
|
setup_touch_symbols()
|
@@ -126,12 +132,10 @@ end
|
|
126
132
|
|
127
133
|
|
128
134
|
if __FILE__ == $0
|
129
|
-
# SDL2.load_lib('libSDL2.dylib')
|
130
|
-
# p SDL2.SDL_Init(SDL2::SDL_INIT_EVERYTHING)
|
131
135
|
SDL2.load_lib('libSDL2.dylib',
|
132
136
|
gfx_libpath: '/usr/local/lib/libSDL2_gfx.dylib'
|
133
137
|
)
|
134
|
-
|
138
|
+
|
135
139
|
success = SDL2.SDL_Init(SDL2::SDL_INIT_EVERYTHING)
|
136
140
|
exit if success < 0
|
137
141
|
|
data/lib/sdl2_audio.rb
CHANGED
@@ -14,10 +14,29 @@ module SDL2
|
|
14
14
|
SDL_AUDIO_MASK_DATATYPE = (1 << 8)
|
15
15
|
SDL_AUDIO_MASK_ENDIAN = (1 << 12)
|
16
16
|
SDL_AUDIO_MASK_SIGNED = (1 << 15)
|
17
|
+
AUDIO_U8 = 0x0008
|
18
|
+
AUDIO_S8 = 0x8008
|
19
|
+
AUDIO_U16LSB = 0x0010
|
20
|
+
AUDIO_S16LSB = 0x8010
|
21
|
+
AUDIO_U16MSB = 0x1010
|
22
|
+
AUDIO_S16MSB = 0x9010
|
23
|
+
AUDIO_U16 = AUDIO_U16LSB
|
24
|
+
AUDIO_S16 = AUDIO_S16LSB
|
25
|
+
AUDIO_S32LSB = 0x8020
|
26
|
+
AUDIO_S32MSB = 0x9020
|
27
|
+
AUDIO_S32 = AUDIO_S32LSB
|
28
|
+
AUDIO_F32LSB = 0x8120
|
29
|
+
AUDIO_F32MSB = 0x9120
|
30
|
+
AUDIO_F32 = AUDIO_F32LSB
|
31
|
+
AUDIO_U16SYS = AUDIO_U16LSB
|
32
|
+
AUDIO_S16SYS = AUDIO_S16LSB
|
33
|
+
AUDIO_S32SYS = AUDIO_S32LSB
|
34
|
+
AUDIO_F32SYS = AUDIO_F32LSB
|
17
35
|
SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
|
18
36
|
SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
|
19
37
|
SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
|
20
38
|
SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
|
39
|
+
SDL_AUDIO_ALLOW_ANY_CHANGE = (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_FORMAT_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE | SDL_AUDIO_ALLOW_SAMPLES_CHANGE)
|
21
40
|
SDL_AUDIOCVT_MAX_FILTERS = 9
|
22
41
|
SDL_MIX_MAXVOLUME = 128
|
23
42
|
|
@@ -80,6 +99,7 @@ module SDL2
|
|
80
99
|
:SDL_OpenAudio,
|
81
100
|
:SDL_GetNumAudioDevices,
|
82
101
|
:SDL_GetAudioDeviceName,
|
102
|
+
:SDL_GetAudioDeviceSpec,
|
83
103
|
:SDL_OpenAudioDevice,
|
84
104
|
:SDL_GetAudioStatus,
|
85
105
|
:SDL_GetAudioDeviceStatus,
|
@@ -118,6 +138,7 @@ module SDL2
|
|
118
138
|
:SDL_OpenAudio => [:pointer, :pointer],
|
119
139
|
:SDL_GetNumAudioDevices => [:int],
|
120
140
|
:SDL_GetAudioDeviceName => [:int, :int],
|
141
|
+
:SDL_GetAudioDeviceSpec => [:int, :int, :pointer],
|
121
142
|
:SDL_OpenAudioDevice => [:pointer, :int, :pointer, :pointer, :int],
|
122
143
|
:SDL_GetAudioStatus => [],
|
123
144
|
:SDL_GetAudioDeviceStatus => [:uint],
|
@@ -156,6 +177,7 @@ module SDL2
|
|
156
177
|
:SDL_OpenAudio => :int,
|
157
178
|
:SDL_GetNumAudioDevices => :int,
|
158
179
|
:SDL_GetAudioDeviceName => :pointer,
|
180
|
+
:SDL_GetAudioDeviceSpec => :int,
|
159
181
|
:SDL_OpenAudioDevice => :uint,
|
160
182
|
:SDL_GetAudioStatus => :int,
|
161
183
|
:SDL_GetAudioDeviceStatus => :int,
|
data/lib/sdl2_cpuinfo.rb
CHANGED
@@ -44,6 +44,7 @@ module SDL2
|
|
44
44
|
:SDL_GetSystemRAM,
|
45
45
|
:SDL_SIMDGetAlignment,
|
46
46
|
:SDL_SIMDAlloc,
|
47
|
+
:SDL_SIMDRealloc,
|
47
48
|
:SDL_SIMDFree,
|
48
49
|
]
|
49
50
|
args = {
|
@@ -66,6 +67,7 @@ module SDL2
|
|
66
67
|
:SDL_GetSystemRAM => [],
|
67
68
|
:SDL_SIMDGetAlignment => [],
|
68
69
|
:SDL_SIMDAlloc => [:ulong],
|
70
|
+
:SDL_SIMDRealloc => [:pointer, :ulong],
|
69
71
|
:SDL_SIMDFree => [:pointer],
|
70
72
|
}
|
71
73
|
retvals = {
|
@@ -88,6 +90,7 @@ module SDL2
|
|
88
90
|
:SDL_GetSystemRAM => :int,
|
89
91
|
:SDL_SIMDGetAlignment => :size_t,
|
90
92
|
:SDL_SIMDAlloc => :pointer,
|
93
|
+
:SDL_SIMDRealloc => :pointer,
|
91
94
|
:SDL_SIMDFree => :void,
|
92
95
|
}
|
93
96
|
symbols.each do |sym|
|
data/lib/sdl2_error.rb
CHANGED
@@ -33,18 +33,21 @@ module SDL2
|
|
33
33
|
symbols = [
|
34
34
|
:SDL_SetError,
|
35
35
|
:SDL_GetError,
|
36
|
+
:SDL_GetErrorMsg,
|
36
37
|
:SDL_ClearError,
|
37
38
|
:SDL_Error,
|
38
39
|
]
|
39
40
|
args = {
|
40
41
|
:SDL_SetError => [:pointer],
|
41
42
|
:SDL_GetError => [],
|
43
|
+
:SDL_GetErrorMsg => [:pointer, :int],
|
42
44
|
:SDL_ClearError => [],
|
43
45
|
:SDL_Error => [:int],
|
44
46
|
}
|
45
47
|
retvals = {
|
46
48
|
:SDL_SetError => :int,
|
47
49
|
:SDL_GetError => :pointer,
|
50
|
+
:SDL_GetErrorMsg => :pointer,
|
48
51
|
:SDL_ClearError => :void,
|
49
52
|
:SDL_Error => :int,
|
50
53
|
}
|
data/lib/sdl2_events.rb
CHANGED
@@ -14,7 +14,7 @@ module SDL2
|
|
14
14
|
SDL_RELEASED = 0
|
15
15
|
SDL_PRESSED = 1
|
16
16
|
SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32
|
17
|
-
SDL_TEXTINPUTEVENT_TEXT_SIZE =
|
17
|
+
SDL_TEXTINPUTEVENT_TEXT_SIZE = 32
|
18
18
|
SDL_QUERY = -1
|
19
19
|
SDL_IGNORE = 0
|
20
20
|
SDL_DISABLE = 0
|
@@ -30,6 +30,7 @@ module SDL2
|
|
30
30
|
SDL_APP_DIDENTERBACKGROUND = 260
|
31
31
|
SDL_APP_WILLENTERFOREGROUND = 261
|
32
32
|
SDL_APP_DIDENTERFOREGROUND = 262
|
33
|
+
SDL_LOCALECHANGED = 263
|
33
34
|
SDL_DISPLAYEVENT = 336
|
34
35
|
SDL_WINDOWEVENT = 512
|
35
36
|
SDL_SYSWMEVENT = 513
|
@@ -55,6 +56,10 @@ module SDL2
|
|
55
56
|
SDL_CONTROLLERDEVICEADDED = 1619
|
56
57
|
SDL_CONTROLLERDEVICEREMOVED = 1620
|
57
58
|
SDL_CONTROLLERDEVICEREMAPPED = 1621
|
59
|
+
SDL_CONTROLLERTOUCHPADDOWN = 1622
|
60
|
+
SDL_CONTROLLERTOUCHPADMOTION = 1623
|
61
|
+
SDL_CONTROLLERTOUCHPADUP = 1624
|
62
|
+
SDL_CONTROLLERSENSORUPDATE = 1625
|
58
63
|
SDL_FINGERDOWN = 1792
|
59
64
|
SDL_FINGERUP = 1793
|
60
65
|
SDL_FINGERMOTION = 1794
|
@@ -288,6 +293,29 @@ module SDL2
|
|
288
293
|
)
|
289
294
|
end
|
290
295
|
|
296
|
+
class SDL_ControllerTouchpadEvent < FFI::Struct
|
297
|
+
layout(
|
298
|
+
:type, :uint,
|
299
|
+
:timestamp, :uint,
|
300
|
+
:which, :int,
|
301
|
+
:touchpad, :int,
|
302
|
+
:finger, :int,
|
303
|
+
:x, :float,
|
304
|
+
:y, :float,
|
305
|
+
:pressure, :float,
|
306
|
+
)
|
307
|
+
end
|
308
|
+
|
309
|
+
class SDL_ControllerSensorEvent < FFI::Struct
|
310
|
+
layout(
|
311
|
+
:type, :uint,
|
312
|
+
:timestamp, :uint,
|
313
|
+
:which, :int,
|
314
|
+
:sensor, :int,
|
315
|
+
:data, [:float, 3],
|
316
|
+
)
|
317
|
+
end
|
318
|
+
|
291
319
|
class SDL_AudioDeviceEvent < FFI::Struct
|
292
320
|
layout(
|
293
321
|
:type, :uint,
|
@@ -413,6 +441,8 @@ module SDL2
|
|
413
441
|
:caxis, SDL_ControllerAxisEvent,
|
414
442
|
:cbutton, SDL_ControllerButtonEvent,
|
415
443
|
:cdevice, SDL_ControllerDeviceEvent,
|
444
|
+
:ctouchpad, SDL_ControllerTouchpadEvent,
|
445
|
+
:csensor, SDL_ControllerSensorEvent,
|
416
446
|
:adevice, SDL_AudioDeviceEvent,
|
417
447
|
:sensor, SDL_SensorEvent,
|
418
448
|
:quit, SDL_QuitEvent,
|
@@ -460,11 +490,11 @@ module SDL2
|
|
460
490
|
:SDL_WaitEvent => [:pointer],
|
461
491
|
:SDL_WaitEventTimeout => [:pointer, :int],
|
462
492
|
:SDL_PushEvent => [:pointer],
|
463
|
-
:SDL_SetEventFilter => [:
|
493
|
+
:SDL_SetEventFilter => [:SDL_EventFilter, :pointer],
|
464
494
|
:SDL_GetEventFilter => [:pointer, :pointer],
|
465
|
-
:SDL_AddEventWatch => [:
|
466
|
-
:SDL_DelEventWatch => [:
|
467
|
-
:SDL_FilterEvents => [:
|
495
|
+
:SDL_AddEventWatch => [:SDL_EventFilter, :pointer],
|
496
|
+
:SDL_DelEventWatch => [:SDL_EventFilter, :pointer],
|
497
|
+
:SDL_FilterEvents => [:SDL_EventFilter, :pointer],
|
468
498
|
:SDL_EventState => [:uint, :int],
|
469
499
|
:SDL_RegisterEvents => [:int],
|
470
500
|
}
|
data/lib/sdl2_gamecontroller.rb
CHANGED
@@ -20,6 +20,10 @@ module SDL2
|
|
20
20
|
SDL_CONTROLLER_TYPE_PS3 = 3
|
21
21
|
SDL_CONTROLLER_TYPE_PS4 = 4
|
22
22
|
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO = 5
|
23
|
+
SDL_CONTROLLER_TYPE_VIRTUAL = 6
|
24
|
+
SDL_CONTROLLER_TYPE_PS5 = 7
|
25
|
+
SDL_CONTROLLER_TYPE_AMAZON_LUNA = 8
|
26
|
+
SDL_CONTROLLER_TYPE_GOOGLE_STADIA = 9
|
23
27
|
SDL_CONTROLLER_BINDTYPE_NONE = 0
|
24
28
|
SDL_CONTROLLER_BINDTYPE_BUTTON = 1
|
25
29
|
SDL_CONTROLLER_BINDTYPE_AXIS = 2
|
@@ -48,7 +52,13 @@ module SDL2
|
|
48
52
|
SDL_CONTROLLER_BUTTON_DPAD_DOWN = 12
|
49
53
|
SDL_CONTROLLER_BUTTON_DPAD_LEFT = 13
|
50
54
|
SDL_CONTROLLER_BUTTON_DPAD_RIGHT = 14
|
51
|
-
|
55
|
+
SDL_CONTROLLER_BUTTON_MISC1 = 15
|
56
|
+
SDL_CONTROLLER_BUTTON_PADDLE1 = 16
|
57
|
+
SDL_CONTROLLER_BUTTON_PADDLE2 = 17
|
58
|
+
SDL_CONTROLLER_BUTTON_PADDLE3 = 18
|
59
|
+
SDL_CONTROLLER_BUTTON_PADDLE4 = 19
|
60
|
+
SDL_CONTROLLER_BUTTON_TOUCHPAD = 20
|
61
|
+
SDL_CONTROLLER_BUTTON_MAX = 21
|
52
62
|
|
53
63
|
# Typedef
|
54
64
|
|
@@ -107,6 +117,7 @@ module SDL2
|
|
107
117
|
:SDL_GameControllerGetVendor,
|
108
118
|
:SDL_GameControllerGetProduct,
|
109
119
|
:SDL_GameControllerGetProductVersion,
|
120
|
+
:SDL_GameControllerGetSerial,
|
110
121
|
:SDL_GameControllerGetAttached,
|
111
122
|
:SDL_GameControllerGetJoystick,
|
112
123
|
:SDL_GameControllerEventState,
|
@@ -114,12 +125,26 @@ module SDL2
|
|
114
125
|
:SDL_GameControllerGetAxisFromString,
|
115
126
|
:SDL_GameControllerGetStringForAxis,
|
116
127
|
:SDL_GameControllerGetBindForAxis,
|
128
|
+
:SDL_GameControllerHasAxis,
|
117
129
|
:SDL_GameControllerGetAxis,
|
118
130
|
:SDL_GameControllerGetButtonFromString,
|
119
131
|
:SDL_GameControllerGetStringForButton,
|
120
132
|
:SDL_GameControllerGetBindForButton,
|
133
|
+
:SDL_GameControllerHasButton,
|
121
134
|
:SDL_GameControllerGetButton,
|
135
|
+
:SDL_GameControllerGetNumTouchpads,
|
136
|
+
:SDL_GameControllerGetNumTouchpadFingers,
|
137
|
+
:SDL_GameControllerGetTouchpadFinger,
|
138
|
+
:SDL_GameControllerHasSensor,
|
139
|
+
:SDL_GameControllerSetSensorEnabled,
|
140
|
+
:SDL_GameControllerIsSensorEnabled,
|
141
|
+
:SDL_GameControllerGetSensorDataRate,
|
142
|
+
:SDL_GameControllerGetSensorData,
|
122
143
|
:SDL_GameControllerRumble,
|
144
|
+
:SDL_GameControllerRumbleTriggers,
|
145
|
+
:SDL_GameControllerHasLED,
|
146
|
+
:SDL_GameControllerSetLED,
|
147
|
+
:SDL_GameControllerSendEffect,
|
123
148
|
:SDL_GameControllerClose,
|
124
149
|
]
|
125
150
|
args = {
|
@@ -143,6 +168,7 @@ module SDL2
|
|
143
168
|
:SDL_GameControllerGetVendor => [:pointer],
|
144
169
|
:SDL_GameControllerGetProduct => [:pointer],
|
145
170
|
:SDL_GameControllerGetProductVersion => [:pointer],
|
171
|
+
:SDL_GameControllerGetSerial => [:pointer],
|
146
172
|
:SDL_GameControllerGetAttached => [:pointer],
|
147
173
|
:SDL_GameControllerGetJoystick => [:pointer],
|
148
174
|
:SDL_GameControllerEventState => [:int],
|
@@ -150,12 +176,26 @@ module SDL2
|
|
150
176
|
:SDL_GameControllerGetAxisFromString => [:pointer],
|
151
177
|
:SDL_GameControllerGetStringForAxis => [:int],
|
152
178
|
:SDL_GameControllerGetBindForAxis => [:pointer, :int],
|
179
|
+
:SDL_GameControllerHasAxis => [:pointer, :int],
|
153
180
|
:SDL_GameControllerGetAxis => [:pointer, :int],
|
154
181
|
:SDL_GameControllerGetButtonFromString => [:pointer],
|
155
182
|
:SDL_GameControllerGetStringForButton => [:int],
|
156
183
|
:SDL_GameControllerGetBindForButton => [:pointer, :int],
|
184
|
+
:SDL_GameControllerHasButton => [:pointer, :int],
|
157
185
|
:SDL_GameControllerGetButton => [:pointer, :int],
|
186
|
+
:SDL_GameControllerGetNumTouchpads => [:pointer],
|
187
|
+
:SDL_GameControllerGetNumTouchpadFingers => [:pointer, :int],
|
188
|
+
:SDL_GameControllerGetTouchpadFinger => [:pointer, :int, :int, :pointer, :pointer, :pointer, :pointer],
|
189
|
+
:SDL_GameControllerHasSensor => [:pointer, :int],
|
190
|
+
:SDL_GameControllerSetSensorEnabled => [:pointer, :int, :int],
|
191
|
+
:SDL_GameControllerIsSensorEnabled => [:pointer, :int],
|
192
|
+
:SDL_GameControllerGetSensorDataRate => [:pointer, :int],
|
193
|
+
:SDL_GameControllerGetSensorData => [:pointer, :int, :pointer, :int],
|
158
194
|
:SDL_GameControllerRumble => [:pointer, :ushort, :ushort, :uint],
|
195
|
+
:SDL_GameControllerRumbleTriggers => [:pointer, :ushort, :ushort, :uint],
|
196
|
+
:SDL_GameControllerHasLED => [:pointer],
|
197
|
+
:SDL_GameControllerSetLED => [:pointer, :uchar, :uchar, :uchar],
|
198
|
+
:SDL_GameControllerSendEffect => [:pointer, :pointer, :int],
|
159
199
|
:SDL_GameControllerClose => [:pointer],
|
160
200
|
}
|
161
201
|
retvals = {
|
@@ -179,6 +219,7 @@ module SDL2
|
|
179
219
|
:SDL_GameControllerGetVendor => :ushort,
|
180
220
|
:SDL_GameControllerGetProduct => :ushort,
|
181
221
|
:SDL_GameControllerGetProductVersion => :ushort,
|
222
|
+
:SDL_GameControllerGetSerial => :pointer,
|
182
223
|
:SDL_GameControllerGetAttached => :int,
|
183
224
|
:SDL_GameControllerGetJoystick => :pointer,
|
184
225
|
:SDL_GameControllerEventState => :int,
|
@@ -186,12 +227,26 @@ module SDL2
|
|
186
227
|
:SDL_GameControllerGetAxisFromString => :int,
|
187
228
|
:SDL_GameControllerGetStringForAxis => :pointer,
|
188
229
|
:SDL_GameControllerGetBindForAxis => SDL_GameControllerButtonBind,
|
230
|
+
:SDL_GameControllerHasAxis => :int,
|
189
231
|
:SDL_GameControllerGetAxis => :short,
|
190
232
|
:SDL_GameControllerGetButtonFromString => :int,
|
191
233
|
:SDL_GameControllerGetStringForButton => :pointer,
|
192
234
|
:SDL_GameControllerGetBindForButton => SDL_GameControllerButtonBind,
|
235
|
+
:SDL_GameControllerHasButton => :int,
|
193
236
|
:SDL_GameControllerGetButton => :uchar,
|
237
|
+
:SDL_GameControllerGetNumTouchpads => :int,
|
238
|
+
:SDL_GameControllerGetNumTouchpadFingers => :int,
|
239
|
+
:SDL_GameControllerGetTouchpadFinger => :int,
|
240
|
+
:SDL_GameControllerHasSensor => :int,
|
241
|
+
:SDL_GameControllerSetSensorEnabled => :int,
|
242
|
+
:SDL_GameControllerIsSensorEnabled => :int,
|
243
|
+
:SDL_GameControllerGetSensorDataRate => :float,
|
244
|
+
:SDL_GameControllerGetSensorData => :int,
|
194
245
|
:SDL_GameControllerRumble => :int,
|
246
|
+
:SDL_GameControllerRumbleTriggers => :int,
|
247
|
+
:SDL_GameControllerHasLED => :int,
|
248
|
+
:SDL_GameControllerSetLED => :int,
|
249
|
+
:SDL_GameControllerSendEffect => :int,
|
195
250
|
:SDL_GameControllerClose => :void,
|
196
251
|
}
|
197
252
|
symbols.each do |sym|
|