sdl2-bindings 0.0.9 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +129 -96
- data/LICENSE.txt +0 -0
- data/README.md +78 -55
- 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 -198
- 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 +242 -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 -157
- 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 +18 -3
data/lib/sdl2_mixer.rb
CHANGED
@@ -1,317 +1,392 @@
|
|
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
|
-
|
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
|
-
:
|
123
|
-
:
|
124
|
-
:
|
125
|
-
:
|
126
|
-
:
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
:
|
135
|
-
:
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
:
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
|
148
|
-
|
149
|
-
:
|
150
|
-
|
151
|
-
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
:
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
159
|
-
:
|
160
|
-
:
|
161
|
-
:
|
162
|
-
:
|
163
|
-
:
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
:
|
168
|
-
:
|
169
|
-
:
|
170
|
-
:
|
171
|
-
:
|
172
|
-
:
|
173
|
-
:
|
174
|
-
:
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
:
|
179
|
-
:
|
180
|
-
:
|
181
|
-
:
|
182
|
-
:
|
183
|
-
:
|
184
|
-
:
|
185
|
-
:
|
186
|
-
:
|
187
|
-
:
|
188
|
-
:
|
189
|
-
:
|
190
|
-
:
|
191
|
-
:
|
192
|
-
:
|
193
|
-
:
|
194
|
-
:
|
195
|
-
:
|
196
|
-
:
|
197
|
-
:
|
198
|
-
:
|
199
|
-
:
|
200
|
-
:
|
201
|
-
:
|
202
|
-
:
|
203
|
-
:
|
204
|
-
:
|
205
|
-
:
|
206
|
-
:
|
207
|
-
:
|
208
|
-
:
|
209
|
-
:
|
210
|
-
:
|
211
|
-
:
|
212
|
-
:
|
213
|
-
:
|
214
|
-
:
|
215
|
-
:
|
216
|
-
:
|
217
|
-
:
|
218
|
-
:
|
219
|
-
:
|
220
|
-
:
|
221
|
-
:
|
222
|
-
:
|
223
|
-
:
|
224
|
-
:
|
225
|
-
|
226
|
-
|
227
|
-
:
|
228
|
-
|
229
|
-
|
230
|
-
:
|
231
|
-
:
|
232
|
-
:
|
233
|
-
:
|
234
|
-
:
|
235
|
-
:
|
236
|
-
:
|
237
|
-
:
|
238
|
-
:
|
239
|
-
:
|
240
|
-
:
|
241
|
-
:
|
242
|
-
:
|
243
|
-
:
|
244
|
-
:
|
245
|
-
:
|
246
|
-
:
|
247
|
-
:
|
248
|
-
:
|
249
|
-
:
|
250
|
-
:
|
251
|
-
:
|
252
|
-
:
|
253
|
-
:
|
254
|
-
:
|
255
|
-
:
|
256
|
-
:
|
257
|
-
:
|
258
|
-
:
|
259
|
-
:
|
260
|
-
:
|
261
|
-
:
|
262
|
-
:
|
263
|
-
:
|
264
|
-
:
|
265
|
-
:
|
266
|
-
:
|
267
|
-
:
|
268
|
-
:
|
269
|
-
:
|
270
|
-
:
|
271
|
-
:
|
272
|
-
:
|
273
|
-
:
|
274
|
-
:
|
275
|
-
:
|
276
|
-
:
|
277
|
-
:
|
278
|
-
:
|
279
|
-
:
|
280
|
-
:
|
281
|
-
:
|
282
|
-
:
|
283
|
-
:
|
284
|
-
:
|
285
|
-
:
|
286
|
-
:
|
287
|
-
:
|
288
|
-
:
|
289
|
-
:
|
290
|
-
:
|
291
|
-
:
|
292
|
-
:
|
293
|
-
:
|
294
|
-
:
|
295
|
-
:
|
296
|
-
:
|
297
|
-
:
|
298
|
-
:
|
299
|
-
:
|
300
|
-
:
|
301
|
-
:
|
302
|
-
:
|
303
|
-
|
304
|
-
|
305
|
-
:
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
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
|
+
MIXER_MAJOR_VERSION = 2
|
14
|
+
MIXER_MINOR_VERSION = 0
|
15
|
+
MIXER_PATCHLEVEL = 4
|
16
|
+
MIX_CHANNELS = 8
|
17
|
+
MIX_DEFAULT_FREQUENCY = 22050
|
18
|
+
MIX_DEFAULT_FORMAT = AUDIO_S16LSB
|
19
|
+
MIX_DEFAULT_CHANNELS = 2
|
20
|
+
MIX_MAX_VOLUME = MIX_MAXVOLUME
|
21
|
+
MIX_CHANNEL_POST = -2
|
22
|
+
MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED"
|
23
|
+
|
24
|
+
# Enum
|
25
|
+
|
26
|
+
MIX_INIT_FLAC = 1
|
27
|
+
MIX_INIT_MOD = 2
|
28
|
+
MIX_INIT_MP3 = 8
|
29
|
+
MIX_INIT_OGG = 16
|
30
|
+
MIX_INIT_MID = 32
|
31
|
+
MIX_INIT_OPUS = 64
|
32
|
+
MIX_NO_FADING = 0
|
33
|
+
MIX_FADING_OUT = 1
|
34
|
+
MIX_FADING_IN = 2
|
35
|
+
MUS_NONE = 0
|
36
|
+
MUS_CMD = 1
|
37
|
+
MUS_WAV = 2
|
38
|
+
MUS_MOD = 3
|
39
|
+
MUS_MID = 4
|
40
|
+
MUS_OGG = 5
|
41
|
+
MUS_MP3 = 6
|
42
|
+
MUS_MP3_MAD_UNUSED = 7
|
43
|
+
MUS_FLAC = 8
|
44
|
+
MUS_MODPLUG_UNUSED = 9
|
45
|
+
MUS_OPUS = 10
|
46
|
+
|
47
|
+
# Typedef
|
48
|
+
|
49
|
+
typedef :int, :MIX_InitFlags
|
50
|
+
typedef :int, :Mix_Fading
|
51
|
+
typedef :int, :Mix_MusicType
|
52
|
+
callback :Mix_EffectFunc_t, [:int, :pointer, :int, :pointer], :void
|
53
|
+
callback :Mix_EffectDone_t, [:int, :pointer], :void
|
54
|
+
|
55
|
+
# Struct
|
56
|
+
|
57
|
+
class Mix_Chunk < FFI::Struct
|
58
|
+
layout(
|
59
|
+
:allocated, :int,
|
60
|
+
:abuf, :pointer,
|
61
|
+
:alen, :uint,
|
62
|
+
:volume, :uchar,
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
# Function
|
68
|
+
|
69
|
+
def self.setup_mixer_symbols(output_error = false)
|
70
|
+
symbols = [
|
71
|
+
:Mix_Linked_Version,
|
72
|
+
:Mix_Init,
|
73
|
+
:Mix_Quit,
|
74
|
+
:Mix_OpenAudio,
|
75
|
+
:Mix_OpenAudioDevice,
|
76
|
+
:Mix_AllocateChannels,
|
77
|
+
:Mix_QuerySpec,
|
78
|
+
:Mix_LoadWAV_RW,
|
79
|
+
:Mix_LoadMUS,
|
80
|
+
:Mix_LoadMUS_RW,
|
81
|
+
:Mix_LoadMUSType_RW,
|
82
|
+
:Mix_QuickLoad_WAV,
|
83
|
+
:Mix_QuickLoad_RAW,
|
84
|
+
:Mix_FreeChunk,
|
85
|
+
:Mix_FreeMusic,
|
86
|
+
:Mix_GetNumChunkDecoders,
|
87
|
+
:Mix_GetChunkDecoder,
|
88
|
+
:Mix_HasChunkDecoder,
|
89
|
+
:Mix_GetNumMusicDecoders,
|
90
|
+
:Mix_GetMusicDecoder,
|
91
|
+
:Mix_HasMusicDecoder,
|
92
|
+
:Mix_GetMusicType,
|
93
|
+
:Mix_SetPostMix,
|
94
|
+
:Mix_HookMusic,
|
95
|
+
:Mix_HookMusicFinished,
|
96
|
+
:Mix_GetMusicHookData,
|
97
|
+
:Mix_ChannelFinished,
|
98
|
+
:Mix_RegisterEffect,
|
99
|
+
:Mix_UnregisterEffect,
|
100
|
+
:Mix_UnregisterAllEffects,
|
101
|
+
:Mix_SetPanning,
|
102
|
+
:Mix_SetPosition,
|
103
|
+
:Mix_SetDistance,
|
104
|
+
:Mix_SetReverseStereo,
|
105
|
+
:Mix_ReserveChannels,
|
106
|
+
:Mix_GroupChannel,
|
107
|
+
:Mix_GroupChannels,
|
108
|
+
:Mix_GroupAvailable,
|
109
|
+
:Mix_GroupCount,
|
110
|
+
:Mix_GroupOldest,
|
111
|
+
:Mix_GroupNewer,
|
112
|
+
:Mix_PlayChannelTimed,
|
113
|
+
:Mix_PlayMusic,
|
114
|
+
:Mix_FadeInMusic,
|
115
|
+
:Mix_FadeInMusicPos,
|
116
|
+
:Mix_FadeInChannelTimed,
|
117
|
+
:Mix_Volume,
|
118
|
+
:Mix_VolumeChunk,
|
119
|
+
:Mix_VolumeMusic,
|
120
|
+
:Mix_HaltChannel,
|
121
|
+
:Mix_HaltGroup,
|
122
|
+
:Mix_HaltMusic,
|
123
|
+
:Mix_ExpireChannel,
|
124
|
+
:Mix_FadeOutChannel,
|
125
|
+
:Mix_FadeOutGroup,
|
126
|
+
:Mix_FadeOutMusic,
|
127
|
+
:Mix_FadingMusic,
|
128
|
+
:Mix_FadingChannel,
|
129
|
+
:Mix_Pause,
|
130
|
+
:Mix_Resume,
|
131
|
+
:Mix_Paused,
|
132
|
+
:Mix_PauseMusic,
|
133
|
+
:Mix_ResumeMusic,
|
134
|
+
:Mix_RewindMusic,
|
135
|
+
:Mix_PausedMusic,
|
136
|
+
:Mix_SetMusicPosition,
|
137
|
+
:Mix_Playing,
|
138
|
+
:Mix_PlayingMusic,
|
139
|
+
:Mix_SetMusicCMD,
|
140
|
+
:Mix_SetSynchroValue,
|
141
|
+
:Mix_GetSynchroValue,
|
142
|
+
:Mix_SetSoundFonts,
|
143
|
+
:Mix_GetSoundFonts,
|
144
|
+
:Mix_EachSoundFont,
|
145
|
+
:Mix_GetChunk,
|
146
|
+
:Mix_CloseAudio,
|
147
|
+
]
|
148
|
+
apis = {
|
149
|
+
:Mix_Linked_Version => :Mix_Linked_Version,
|
150
|
+
:Mix_Init => :Mix_Init,
|
151
|
+
:Mix_Quit => :Mix_Quit,
|
152
|
+
:Mix_OpenAudio => :Mix_OpenAudio,
|
153
|
+
:Mix_OpenAudioDevice => :Mix_OpenAudioDevice,
|
154
|
+
:Mix_AllocateChannels => :Mix_AllocateChannels,
|
155
|
+
:Mix_QuerySpec => :Mix_QuerySpec,
|
156
|
+
:Mix_LoadWAV_RW => :Mix_LoadWAV_RW,
|
157
|
+
:Mix_LoadMUS => :Mix_LoadMUS,
|
158
|
+
:Mix_LoadMUS_RW => :Mix_LoadMUS_RW,
|
159
|
+
:Mix_LoadMUSType_RW => :Mix_LoadMUSType_RW,
|
160
|
+
:Mix_QuickLoad_WAV => :Mix_QuickLoad_WAV,
|
161
|
+
:Mix_QuickLoad_RAW => :Mix_QuickLoad_RAW,
|
162
|
+
:Mix_FreeChunk => :Mix_FreeChunk,
|
163
|
+
:Mix_FreeMusic => :Mix_FreeMusic,
|
164
|
+
:Mix_GetNumChunkDecoders => :Mix_GetNumChunkDecoders,
|
165
|
+
:Mix_GetChunkDecoder => :Mix_GetChunkDecoder,
|
166
|
+
:Mix_HasChunkDecoder => :Mix_HasChunkDecoder,
|
167
|
+
:Mix_GetNumMusicDecoders => :Mix_GetNumMusicDecoders,
|
168
|
+
:Mix_GetMusicDecoder => :Mix_GetMusicDecoder,
|
169
|
+
:Mix_HasMusicDecoder => :Mix_HasMusicDecoder,
|
170
|
+
:Mix_GetMusicType => :Mix_GetMusicType,
|
171
|
+
:Mix_SetPostMix => :Mix_SetPostMix,
|
172
|
+
:Mix_HookMusic => :Mix_HookMusic,
|
173
|
+
:Mix_HookMusicFinished => :Mix_HookMusicFinished,
|
174
|
+
:Mix_GetMusicHookData => :Mix_GetMusicHookData,
|
175
|
+
:Mix_ChannelFinished => :Mix_ChannelFinished,
|
176
|
+
:Mix_RegisterEffect => :Mix_RegisterEffect,
|
177
|
+
:Mix_UnregisterEffect => :Mix_UnregisterEffect,
|
178
|
+
:Mix_UnregisterAllEffects => :Mix_UnregisterAllEffects,
|
179
|
+
:Mix_SetPanning => :Mix_SetPanning,
|
180
|
+
:Mix_SetPosition => :Mix_SetPosition,
|
181
|
+
:Mix_SetDistance => :Mix_SetDistance,
|
182
|
+
:Mix_SetReverseStereo => :Mix_SetReverseStereo,
|
183
|
+
:Mix_ReserveChannels => :Mix_ReserveChannels,
|
184
|
+
:Mix_GroupChannel => :Mix_GroupChannel,
|
185
|
+
:Mix_GroupChannels => :Mix_GroupChannels,
|
186
|
+
:Mix_GroupAvailable => :Mix_GroupAvailable,
|
187
|
+
:Mix_GroupCount => :Mix_GroupCount,
|
188
|
+
:Mix_GroupOldest => :Mix_GroupOldest,
|
189
|
+
:Mix_GroupNewer => :Mix_GroupNewer,
|
190
|
+
:Mix_PlayChannelTimed => :Mix_PlayChannelTimed,
|
191
|
+
:Mix_PlayMusic => :Mix_PlayMusic,
|
192
|
+
:Mix_FadeInMusic => :Mix_FadeInMusic,
|
193
|
+
:Mix_FadeInMusicPos => :Mix_FadeInMusicPos,
|
194
|
+
:Mix_FadeInChannelTimed => :Mix_FadeInChannelTimed,
|
195
|
+
:Mix_Volume => :Mix_Volume,
|
196
|
+
:Mix_VolumeChunk => :Mix_VolumeChunk,
|
197
|
+
:Mix_VolumeMusic => :Mix_VolumeMusic,
|
198
|
+
:Mix_HaltChannel => :Mix_HaltChannel,
|
199
|
+
:Mix_HaltGroup => :Mix_HaltGroup,
|
200
|
+
:Mix_HaltMusic => :Mix_HaltMusic,
|
201
|
+
:Mix_ExpireChannel => :Mix_ExpireChannel,
|
202
|
+
:Mix_FadeOutChannel => :Mix_FadeOutChannel,
|
203
|
+
:Mix_FadeOutGroup => :Mix_FadeOutGroup,
|
204
|
+
:Mix_FadeOutMusic => :Mix_FadeOutMusic,
|
205
|
+
:Mix_FadingMusic => :Mix_FadingMusic,
|
206
|
+
:Mix_FadingChannel => :Mix_FadingChannel,
|
207
|
+
:Mix_Pause => :Mix_Pause,
|
208
|
+
:Mix_Resume => :Mix_Resume,
|
209
|
+
:Mix_Paused => :Mix_Paused,
|
210
|
+
:Mix_PauseMusic => :Mix_PauseMusic,
|
211
|
+
:Mix_ResumeMusic => :Mix_ResumeMusic,
|
212
|
+
:Mix_RewindMusic => :Mix_RewindMusic,
|
213
|
+
:Mix_PausedMusic => :Mix_PausedMusic,
|
214
|
+
:Mix_SetMusicPosition => :Mix_SetMusicPosition,
|
215
|
+
:Mix_Playing => :Mix_Playing,
|
216
|
+
:Mix_PlayingMusic => :Mix_PlayingMusic,
|
217
|
+
:Mix_SetMusicCMD => :Mix_SetMusicCMD,
|
218
|
+
:Mix_SetSynchroValue => :Mix_SetSynchroValue,
|
219
|
+
:Mix_GetSynchroValue => :Mix_GetSynchroValue,
|
220
|
+
:Mix_SetSoundFonts => :Mix_SetSoundFonts,
|
221
|
+
:Mix_GetSoundFonts => :Mix_GetSoundFonts,
|
222
|
+
:Mix_EachSoundFont => :Mix_EachSoundFont,
|
223
|
+
:Mix_GetChunk => :Mix_GetChunk,
|
224
|
+
:Mix_CloseAudio => :Mix_CloseAudio,
|
225
|
+
}
|
226
|
+
args = {
|
227
|
+
:Mix_Linked_Version => [],
|
228
|
+
:Mix_Init => [:int],
|
229
|
+
:Mix_Quit => [],
|
230
|
+
:Mix_OpenAudio => [:int, :ushort, :int, :int],
|
231
|
+
:Mix_OpenAudioDevice => [:int, :ushort, :int, :int, :pointer, :int],
|
232
|
+
:Mix_AllocateChannels => [:int],
|
233
|
+
:Mix_QuerySpec => [:pointer, :pointer, :pointer],
|
234
|
+
:Mix_LoadWAV_RW => [:pointer, :int],
|
235
|
+
:Mix_LoadMUS => [:pointer],
|
236
|
+
:Mix_LoadMUS_RW => [:pointer, :int],
|
237
|
+
:Mix_LoadMUSType_RW => [:pointer, :int, :int],
|
238
|
+
:Mix_QuickLoad_WAV => [:pointer],
|
239
|
+
:Mix_QuickLoad_RAW => [:pointer, :uint],
|
240
|
+
:Mix_FreeChunk => [:pointer],
|
241
|
+
:Mix_FreeMusic => [:pointer],
|
242
|
+
:Mix_GetNumChunkDecoders => [],
|
243
|
+
:Mix_GetChunkDecoder => [:int],
|
244
|
+
:Mix_HasChunkDecoder => [:pointer],
|
245
|
+
:Mix_GetNumMusicDecoders => [],
|
246
|
+
:Mix_GetMusicDecoder => [:int],
|
247
|
+
:Mix_HasMusicDecoder => [:pointer],
|
248
|
+
:Mix_GetMusicType => [:pointer],
|
249
|
+
:Mix_SetPostMix => [:pointer, :pointer],
|
250
|
+
:Mix_HookMusic => [:pointer, :pointer],
|
251
|
+
:Mix_HookMusicFinished => [:pointer],
|
252
|
+
:Mix_GetMusicHookData => [],
|
253
|
+
:Mix_ChannelFinished => [:pointer],
|
254
|
+
:Mix_RegisterEffect => [:int, :Mix_EffectFunc_t, :Mix_EffectDone_t, :pointer],
|
255
|
+
:Mix_UnregisterEffect => [:int, :Mix_EffectFunc_t],
|
256
|
+
:Mix_UnregisterAllEffects => [:int],
|
257
|
+
:Mix_SetPanning => [:int, :uchar, :uchar],
|
258
|
+
:Mix_SetPosition => [:int, :short, :uchar],
|
259
|
+
:Mix_SetDistance => [:int, :uchar],
|
260
|
+
:Mix_SetReverseStereo => [:int, :int],
|
261
|
+
:Mix_ReserveChannels => [:int],
|
262
|
+
:Mix_GroupChannel => [:int, :int],
|
263
|
+
:Mix_GroupChannels => [:int, :int, :int],
|
264
|
+
:Mix_GroupAvailable => [:int],
|
265
|
+
:Mix_GroupCount => [:int],
|
266
|
+
:Mix_GroupOldest => [:int],
|
267
|
+
:Mix_GroupNewer => [:int],
|
268
|
+
:Mix_PlayChannelTimed => [:int, :pointer, :int, :int],
|
269
|
+
:Mix_PlayMusic => [:pointer, :int],
|
270
|
+
:Mix_FadeInMusic => [:pointer, :int, :int],
|
271
|
+
:Mix_FadeInMusicPos => [:pointer, :int, :int, :double],
|
272
|
+
:Mix_FadeInChannelTimed => [:int, :pointer, :int, :int, :int],
|
273
|
+
:Mix_Volume => [:int, :int],
|
274
|
+
:Mix_VolumeChunk => [:pointer, :int],
|
275
|
+
:Mix_VolumeMusic => [:int],
|
276
|
+
:Mix_HaltChannel => [:int],
|
277
|
+
:Mix_HaltGroup => [:int],
|
278
|
+
:Mix_HaltMusic => [],
|
279
|
+
:Mix_ExpireChannel => [:int, :int],
|
280
|
+
:Mix_FadeOutChannel => [:int, :int],
|
281
|
+
:Mix_FadeOutGroup => [:int, :int],
|
282
|
+
:Mix_FadeOutMusic => [:int],
|
283
|
+
:Mix_FadingMusic => [],
|
284
|
+
:Mix_FadingChannel => [:int],
|
285
|
+
:Mix_Pause => [:int],
|
286
|
+
:Mix_Resume => [:int],
|
287
|
+
:Mix_Paused => [:int],
|
288
|
+
:Mix_PauseMusic => [],
|
289
|
+
:Mix_ResumeMusic => [],
|
290
|
+
:Mix_RewindMusic => [],
|
291
|
+
:Mix_PausedMusic => [],
|
292
|
+
:Mix_SetMusicPosition => [:double],
|
293
|
+
:Mix_Playing => [:int],
|
294
|
+
:Mix_PlayingMusic => [],
|
295
|
+
:Mix_SetMusicCMD => [:pointer],
|
296
|
+
:Mix_SetSynchroValue => [:int],
|
297
|
+
:Mix_GetSynchroValue => [],
|
298
|
+
:Mix_SetSoundFonts => [:pointer],
|
299
|
+
:Mix_GetSoundFonts => [],
|
300
|
+
:Mix_EachSoundFont => [:pointer, :pointer],
|
301
|
+
:Mix_GetChunk => [:int],
|
302
|
+
:Mix_CloseAudio => [],
|
303
|
+
}
|
304
|
+
retvals = {
|
305
|
+
:Mix_Linked_Version => :pointer,
|
306
|
+
:Mix_Init => :int,
|
307
|
+
:Mix_Quit => :void,
|
308
|
+
:Mix_OpenAudio => :int,
|
309
|
+
:Mix_OpenAudioDevice => :int,
|
310
|
+
:Mix_AllocateChannels => :int,
|
311
|
+
:Mix_QuerySpec => :int,
|
312
|
+
:Mix_LoadWAV_RW => :pointer,
|
313
|
+
:Mix_LoadMUS => :pointer,
|
314
|
+
:Mix_LoadMUS_RW => :pointer,
|
315
|
+
:Mix_LoadMUSType_RW => :pointer,
|
316
|
+
:Mix_QuickLoad_WAV => :pointer,
|
317
|
+
:Mix_QuickLoad_RAW => :pointer,
|
318
|
+
:Mix_FreeChunk => :void,
|
319
|
+
:Mix_FreeMusic => :void,
|
320
|
+
:Mix_GetNumChunkDecoders => :int,
|
321
|
+
:Mix_GetChunkDecoder => :pointer,
|
322
|
+
:Mix_HasChunkDecoder => :int,
|
323
|
+
:Mix_GetNumMusicDecoders => :int,
|
324
|
+
:Mix_GetMusicDecoder => :pointer,
|
325
|
+
:Mix_HasMusicDecoder => :int,
|
326
|
+
:Mix_GetMusicType => :int,
|
327
|
+
:Mix_SetPostMix => :void,
|
328
|
+
:Mix_HookMusic => :void,
|
329
|
+
:Mix_HookMusicFinished => :void,
|
330
|
+
:Mix_GetMusicHookData => :pointer,
|
331
|
+
:Mix_ChannelFinished => :void,
|
332
|
+
:Mix_RegisterEffect => :int,
|
333
|
+
:Mix_UnregisterEffect => :int,
|
334
|
+
:Mix_UnregisterAllEffects => :int,
|
335
|
+
:Mix_SetPanning => :int,
|
336
|
+
:Mix_SetPosition => :int,
|
337
|
+
:Mix_SetDistance => :int,
|
338
|
+
:Mix_SetReverseStereo => :int,
|
339
|
+
:Mix_ReserveChannels => :int,
|
340
|
+
:Mix_GroupChannel => :int,
|
341
|
+
:Mix_GroupChannels => :int,
|
342
|
+
:Mix_GroupAvailable => :int,
|
343
|
+
:Mix_GroupCount => :int,
|
344
|
+
:Mix_GroupOldest => :int,
|
345
|
+
:Mix_GroupNewer => :int,
|
346
|
+
:Mix_PlayChannelTimed => :int,
|
347
|
+
:Mix_PlayMusic => :int,
|
348
|
+
:Mix_FadeInMusic => :int,
|
349
|
+
:Mix_FadeInMusicPos => :int,
|
350
|
+
:Mix_FadeInChannelTimed => :int,
|
351
|
+
:Mix_Volume => :int,
|
352
|
+
:Mix_VolumeChunk => :int,
|
353
|
+
:Mix_VolumeMusic => :int,
|
354
|
+
:Mix_HaltChannel => :int,
|
355
|
+
:Mix_HaltGroup => :int,
|
356
|
+
:Mix_HaltMusic => :int,
|
357
|
+
:Mix_ExpireChannel => :int,
|
358
|
+
:Mix_FadeOutChannel => :int,
|
359
|
+
:Mix_FadeOutGroup => :int,
|
360
|
+
:Mix_FadeOutMusic => :int,
|
361
|
+
:Mix_FadingMusic => :int,
|
362
|
+
:Mix_FadingChannel => :int,
|
363
|
+
:Mix_Pause => :void,
|
364
|
+
:Mix_Resume => :void,
|
365
|
+
:Mix_Paused => :int,
|
366
|
+
:Mix_PauseMusic => :void,
|
367
|
+
:Mix_ResumeMusic => :void,
|
368
|
+
:Mix_RewindMusic => :void,
|
369
|
+
:Mix_PausedMusic => :int,
|
370
|
+
:Mix_SetMusicPosition => :int,
|
371
|
+
:Mix_Playing => :int,
|
372
|
+
:Mix_PlayingMusic => :int,
|
373
|
+
:Mix_SetMusicCMD => :int,
|
374
|
+
:Mix_SetSynchroValue => :int,
|
375
|
+
:Mix_GetSynchroValue => :int,
|
376
|
+
:Mix_SetSoundFonts => :int,
|
377
|
+
:Mix_GetSoundFonts => :pointer,
|
378
|
+
:Mix_EachSoundFont => :int,
|
379
|
+
:Mix_GetChunk => :pointer,
|
380
|
+
:Mix_CloseAudio => :void,
|
381
|
+
}
|
382
|
+
symbols.each do |sym|
|
383
|
+
begin
|
384
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
385
|
+
rescue FFI::NotFoundError => error
|
386
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
end
|
392
|
+
|