SDLRuby 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -22
- data/LICENSE.txt +21 -21
- data/README.md +31 -31
- data/Rakefile +12 -12
- data/SDLRuby.gemspec +38 -0
- data/examples/alert.rb +8 -0
- data/examples/window.rb +7 -0
- data/lib/SDLRuby/event/accessor.rb +2 -2
- data/lib/SDLRuby/event.rb +101 -101
- data/lib/SDLRuby/image/include/SDL_image.h.rb +61 -61
- data/lib/SDLRuby/mixer/include/SDL_mixer.h.rb +95 -95
- data/lib/SDLRuby/rw_ops/rw_object.rb +34 -34
- data/lib/SDLRuby/rw_ops.rb +91 -91
- data/lib/SDLRuby/sdl/include/SDL.h.rb +44 -44
- data/lib/SDLRuby/sdl/include/SDL_audio.h.rb +160 -160
- data/lib/SDLRuby/sdl/include/SDL_blendmode.h.rb +30 -30
- data/lib/SDLRuby/sdl/include/SDL_clipboard.h.rb +10 -10
- data/lib/SDLRuby/sdl/include/SDL_config.h.rb +13 -13
- data/lib/SDLRuby/sdl/include/SDL_cpuinfo.h.rb +27 -27
- data/lib/SDLRuby/sdl/include/SDL_endian.h.rb +12 -12
- data/lib/SDLRuby/sdl/include/SDL_error.h.rb +28 -28
- data/lib/SDLRuby/sdl/include/SDL_events.h.rb +472 -472
- data/lib/SDLRuby/sdl/include/SDL_filesystem.h.rb +6 -6
- data/lib/SDLRuby/sdl/include/SDL_gamecontroller.h.rb +147 -147
- data/lib/SDLRuby/sdl/include/SDL_gesture.h.rb +12 -12
- data/lib/SDLRuby/sdl/include/SDL_guid.h.rb +13 -13
- data/lib/SDLRuby/sdl/include/SDL_hints.h.rb +199 -199
- data/lib/SDLRuby/sdl/include/SDL_joystick.h.rb +131 -131
- data/lib/SDLRuby/sdl/include/SDL_keyboard.h.rb +35 -35
- data/lib/SDLRuby/sdl/include/SDL_keycode.h.rb +292 -292
- data/lib/SDLRuby/sdl/include/SDL_locale.h.rb +13 -13
- data/lib/SDLRuby/sdl/include/SDL_main.h.rb +3 -3
- data/lib/SDLRuby/sdl/include/SDL_messagebox.h.rb +58 -58
- data/lib/SDLRuby/sdl/include/SDL_misc.h.rb +5 -5
- data/lib/SDLRuby/sdl/include/SDL_mouse.h.rb +57 -57
- data/lib/SDLRuby/sdl/include/SDL_pixels.h.rb +285 -285
- data/lib/SDLRuby/sdl/include/SDL_platform.h.rb +3 -3
- data/lib/SDLRuby/sdl/include/SDL_power.h.rb +6 -6
- data/lib/SDLRuby/sdl/include/SDL_rect.h.rb +46 -46
- data/lib/SDLRuby/sdl/include/SDL_render.h.rb +131 -131
- data/lib/SDLRuby/sdl/include/SDL_revision.h.rb +2 -2
- data/lib/SDLRuby/sdl/include/SDL_rwops.h.rb +78 -78
- data/lib/SDLRuby/sdl/include/SDL_scancode.h.rb +252 -252
- data/lib/SDLRuby/sdl/include/SDL_sensor.h.rb +25 -25
- data/lib/SDLRuby/sdl/include/SDL_shape.h.rb +40 -40
- data/lib/SDLRuby/sdl/include/SDL_stdinc.h.rb +62 -62
- data/lib/SDLRuby/sdl/include/SDL_surface.h.rb +100 -100
- data/lib/SDLRuby/sdl/include/SDL_system.h.rb +6 -6
- data/lib/SDLRuby/sdl/include/SDL_syswm.h.rb +10 -10
- data/lib/SDLRuby/sdl/include/SDL_timer.h.rb +21 -21
- data/lib/SDLRuby/sdl/include/SDL_touch.h.rb +15 -15
- data/lib/SDLRuby/sdl/include/SDL_types.h.rb +3 -3
- data/lib/SDLRuby/sdl/include/SDL_version.h.rb +14 -14
- data/lib/SDLRuby/sdl/include/SDL_video.h.rb +264 -264
- data/lib/SDLRuby/sdl.rb +218 -218
- data/lib/SDLRuby/ttf/include/SDL_ttf.h.rb +54 -54
- data/lib/SDLRuby/version.rb +5 -5
- data/lib/SDLRuby/window/surfacer.rb +37 -37
- data/lib/SDLRuby.rb +32 -16
- data/sig/SDLRuby.rbs +4 -4
- data/sig/lib/SDLRuby/event/accessor.rbs +157 -157
- data/sig/lib/SDLRuby/event/type.rbs +67 -67
- data/sig/lib/SDLRuby/event.rbs +47 -47
- data/sig/lib/SDLRuby/keyboard.rbs +25 -25
- data/sig/lib/SDLRuby/mouse.rbs +35 -35
- data/sig/lib/SDLRuby/sdl.rbs +655 -655
- data/sig/lib/SDLRuby/timer.rbs +7 -7
- metadata +6 -3
@@ -1,160 +1,160 @@
|
|
1
|
-
module SDLRuby::SDL
|
2
|
-
require_relative "SDL_stdinc.h"
|
3
|
-
require_relative "SDL_error.h"
|
4
|
-
require_relative "SDL_endian.h"
|
5
|
-
require_relative "SDL_rwops.h"
|
6
|
-
|
7
|
-
typealias "SDL_AudioFormat", "Uint16"
|
8
|
-
|
9
|
-
SDL_AUDIO_MASK_BITSIZE = (0xFF)
|
10
|
-
SDL_AUDIO_MASK_DATATYPE = (1<<8)
|
11
|
-
SDL_AUDIO_MASK_ENDIAN = (1<<12)
|
12
|
-
SDL_AUDIO_MASK_SIGNED = (1<<15)
|
13
|
-
|
14
|
-
def self.SDL_AUDIO_BITSIZE(x)
|
15
|
-
(x & SDL_AUDIO_MASK_BITSIZE)
|
16
|
-
end
|
17
|
-
def self.SDL_AUDIO_ISFLOAT(x)
|
18
|
-
(x & SDL_AUDIO_MASK_DATATYPE)
|
19
|
-
end
|
20
|
-
def self.SDL_AUDIO_ISBIGENDIAN(x)
|
21
|
-
(x & SDL_AUDIO_MASK_ENDIAN)
|
22
|
-
end
|
23
|
-
def self.SDL_AUDIO_ISSIGNED(x)
|
24
|
-
(x & SDL_AUDIO_MASK_SIGNED)
|
25
|
-
end
|
26
|
-
def self.SDL_AUDIO_ISINT(x)
|
27
|
-
(!SDL_AUDIO_ISFLOAT(x))
|
28
|
-
end
|
29
|
-
def self.SDL_AUDIO_ISLITTLEENDIAN(x)
|
30
|
-
(!SDL_AUDIO_ISBIGENDIAN(x))
|
31
|
-
end
|
32
|
-
def self.SDL_AUDIO_ISUNSIGNED(x)
|
33
|
-
(!SDL_AUDIO_ISSIGNED(x))
|
34
|
-
end
|
35
|
-
|
36
|
-
AUDIO_U8 = 0x0008
|
37
|
-
AUDIO_S8 = 0x8008
|
38
|
-
AUDIO_U16LSB = 0x0010
|
39
|
-
AUDIO_S16LSB = 0x8010
|
40
|
-
AUDIO_U16MSB = 0x1010
|
41
|
-
AUDIO_S16MSB = 0x9010
|
42
|
-
AUDIO_U16 = AUDIO_U16LSB
|
43
|
-
AUDIO_S16 = AUDIO_S16LSB
|
44
|
-
AUDIO_S32LSB = 0x8020
|
45
|
-
AUDIO_S32MSB = 0x9020
|
46
|
-
AUDIO_S32 = AUDIO_S32LSB
|
47
|
-
AUDIO_F32LSB = 0x8120
|
48
|
-
AUDIO_F32MSB = 0x9120
|
49
|
-
AUDIO_F32 = AUDIO_F32LSB
|
50
|
-
|
51
|
-
if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
52
|
-
AUDIO_U16SYS = AUDIO_U16LSB
|
53
|
-
AUDIO_S16SYS = AUDIO_S16LSB
|
54
|
-
AUDIO_S32SYS = AUDIO_S32LSB
|
55
|
-
AUDIO_F32SYS = AUDIO_F32LSB
|
56
|
-
else
|
57
|
-
AUDIO_U16SYS = AUDIO_U16MSB
|
58
|
-
AUDIO_S16SYS = AUDIO_S16MSB
|
59
|
-
AUDIO_S32SYS = AUDIO_S32MSB
|
60
|
-
AUDIO_F32SYS = AUDIO_F32MSB
|
61
|
-
end
|
62
|
-
|
63
|
-
SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
|
64
|
-
SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
|
65
|
-
SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
|
66
|
-
SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
|
67
|
-
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)
|
68
|
-
|
69
|
-
typealias "SDL_AudioCallback", "void*"
|
70
|
-
|
71
|
-
SDL_AudioSpec = struct(
|
72
|
-
[
|
73
|
-
"int freq",
|
74
|
-
"SDL_AudioFormat format",
|
75
|
-
"Uint8 channels",
|
76
|
-
"Uint8 silence",
|
77
|
-
"Uint16 samples",
|
78
|
-
"Uint16 padding",
|
79
|
-
"Uint32 size",
|
80
|
-
"SDL_AudioCallback callback",
|
81
|
-
"void *userdata",
|
82
|
-
]
|
83
|
-
)
|
84
|
-
|
85
|
-
typealias "SDL_AudioFilter", "void*"
|
86
|
-
|
87
|
-
SDL_AUDIOCVT_MAX_FILTERS = 9
|
88
|
-
|
89
|
-
SDL_AudioCVT = struct(
|
90
|
-
[
|
91
|
-
"int needed",
|
92
|
-
"SDL_AudioFormat src_format",
|
93
|
-
"SDL_AudioFormat dst_format",
|
94
|
-
"double rate_incr",
|
95
|
-
"Uint8 *buf",
|
96
|
-
"int len",
|
97
|
-
"int len_cvt",
|
98
|
-
"int len_mult",
|
99
|
-
"double len_ratio",
|
100
|
-
"SDL_AudioFilter filters[#{SDL_AUDIOCVT_MAX_FILTERS + 1}]",
|
101
|
-
"int filter_index",
|
102
|
-
]
|
103
|
-
)
|
104
|
-
|
105
|
-
extern "int SDL_GetNumAudioDrivers(void)"
|
106
|
-
extern "const char * SDL_GetAudioDriver(int index)"
|
107
|
-
extern "int SDL_AudioInit(const char *driver_name)"
|
108
|
-
extern "void SDL_AudioQuit(void)"
|
109
|
-
extern "const char * SDL_GetCurrentAudioDriver(void)"
|
110
|
-
extern "int SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained)"
|
111
|
-
|
112
|
-
typealias "SDL_AudioDeviceID", "Uint32"
|
113
|
-
|
114
|
-
extern "int SDL_GetNumAudioDevices(int iscapture)"
|
115
|
-
extern "const char * SDL_GetAudioDeviceName(int index, int iscapture)"
|
116
|
-
extern "int SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec)"
|
117
|
-
extern "int SDL_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture)"
|
118
|
-
extern "SDL_AudioDeviceID SDL_OpenAudioDevice( const char *device, int iscapture, const SDL_AudioSpec *desired, SDL_AudioSpec *obtained, int allowed_changes)"
|
119
|
-
|
120
|
-
SDL_AUDIO_STOPPED = 0
|
121
|
-
SDL_AUDIO_PLAYING = 1
|
122
|
-
SDL_AUDIO_PAUSED = 2
|
123
|
-
typealias "SDL_AudioStatus", "int"
|
124
|
-
|
125
|
-
extern "SDL_AudioStatus SDL_GetAudioStatus(void)"
|
126
|
-
extern "SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev)"
|
127
|
-
extern "void SDL_PauseAudio(int pause_on)"
|
128
|
-
extern "void SDL_PauseAudioDevice(SDL_AudioDeviceID dev, int pause_on)"
|
129
|
-
extern "SDL_AudioSpec * SDL_LoadWAV_RW(SDL_RWops * src, int freesrc, SDL_AudioSpec * spec, Uint8 ** audio_buf, Uint32 * audio_len)"
|
130
|
-
|
131
|
-
def self.SDL_LoadWAV(file, spec, audio_buf, audio_len)
|
132
|
-
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
|
133
|
-
end
|
134
|
-
|
135
|
-
extern "void SDL_FreeWAV(Uint8 * audio_buf)"
|
136
|
-
extern "int SDL_BuildAudioCVT(SDL_AudioCVT * cvt, SDL_AudioFormat src_format, Uint8 src_channels, int src_rate, SDL_AudioFormat dst_format, Uint8 dst_channels, int dst_rate)"
|
137
|
-
extern "int SDL_ConvertAudio(SDL_AudioCVT * cvt)"
|
138
|
-
extern "SDL_AudioStream * SDL_NewAudioStream(const SDL_AudioFormat src_format, const Uint8 src_channels, const int src_rate, const SDL_AudioFormat dst_format, const Uint8 dst_channels, const int dst_rate)"
|
139
|
-
extern "int SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len)"
|
140
|
-
extern "int SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len)"
|
141
|
-
extern "int SDL_AudioStreamAvailable(SDL_AudioStream *stream)"
|
142
|
-
extern "int SDL_AudioStreamFlush(SDL_AudioStream *stream)"
|
143
|
-
extern "void SDL_AudioStreamClear(SDL_AudioStream *stream)"
|
144
|
-
extern "void SDL_FreeAudioStream(SDL_AudioStream *stream)"
|
145
|
-
|
146
|
-
SDL_MIX_MAXVOLUME = 128
|
147
|
-
|
148
|
-
extern "void SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume)"
|
149
|
-
extern "void SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, Uint32 len, int volume)"
|
150
|
-
extern "int SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len)"
|
151
|
-
extern "Uint32 SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len)"
|
152
|
-
extern "Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev)"
|
153
|
-
extern "void SDL_ClearQueuedAudio(SDL_AudioDeviceID dev)"
|
154
|
-
extern "void SDL_LockAudio(void)"
|
155
|
-
extern "void SDL_LockAudioDevice(SDL_AudioDeviceID dev)"
|
156
|
-
extern "void SDL_UnlockAudio(void)"
|
157
|
-
extern "void SDL_UnlockAudioDevice(SDL_AudioDeviceID dev)"
|
158
|
-
extern "void SDL_CloseAudio(void)"
|
159
|
-
extern "void SDL_CloseAudioDevice(SDL_AudioDeviceID dev)"
|
160
|
-
end
|
1
|
+
module SDLRuby::SDL
|
2
|
+
require_relative "SDL_stdinc.h"
|
3
|
+
require_relative "SDL_error.h"
|
4
|
+
require_relative "SDL_endian.h"
|
5
|
+
require_relative "SDL_rwops.h"
|
6
|
+
|
7
|
+
typealias "SDL_AudioFormat", "Uint16"
|
8
|
+
|
9
|
+
SDL_AUDIO_MASK_BITSIZE = (0xFF)
|
10
|
+
SDL_AUDIO_MASK_DATATYPE = (1<<8)
|
11
|
+
SDL_AUDIO_MASK_ENDIAN = (1<<12)
|
12
|
+
SDL_AUDIO_MASK_SIGNED = (1<<15)
|
13
|
+
|
14
|
+
def self.SDL_AUDIO_BITSIZE(x)
|
15
|
+
(x & SDL_AUDIO_MASK_BITSIZE)
|
16
|
+
end
|
17
|
+
def self.SDL_AUDIO_ISFLOAT(x)
|
18
|
+
(x & SDL_AUDIO_MASK_DATATYPE)
|
19
|
+
end
|
20
|
+
def self.SDL_AUDIO_ISBIGENDIAN(x)
|
21
|
+
(x & SDL_AUDIO_MASK_ENDIAN)
|
22
|
+
end
|
23
|
+
def self.SDL_AUDIO_ISSIGNED(x)
|
24
|
+
(x & SDL_AUDIO_MASK_SIGNED)
|
25
|
+
end
|
26
|
+
def self.SDL_AUDIO_ISINT(x)
|
27
|
+
(!SDL_AUDIO_ISFLOAT(x))
|
28
|
+
end
|
29
|
+
def self.SDL_AUDIO_ISLITTLEENDIAN(x)
|
30
|
+
(!SDL_AUDIO_ISBIGENDIAN(x))
|
31
|
+
end
|
32
|
+
def self.SDL_AUDIO_ISUNSIGNED(x)
|
33
|
+
(!SDL_AUDIO_ISSIGNED(x))
|
34
|
+
end
|
35
|
+
|
36
|
+
AUDIO_U8 = 0x0008
|
37
|
+
AUDIO_S8 = 0x8008
|
38
|
+
AUDIO_U16LSB = 0x0010
|
39
|
+
AUDIO_S16LSB = 0x8010
|
40
|
+
AUDIO_U16MSB = 0x1010
|
41
|
+
AUDIO_S16MSB = 0x9010
|
42
|
+
AUDIO_U16 = AUDIO_U16LSB
|
43
|
+
AUDIO_S16 = AUDIO_S16LSB
|
44
|
+
AUDIO_S32LSB = 0x8020
|
45
|
+
AUDIO_S32MSB = 0x9020
|
46
|
+
AUDIO_S32 = AUDIO_S32LSB
|
47
|
+
AUDIO_F32LSB = 0x8120
|
48
|
+
AUDIO_F32MSB = 0x9120
|
49
|
+
AUDIO_F32 = AUDIO_F32LSB
|
50
|
+
|
51
|
+
if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
52
|
+
AUDIO_U16SYS = AUDIO_U16LSB
|
53
|
+
AUDIO_S16SYS = AUDIO_S16LSB
|
54
|
+
AUDIO_S32SYS = AUDIO_S32LSB
|
55
|
+
AUDIO_F32SYS = AUDIO_F32LSB
|
56
|
+
else
|
57
|
+
AUDIO_U16SYS = AUDIO_U16MSB
|
58
|
+
AUDIO_S16SYS = AUDIO_S16MSB
|
59
|
+
AUDIO_S32SYS = AUDIO_S32MSB
|
60
|
+
AUDIO_F32SYS = AUDIO_F32MSB
|
61
|
+
end
|
62
|
+
|
63
|
+
SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
|
64
|
+
SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
|
65
|
+
SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
|
66
|
+
SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
|
67
|
+
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)
|
68
|
+
|
69
|
+
typealias "SDL_AudioCallback", "void*"
|
70
|
+
|
71
|
+
SDL_AudioSpec = struct(
|
72
|
+
[
|
73
|
+
"int freq",
|
74
|
+
"SDL_AudioFormat format",
|
75
|
+
"Uint8 channels",
|
76
|
+
"Uint8 silence",
|
77
|
+
"Uint16 samples",
|
78
|
+
"Uint16 padding",
|
79
|
+
"Uint32 size",
|
80
|
+
"SDL_AudioCallback callback",
|
81
|
+
"void *userdata",
|
82
|
+
]
|
83
|
+
)
|
84
|
+
|
85
|
+
typealias "SDL_AudioFilter", "void*"
|
86
|
+
|
87
|
+
SDL_AUDIOCVT_MAX_FILTERS = 9
|
88
|
+
|
89
|
+
SDL_AudioCVT = struct(
|
90
|
+
[
|
91
|
+
"int needed",
|
92
|
+
"SDL_AudioFormat src_format",
|
93
|
+
"SDL_AudioFormat dst_format",
|
94
|
+
"double rate_incr",
|
95
|
+
"Uint8 *buf",
|
96
|
+
"int len",
|
97
|
+
"int len_cvt",
|
98
|
+
"int len_mult",
|
99
|
+
"double len_ratio",
|
100
|
+
"SDL_AudioFilter filters[#{SDL_AUDIOCVT_MAX_FILTERS + 1}]",
|
101
|
+
"int filter_index",
|
102
|
+
]
|
103
|
+
)
|
104
|
+
|
105
|
+
extern "int SDL_GetNumAudioDrivers(void)"
|
106
|
+
extern "const char * SDL_GetAudioDriver(int index)"
|
107
|
+
extern "int SDL_AudioInit(const char *driver_name)"
|
108
|
+
extern "void SDL_AudioQuit(void)"
|
109
|
+
extern "const char * SDL_GetCurrentAudioDriver(void)"
|
110
|
+
extern "int SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained)"
|
111
|
+
|
112
|
+
typealias "SDL_AudioDeviceID", "Uint32"
|
113
|
+
|
114
|
+
extern "int SDL_GetNumAudioDevices(int iscapture)"
|
115
|
+
extern "const char * SDL_GetAudioDeviceName(int index, int iscapture)"
|
116
|
+
extern "int SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec)"
|
117
|
+
extern "int SDL_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture)"
|
118
|
+
extern "SDL_AudioDeviceID SDL_OpenAudioDevice( const char *device, int iscapture, const SDL_AudioSpec *desired, SDL_AudioSpec *obtained, int allowed_changes)"
|
119
|
+
|
120
|
+
SDL_AUDIO_STOPPED = 0
|
121
|
+
SDL_AUDIO_PLAYING = 1
|
122
|
+
SDL_AUDIO_PAUSED = 2
|
123
|
+
typealias "SDL_AudioStatus", "int"
|
124
|
+
|
125
|
+
extern "SDL_AudioStatus SDL_GetAudioStatus(void)"
|
126
|
+
extern "SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev)"
|
127
|
+
extern "void SDL_PauseAudio(int pause_on)"
|
128
|
+
extern "void SDL_PauseAudioDevice(SDL_AudioDeviceID dev, int pause_on)"
|
129
|
+
extern "SDL_AudioSpec * SDL_LoadWAV_RW(SDL_RWops * src, int freesrc, SDL_AudioSpec * spec, Uint8 ** audio_buf, Uint32 * audio_len)"
|
130
|
+
|
131
|
+
def self.SDL_LoadWAV(file, spec, audio_buf, audio_len)
|
132
|
+
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
|
133
|
+
end
|
134
|
+
|
135
|
+
extern "void SDL_FreeWAV(Uint8 * audio_buf)"
|
136
|
+
extern "int SDL_BuildAudioCVT(SDL_AudioCVT * cvt, SDL_AudioFormat src_format, Uint8 src_channels, int src_rate, SDL_AudioFormat dst_format, Uint8 dst_channels, int dst_rate)"
|
137
|
+
extern "int SDL_ConvertAudio(SDL_AudioCVT * cvt)"
|
138
|
+
extern "SDL_AudioStream * SDL_NewAudioStream(const SDL_AudioFormat src_format, const Uint8 src_channels, const int src_rate, const SDL_AudioFormat dst_format, const Uint8 dst_channels, const int dst_rate)"
|
139
|
+
extern "int SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len)"
|
140
|
+
extern "int SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len)"
|
141
|
+
extern "int SDL_AudioStreamAvailable(SDL_AudioStream *stream)"
|
142
|
+
extern "int SDL_AudioStreamFlush(SDL_AudioStream *stream)"
|
143
|
+
extern "void SDL_AudioStreamClear(SDL_AudioStream *stream)"
|
144
|
+
extern "void SDL_FreeAudioStream(SDL_AudioStream *stream)"
|
145
|
+
|
146
|
+
SDL_MIX_MAXVOLUME = 128
|
147
|
+
|
148
|
+
extern "void SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume)"
|
149
|
+
extern "void SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, Uint32 len, int volume)"
|
150
|
+
extern "int SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len)"
|
151
|
+
extern "Uint32 SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len)"
|
152
|
+
extern "Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev)"
|
153
|
+
extern "void SDL_ClearQueuedAudio(SDL_AudioDeviceID dev)"
|
154
|
+
extern "void SDL_LockAudio(void)"
|
155
|
+
extern "void SDL_LockAudioDevice(SDL_AudioDeviceID dev)"
|
156
|
+
extern "void SDL_UnlockAudio(void)"
|
157
|
+
extern "void SDL_UnlockAudioDevice(SDL_AudioDeviceID dev)"
|
158
|
+
extern "void SDL_CloseAudio(void)"
|
159
|
+
extern "void SDL_CloseAudioDevice(SDL_AudioDeviceID dev)"
|
160
|
+
end
|
@@ -1,30 +1,30 @@
|
|
1
|
-
module SDLRuby::SDL
|
2
|
-
SDL_BLENDMODE_NONE = 0x00000000
|
3
|
-
SDL_BLENDMODE_BLEND = 0x00000001
|
4
|
-
SDL_BLENDMODE_ADD = 0x00000002
|
5
|
-
SDL_BLENDMODE_MOD = 0x00000004
|
6
|
-
SDL_BLENDMODE_MUL = 0x00000008
|
7
|
-
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
8
|
-
typealias "SDL_BlendMode", "int"
|
9
|
-
|
10
|
-
SDL_BLENDOPERATION_ADD = 0x1
|
11
|
-
SDL_BLENDOPERATION_SUBTRACT = 0x2
|
12
|
-
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3
|
13
|
-
SDL_BLENDOPERATION_MINIMUM = 0x4
|
14
|
-
SDL_BLENDOPERATION_MAXIMUM = 0x5
|
15
|
-
typealias "SDL_BlendOperation", "int"
|
16
|
-
|
17
|
-
SDL_BLENDFACTOR_ZERO = 0x1
|
18
|
-
SDL_BLENDFACTOR_ONE = 0x2
|
19
|
-
SDL_BLENDFACTOR_SRC_COLOR = 0x3
|
20
|
-
SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4
|
21
|
-
SDL_BLENDFACTOR_SRC_ALPHA = 0x5
|
22
|
-
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6
|
23
|
-
SDL_BLENDFACTOR_DST_COLOR = 0x7
|
24
|
-
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8
|
25
|
-
SDL_BLENDFACTOR_DST_ALPHA = 0x9
|
26
|
-
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA
|
27
|
-
typealias "SDL_BlendFactor", "int"
|
28
|
-
|
29
|
-
extern "SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation)"
|
30
|
-
end
|
1
|
+
module SDLRuby::SDL
|
2
|
+
SDL_BLENDMODE_NONE = 0x00000000
|
3
|
+
SDL_BLENDMODE_BLEND = 0x00000001
|
4
|
+
SDL_BLENDMODE_ADD = 0x00000002
|
5
|
+
SDL_BLENDMODE_MOD = 0x00000004
|
6
|
+
SDL_BLENDMODE_MUL = 0x00000008
|
7
|
+
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
8
|
+
typealias "SDL_BlendMode", "int"
|
9
|
+
|
10
|
+
SDL_BLENDOPERATION_ADD = 0x1
|
11
|
+
SDL_BLENDOPERATION_SUBTRACT = 0x2
|
12
|
+
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3
|
13
|
+
SDL_BLENDOPERATION_MINIMUM = 0x4
|
14
|
+
SDL_BLENDOPERATION_MAXIMUM = 0x5
|
15
|
+
typealias "SDL_BlendOperation", "int"
|
16
|
+
|
17
|
+
SDL_BLENDFACTOR_ZERO = 0x1
|
18
|
+
SDL_BLENDFACTOR_ONE = 0x2
|
19
|
+
SDL_BLENDFACTOR_SRC_COLOR = 0x3
|
20
|
+
SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4
|
21
|
+
SDL_BLENDFACTOR_SRC_ALPHA = 0x5
|
22
|
+
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6
|
23
|
+
SDL_BLENDFACTOR_DST_COLOR = 0x7
|
24
|
+
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8
|
25
|
+
SDL_BLENDFACTOR_DST_ALPHA = 0x9
|
26
|
+
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA
|
27
|
+
typealias "SDL_BlendFactor", "int"
|
28
|
+
|
29
|
+
extern "SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation)"
|
30
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module SDLRuby::SDL
|
2
|
-
require_relative 'SDL_stdinc.h.rb'
|
3
|
-
|
4
|
-
extern "int SDL_SetClipboardText(const char *text)"
|
5
|
-
extern "char * SDL_GetClipboardText(void)"
|
6
|
-
extern "SDL_bool SDL_HasClipboardText(void)"
|
7
|
-
extern "int SDL_SetPrimarySelectionText(const char *text)"
|
8
|
-
extern "char * SDL_GetPrimarySelectionText(void)"
|
9
|
-
extern "SDL_bool SDL_HasPrimarySelectionText(void)"
|
10
|
-
end
|
1
|
+
module SDLRuby::SDL
|
2
|
+
require_relative 'SDL_stdinc.h.rb'
|
3
|
+
|
4
|
+
extern "int SDL_SetClipboardText(const char *text)"
|
5
|
+
extern "char * SDL_GetClipboardText(void)"
|
6
|
+
extern "SDL_bool SDL_HasClipboardText(void)"
|
7
|
+
extern "int SDL_SetPrimarySelectionText(const char *text)"
|
8
|
+
extern "char * SDL_GetPrimarySelectionText(void)"
|
9
|
+
extern "SDL_bool SDL_HasPrimarySelectionText(void)"
|
10
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module SDLRuby::SDL
|
2
|
-
require_relative 'SDL_platform.h.rb'
|
3
|
-
typealias "int8_t", "signed __int8"
|
4
|
-
typealias "uint8_t", "unsigned __int8"
|
5
|
-
typealias "int16_t", "signed __int16"
|
6
|
-
typealias "uint16_t", "unsigned __int16"
|
7
|
-
typealias "int32_t", "signed __int32"
|
8
|
-
typealias "uint32_t", "unsigned __int32"
|
9
|
-
typealias "int64_t", "signed __int64"
|
10
|
-
typealias "uint64_t", "unsigned __int64"
|
11
|
-
typealias "uintptr_t", "unsigned __int64"
|
12
|
-
typealias "uintptr_t", "unsigned int"
|
13
|
-
end
|
1
|
+
module SDLRuby::SDL
|
2
|
+
require_relative 'SDL_platform.h.rb'
|
3
|
+
typealias "int8_t", "signed __int8"
|
4
|
+
typealias "uint8_t", "unsigned __int8"
|
5
|
+
typealias "int16_t", "signed __int16"
|
6
|
+
typealias "uint16_t", "unsigned __int16"
|
7
|
+
typealias "int32_t", "signed __int32"
|
8
|
+
typealias "uint32_t", "unsigned __int32"
|
9
|
+
typealias "int64_t", "signed __int64"
|
10
|
+
typealias "uint64_t", "unsigned __int64"
|
11
|
+
typealias "uintptr_t", "unsigned __int64"
|
12
|
+
typealias "uintptr_t", "unsigned int"
|
13
|
+
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
module SDLRuby::SDL
|
2
|
-
require_relative 'SDL_stdinc.h.rb'
|
3
|
-
|
4
|
-
extern "int SDL_GetCPUCount(void)"
|
5
|
-
extern "int SDL_GetCPUCacheLineSize(void)"
|
6
|
-
extern "SDL_bool SDL_HasRDTSC(void)"
|
7
|
-
extern "SDL_bool SDL_HasAltiVec(void)"
|
8
|
-
extern "SDL_bool SDL_HasMMX(void)"
|
9
|
-
extern "SDL_bool SDL_Has3DNow(void)"
|
10
|
-
extern "SDL_bool SDL_HasSSE(void)"
|
11
|
-
extern "SDL_bool SDL_HasSSE2(void)"
|
12
|
-
extern "SDL_bool SDL_HasSSE3(void)"
|
13
|
-
extern "SDL_bool SDL_HasSSE41(void)"
|
14
|
-
extern "SDL_bool SDL_HasSSE42(void)"
|
15
|
-
extern "SDL_bool SDL_HasAVX(void)"
|
16
|
-
extern "SDL_bool SDL_HasAVX2(void)"
|
17
|
-
extern "SDL_bool SDL_HasAVX512F(void)"
|
18
|
-
extern "SDL_bool SDL_HasARMSIMD(void)"
|
19
|
-
extern "SDL_bool SDL_HasNEON(void)"
|
20
|
-
extern "SDL_bool SDL_HasLSX(void)"
|
21
|
-
extern "SDL_bool SDL_HasLASX(void)"
|
22
|
-
extern "int SDL_GetSystemRAM(void)"
|
23
|
-
extern "size_t SDL_SIMDGetAlignment(void)"
|
24
|
-
extern "void * SDL_SIMDAlloc(const size_t len)"
|
25
|
-
extern "void * SDL_SIMDRealloc(void *mem, const size_t len)"
|
26
|
-
extern "void SDL_SIMDFree(void *ptr)"
|
27
|
-
end
|
1
|
+
module SDLRuby::SDL
|
2
|
+
require_relative 'SDL_stdinc.h.rb'
|
3
|
+
|
4
|
+
extern "int SDL_GetCPUCount(void)"
|
5
|
+
extern "int SDL_GetCPUCacheLineSize(void)"
|
6
|
+
extern "SDL_bool SDL_HasRDTSC(void)"
|
7
|
+
extern "SDL_bool SDL_HasAltiVec(void)"
|
8
|
+
extern "SDL_bool SDL_HasMMX(void)"
|
9
|
+
extern "SDL_bool SDL_Has3DNow(void)"
|
10
|
+
extern "SDL_bool SDL_HasSSE(void)"
|
11
|
+
extern "SDL_bool SDL_HasSSE2(void)"
|
12
|
+
extern "SDL_bool SDL_HasSSE3(void)"
|
13
|
+
extern "SDL_bool SDL_HasSSE41(void)"
|
14
|
+
extern "SDL_bool SDL_HasSSE42(void)"
|
15
|
+
extern "SDL_bool SDL_HasAVX(void)"
|
16
|
+
extern "SDL_bool SDL_HasAVX2(void)"
|
17
|
+
extern "SDL_bool SDL_HasAVX512F(void)"
|
18
|
+
extern "SDL_bool SDL_HasARMSIMD(void)"
|
19
|
+
extern "SDL_bool SDL_HasNEON(void)"
|
20
|
+
extern "SDL_bool SDL_HasLSX(void)"
|
21
|
+
extern "SDL_bool SDL_HasLASX(void)"
|
22
|
+
extern "int SDL_GetSystemRAM(void)"
|
23
|
+
extern "size_t SDL_SIMDGetAlignment(void)"
|
24
|
+
extern "void * SDL_SIMDAlloc(const size_t len)"
|
25
|
+
extern "void * SDL_SIMDRealloc(void *mem, const size_t len)"
|
26
|
+
extern "void SDL_SIMDFree(void *ptr)"
|
27
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module SDLRuby::SDL
|
2
|
-
require_relative "SDL_stdinc.h"
|
3
|
-
|
4
|
-
SDL_LIL_ENDIAN = 1234
|
5
|
-
SDL_BIG_ENDIAN = 4321
|
6
|
-
|
7
|
-
if "\x01\x02\x03\x04".unpack("I") == 0x1020304
|
8
|
-
SDL_BYTEORDER = SDL_BIG_ENDIAN
|
9
|
-
else
|
10
|
-
SDL_BYTEORDER = SDL_LIL_ENDIAN
|
11
|
-
end
|
12
|
-
end
|
1
|
+
module SDLRuby::SDL
|
2
|
+
require_relative "SDL_stdinc.h"
|
3
|
+
|
4
|
+
SDL_LIL_ENDIAN = 1234
|
5
|
+
SDL_BIG_ENDIAN = 4321
|
6
|
+
|
7
|
+
if "\x01\x02\x03\x04".unpack("I") == 0x1020304
|
8
|
+
SDL_BYTEORDER = SDL_BIG_ENDIAN
|
9
|
+
else
|
10
|
+
SDL_BYTEORDER = SDL_LIL_ENDIAN
|
11
|
+
end
|
12
|
+
end
|
@@ -1,28 +1,28 @@
|
|
1
|
-
module SDLRuby::SDL
|
2
|
-
require_relative "SDL_stdinc.h"
|
3
|
-
|
4
|
-
extern "int SDL_SetError(const char *fmt, ...)"
|
5
|
-
extern "const char * SDL_GetError(void)"
|
6
|
-
extern "char * SDL_GetErrorMsg(char *errstr, int maxlen)"
|
7
|
-
extern "void SDL_ClearError(void)"
|
8
|
-
|
9
|
-
def self.SDL_OutOfMemory()
|
10
|
-
SDL_Error(SDL_ENOMEM)
|
11
|
-
end
|
12
|
-
def self.SDL_Unsupported()
|
13
|
-
SDL_Error(SDL_UNSUPPORTED)
|
14
|
-
end
|
15
|
-
def self.SDL_InvalidParamError(param)
|
16
|
-
SDL_SetError("Parameter '%s' is invalid", (param))
|
17
|
-
end
|
18
|
-
|
19
|
-
SDL_ENOMEM = 0
|
20
|
-
SDL_EFREAD = 1
|
21
|
-
SDL_EFWRITE = 2
|
22
|
-
SDL_EFSEEK = 3
|
23
|
-
SDL_UNSUPPORTED = 4
|
24
|
-
SDL_LASTERROR = 5
|
25
|
-
typealias "SDL_errorcode", "int"
|
26
|
-
|
27
|
-
extern "int SDL_Error(SDL_errorcode code)"
|
28
|
-
end
|
1
|
+
module SDLRuby::SDL
|
2
|
+
require_relative "SDL_stdinc.h"
|
3
|
+
|
4
|
+
extern "int SDL_SetError(const char *fmt, ...)"
|
5
|
+
extern "const char * SDL_GetError(void)"
|
6
|
+
extern "char * SDL_GetErrorMsg(char *errstr, int maxlen)"
|
7
|
+
extern "void SDL_ClearError(void)"
|
8
|
+
|
9
|
+
def self.SDL_OutOfMemory()
|
10
|
+
SDL_Error(SDL_ENOMEM)
|
11
|
+
end
|
12
|
+
def self.SDL_Unsupported()
|
13
|
+
SDL_Error(SDL_UNSUPPORTED)
|
14
|
+
end
|
15
|
+
def self.SDL_InvalidParamError(param)
|
16
|
+
SDL_SetError("Parameter '%s' is invalid", (param))
|
17
|
+
end
|
18
|
+
|
19
|
+
SDL_ENOMEM = 0
|
20
|
+
SDL_EFREAD = 1
|
21
|
+
SDL_EFWRITE = 2
|
22
|
+
SDL_EFSEEK = 3
|
23
|
+
SDL_UNSUPPORTED = 4
|
24
|
+
SDL_LASTERROR = 5
|
25
|
+
typealias "SDL_errorcode", "int"
|
26
|
+
|
27
|
+
extern "int SDL_Error(SDL_errorcode code)"
|
28
|
+
end
|