sdl3-bindings 1.0.0.beta.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +18 -0
- data/LICENSE.txt +1 -1
- data/README.md +28 -8
- data/lib/sdl3_atomic.rb +1 -0
- data/lib/sdl3_audio.rb +5 -0
- data/lib/sdl3_camera.rb +4 -0
- data/lib/sdl3_cpuinfo.rb +1 -0
- data/lib/sdl3_events.rb +19 -1
- data/lib/sdl3_gamepad.rb +2 -1
- data/lib/sdl3_gpu.rb +30 -3
- data/lib/sdl3_haptic.rb +4 -1
- data/lib/sdl3_hidapi.rb +1 -0
- data/lib/sdl3_hints.rb +22 -0
- data/lib/sdl3_image.rb +1 -1
- data/lib/sdl3_iostream.rb +1 -0
- data/lib/sdl3_mixer.rb +134 -136
- data/lib/sdl3_mouse.rb +10 -0
- data/lib/sdl3_pen.rb +7 -0
- data/lib/sdl3_pixels.rb +1 -1
- data/lib/sdl3_process.rb +2 -0
- data/lib/sdl3_properties.rb +1 -0
- data/lib/sdl3_render.rb +47 -0
- data/lib/sdl3_revision.rb +1 -1
- data/lib/sdl3_sensor.rb +1 -0
- data/lib/sdl3_sound.rb +3 -22
- data/lib/sdl3_stdinc.rb +4 -0
- data/lib/sdl3_surface.rb +10 -0
- data/lib/sdl3_ttf.rb +9 -7
- data/lib/sdl3_version.rb +2 -2
- data/lib/sdl3_video.rb +22 -1
- metadata +3 -3
data/lib/sdl3_mixer.rb
CHANGED
|
@@ -11,58 +11,62 @@ module SDL
|
|
|
11
11
|
# Define/Macro
|
|
12
12
|
|
|
13
13
|
MIXER_MAJOR_VERSION = 3
|
|
14
|
-
MIXER_MINOR_VERSION =
|
|
14
|
+
MIXER_MINOR_VERSION = 1
|
|
15
15
|
MIXER_MICRO_VERSION = 0
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
MIX_PROP_MIXER_DEVICE_NUMBER = "SDL_mixer.mixer.device"
|
|
17
|
+
MIX_PROP_AUDIO_LOAD_IOSTREAM_POINTER = "SDL_mixer.audio.load.iostream"
|
|
18
|
+
MIX_PROP_AUDIO_LOAD_CLOSEIO_BOOLEAN = "SDL_mixer.audio.load.closeio"
|
|
19
|
+
MIX_PROP_AUDIO_LOAD_PREDECODE_BOOLEAN = "SDL_mixer.audio.load.predecode"
|
|
20
|
+
MIX_PROP_AUDIO_LOAD_PREFERRED_MIXER_POINTER = "SDL_mixer.audio.load.preferred_mixer"
|
|
21
|
+
MIX_PROP_AUDIO_LOAD_SKIP_METADATA_TAGS_BOOLEAN = "SDL_mixer.audio.load.skip_metadata_tags"
|
|
22
|
+
MIX_PROP_AUDIO_DECODER_STRING = "SDL_mixer.audio.decoder"
|
|
23
|
+
MIX_PROP_METADATA_TITLE_STRING = "SDL_mixer.metadata.title"
|
|
24
|
+
MIX_PROP_METADATA_ARTIST_STRING = "SDL_mixer.metadata.artist"
|
|
25
|
+
MIX_PROP_METADATA_ALBUM_STRING = "SDL_mixer.metadata.album"
|
|
26
|
+
MIX_PROP_METADATA_COPYRIGHT_STRING = "SDL_mixer.metadata.copyright"
|
|
27
|
+
MIX_PROP_METADATA_TRACK_NUMBER = "SDL_mixer.metadata.track"
|
|
28
|
+
MIX_PROP_METADATA_TOTAL_TRACKS_NUMBER = "SDL_mixer.metadata.total_tracks"
|
|
29
|
+
MIX_PROP_METADATA_YEAR_NUMBER = "SDL_mixer.metadata.year"
|
|
30
|
+
MIX_PROP_METADATA_DURATION_FRAMES_NUMBER = "SDL_mixer.metadata.duration_frames"
|
|
31
|
+
MIX_PROP_METADATA_DURATION_INFINITE_BOOLEAN = "SDL_mixer.metadata.duration_infinite"
|
|
32
|
+
MIX_DURATION_UNKNOWN = -1
|
|
33
|
+
MIX_DURATION_INFINITE = -2
|
|
34
|
+
MIX_PROP_PLAY_LOOPS_NUMBER = "SDL_mixer.play.loops"
|
|
35
|
+
MIX_PROP_PLAY_MAX_FRAME_NUMBER = "SDL_mixer.play.max_frame"
|
|
36
|
+
MIX_PROP_PLAY_MAX_MILLISECONDS_NUMBER = "SDL_mixer.play.max_milliseconds"
|
|
37
|
+
MIX_PROP_PLAY_START_FRAME_NUMBER = "SDL_mixer.play.start_frame"
|
|
38
|
+
MIX_PROP_PLAY_START_MILLISECOND_NUMBER = "SDL_mixer.play.start_millisecond"
|
|
39
|
+
MIX_PROP_PLAY_LOOP_START_FRAME_NUMBER = "SDL_mixer.play.loop_start_frame"
|
|
40
|
+
MIX_PROP_PLAY_LOOP_START_MILLISECOND_NUMBER = "SDL_mixer.play.loop_start_millisecond"
|
|
41
|
+
MIX_PROP_PLAY_FADE_IN_FRAMES_NUMBER = "SDL_mixer.play.fade_in_frames"
|
|
42
|
+
MIX_PROP_PLAY_FADE_IN_MILLISECONDS_NUMBER = "SDL_mixer.play.fade_in_milliseconds"
|
|
43
|
+
MIX_PROP_PLAY_APPEND_SILENCE_FRAMES_NUMBER = "SDL_mixer.play.append_silence_frames"
|
|
44
|
+
MIX_PROP_PLAY_APPEND_SILENCE_MILLISECONDS_NUMBER = "SDL_mixer.play.append_silence_milliseconds"
|
|
29
45
|
|
|
30
46
|
# Enum
|
|
31
47
|
|
|
32
|
-
MIX_NO_FADING = 0
|
|
33
|
-
MIX_FADING_OUT = 1
|
|
34
|
-
MIX_FADING_IN = 2
|
|
35
|
-
MUS_NONE = 0
|
|
36
|
-
MUS_WAV = 1
|
|
37
|
-
MUS_MOD = 2
|
|
38
|
-
MUS_MID = 3
|
|
39
|
-
MUS_OGG = 4
|
|
40
|
-
MUS_MP3 = 5
|
|
41
|
-
MUS_FLAC = 6
|
|
42
|
-
MUS_OPUS = 7
|
|
43
|
-
MUS_WAVPACK = 8
|
|
44
|
-
MUS_GME = 9
|
|
45
48
|
|
|
46
49
|
# Typedef
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
callback :
|
|
52
|
-
callback :Mix_MusicFinishedCallback, [], :void
|
|
53
|
-
callback :Mix_ChannelFinishedCallback, [:int], :void
|
|
54
|
-
callback :Mix_EffectFunc_t, [:int, :pointer, :int, :pointer], :void
|
|
55
|
-
callback :Mix_EffectDone_t, [:int, :pointer], :void
|
|
56
|
-
callback :Mix_EachSoundFontCallback, [:pointer, :pointer], :bool
|
|
51
|
+
callback :MIX_TrackStoppedCallback, [:pointer, :pointer], :void
|
|
52
|
+
callback :MIX_TrackMixCallback, [:pointer, :pointer, :pointer, :pointer, :int], :void
|
|
53
|
+
callback :MIX_GroupMixCallback, [:pointer, :pointer, :pointer, :pointer, :int], :void
|
|
54
|
+
callback :MIX_PostMixCallback, [:pointer, :pointer, :pointer, :pointer, :int], :void
|
|
57
55
|
|
|
58
56
|
# Struct
|
|
59
57
|
|
|
60
|
-
class
|
|
58
|
+
class MIX_StereoGains < FFI::Struct
|
|
61
59
|
layout(
|
|
62
|
-
:
|
|
63
|
-
:
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
:left, :float,
|
|
61
|
+
:right, :float,
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
class MIX_Point3D < FFI::Struct
|
|
66
|
+
layout(
|
|
67
|
+
:x, :float,
|
|
68
|
+
:y, :float,
|
|
69
|
+
:z, :float,
|
|
66
70
|
)
|
|
67
71
|
end
|
|
68
72
|
|
|
@@ -71,101 +75,95 @@ module SDL
|
|
|
71
75
|
|
|
72
76
|
def self.setup_mixer_symbols(output_error = false)
|
|
73
77
|
entries = [
|
|
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
|
-
[:Mix_GetSoundFonts, :Mix_GetSoundFonts, [], :pointer],
|
|
164
|
-
[:Mix_EachSoundFont, :Mix_EachSoundFont, [:Mix_EachSoundFontCallback, :pointer], :bool],
|
|
165
|
-
[:Mix_SetTimidityCfg, :Mix_SetTimidityCfg, [:pointer], :bool],
|
|
166
|
-
[:Mix_GetTimidityCfg, :Mix_GetTimidityCfg, [], :pointer],
|
|
167
|
-
[:Mix_GetChunk, :Mix_GetChunk, [:int], :pointer],
|
|
168
|
-
[:Mix_CloseAudio, :Mix_CloseAudio, [], :void],
|
|
78
|
+
[:MIX_Version, :MIX_Version, [], :int],
|
|
79
|
+
[:MIX_Init, :MIX_Init, [], :bool],
|
|
80
|
+
[:MIX_Quit, :MIX_Quit, [], :void],
|
|
81
|
+
[:MIX_GetNumAudioDecoders, :MIX_GetNumAudioDecoders, [], :int],
|
|
82
|
+
[:MIX_GetAudioDecoder, :MIX_GetAudioDecoder, [:int], :pointer],
|
|
83
|
+
[:MIX_CreateMixerDevice, :MIX_CreateMixerDevice, [:uint, :pointer], :pointer],
|
|
84
|
+
[:MIX_CreateMixer, :MIX_CreateMixer, [:pointer], :pointer],
|
|
85
|
+
[:MIX_DestroyMixer, :MIX_DestroyMixer, [:pointer], :void],
|
|
86
|
+
[:MIX_GetMixerProperties, :MIX_GetMixerProperties, [:pointer], :uint],
|
|
87
|
+
[:MIX_GetMixerFormat, :MIX_GetMixerFormat, [:pointer, :pointer], :bool],
|
|
88
|
+
[:MIX_LoadAudio_IO, :MIX_LoadAudio_IO, [:pointer, :pointer, :bool, :bool], :pointer],
|
|
89
|
+
[:MIX_LoadAudio, :MIX_LoadAudio, [:pointer, :pointer, :bool], :pointer],
|
|
90
|
+
[:MIX_LoadAudioWithProperties, :MIX_LoadAudioWithProperties, [:uint], :pointer],
|
|
91
|
+
[:MIX_LoadRawAudio_IO, :MIX_LoadRawAudio_IO, [:pointer, :pointer, :pointer, :bool], :pointer],
|
|
92
|
+
[:MIX_LoadRawAudio, :MIX_LoadRawAudio, [:pointer, :pointer, :ulong_long, :pointer], :pointer],
|
|
93
|
+
[:MIX_LoadRawAudioNoCopy, :MIX_LoadRawAudioNoCopy, [:pointer, :pointer, :ulong_long, :pointer, :bool], :pointer],
|
|
94
|
+
[:MIX_CreateSineWaveAudio, :MIX_CreateSineWaveAudio, [:pointer, :int, :float], :pointer],
|
|
95
|
+
[:MIX_GetAudioProperties, :MIX_GetAudioProperties, [:pointer], :uint],
|
|
96
|
+
[:MIX_GetAudioDuration, :MIX_GetAudioDuration, [:pointer], :long_long],
|
|
97
|
+
[:MIX_GetAudioFormat, :MIX_GetAudioFormat, [:pointer, :pointer], :bool],
|
|
98
|
+
[:MIX_DestroyAudio, :MIX_DestroyAudio, [:pointer], :void],
|
|
99
|
+
[:MIX_CreateTrack, :MIX_CreateTrack, [:pointer], :pointer],
|
|
100
|
+
[:MIX_DestroyTrack, :MIX_DestroyTrack, [:pointer], :void],
|
|
101
|
+
[:MIX_GetTrackProperties, :MIX_GetTrackProperties, [:pointer], :uint],
|
|
102
|
+
[:MIX_GetTrackMixer, :MIX_GetTrackMixer, [:pointer], :pointer],
|
|
103
|
+
[:MIX_SetTrackAudio, :MIX_SetTrackAudio, [:pointer, :pointer], :bool],
|
|
104
|
+
[:MIX_SetTrackAudioStream, :MIX_SetTrackAudioStream, [:pointer, :pointer], :bool],
|
|
105
|
+
[:MIX_SetTrackIOStream, :MIX_SetTrackIOStream, [:pointer, :pointer, :bool], :bool],
|
|
106
|
+
[:MIX_SetTrackRawIOStream, :MIX_SetTrackRawIOStream, [:pointer, :pointer, :pointer, :bool], :bool],
|
|
107
|
+
[:MIX_TagTrack, :MIX_TagTrack, [:pointer, :pointer], :bool],
|
|
108
|
+
[:MIX_UntagTrack, :MIX_UntagTrack, [:pointer, :pointer], :void],
|
|
109
|
+
[:MIX_GetTrackTags, :MIX_GetTrackTags, [:pointer, :pointer], :pointer],
|
|
110
|
+
[:MIX_GetTaggedTracks, :MIX_GetTaggedTracks, [:pointer, :pointer, :pointer], :pointer],
|
|
111
|
+
[:MIX_SetTrackPlaybackPosition, :MIX_SetTrackPlaybackPosition, [:pointer, :long_long], :bool],
|
|
112
|
+
[:MIX_GetTrackPlaybackPosition, :MIX_GetTrackPlaybackPosition, [:pointer], :long_long],
|
|
113
|
+
[:MIX_GetTrackFadeFrames, :MIX_GetTrackFadeFrames, [:pointer], :long_long],
|
|
114
|
+
[:MIX_TrackLooping, :MIX_TrackLooping, [:pointer], :bool],
|
|
115
|
+
[:MIX_SetTrackLoops, :MIX_SetTrackLoops, [:pointer, :int], :bool],
|
|
116
|
+
[:MIX_GetTrackAudio, :MIX_GetTrackAudio, [:pointer], :pointer],
|
|
117
|
+
[:MIX_GetTrackAudioStream, :MIX_GetTrackAudioStream, [:pointer], :pointer],
|
|
118
|
+
[:MIX_GetTrackRemaining, :MIX_GetTrackRemaining, [:pointer], :long_long],
|
|
119
|
+
[:MIX_TrackMSToFrames, :MIX_TrackMSToFrames, [:pointer, :long_long], :long_long],
|
|
120
|
+
[:MIX_TrackFramesToMS, :MIX_TrackFramesToMS, [:pointer, :long_long], :long_long],
|
|
121
|
+
[:MIX_AudioMSToFrames, :MIX_AudioMSToFrames, [:pointer, :long_long], :long_long],
|
|
122
|
+
[:MIX_AudioFramesToMS, :MIX_AudioFramesToMS, [:pointer, :long_long], :long_long],
|
|
123
|
+
[:MIX_MSToFrames, :MIX_MSToFrames, [:int, :long_long], :long_long],
|
|
124
|
+
[:MIX_FramesToMS, :MIX_FramesToMS, [:int, :long_long], :long_long],
|
|
125
|
+
[:MIX_PlayTrack, :MIX_PlayTrack, [:pointer, :uint], :bool],
|
|
126
|
+
[:MIX_PlayTag, :MIX_PlayTag, [:pointer, :pointer, :uint], :bool],
|
|
127
|
+
[:MIX_PlayAudio, :MIX_PlayAudio, [:pointer, :pointer], :bool],
|
|
128
|
+
[:MIX_StopTrack, :MIX_StopTrack, [:pointer, :long_long], :bool],
|
|
129
|
+
[:MIX_StopAllTracks, :MIX_StopAllTracks, [:pointer, :long_long], :bool],
|
|
130
|
+
[:MIX_StopTag, :MIX_StopTag, [:pointer, :pointer, :long_long], :bool],
|
|
131
|
+
[:MIX_PauseTrack, :MIX_PauseTrack, [:pointer], :bool],
|
|
132
|
+
[:MIX_PauseAllTracks, :MIX_PauseAllTracks, [:pointer], :bool],
|
|
133
|
+
[:MIX_PauseTag, :MIX_PauseTag, [:pointer, :pointer], :bool],
|
|
134
|
+
[:MIX_ResumeTrack, :MIX_ResumeTrack, [:pointer], :bool],
|
|
135
|
+
[:MIX_ResumeAllTracks, :MIX_ResumeAllTracks, [:pointer], :bool],
|
|
136
|
+
[:MIX_ResumeTag, :MIX_ResumeTag, [:pointer, :pointer], :bool],
|
|
137
|
+
[:MIX_TrackPlaying, :MIX_TrackPlaying, [:pointer], :bool],
|
|
138
|
+
[:MIX_TrackPaused, :MIX_TrackPaused, [:pointer], :bool],
|
|
139
|
+
[:MIX_SetMasterGain, :MIX_SetMasterGain, [:pointer, :float], :bool],
|
|
140
|
+
[:MIX_GetMasterGain, :MIX_GetMasterGain, [:pointer], :float],
|
|
141
|
+
[:MIX_SetTrackGain, :MIX_SetTrackGain, [:pointer, :float], :bool],
|
|
142
|
+
[:MIX_GetTrackGain, :MIX_GetTrackGain, [:pointer], :float],
|
|
143
|
+
[:MIX_SetTagGain, :MIX_SetTagGain, [:pointer, :pointer, :float], :bool],
|
|
144
|
+
[:MIX_SetTrackFrequencyRatio, :MIX_SetTrackFrequencyRatio, [:pointer, :float], :bool],
|
|
145
|
+
[:MIX_GetTrackFrequencyRatio, :MIX_GetTrackFrequencyRatio, [:pointer], :float],
|
|
146
|
+
[:MIX_SetTrackOutputChannelMap, :MIX_SetTrackOutputChannelMap, [:pointer, :pointer, :int], :bool],
|
|
147
|
+
[:MIX_SetTrackStereo, :MIX_SetTrackStereo, [:pointer, :pointer], :bool],
|
|
148
|
+
[:MIX_SetTrack3DPosition, :MIX_SetTrack3DPosition, [:pointer, :pointer], :bool],
|
|
149
|
+
[:MIX_GetTrack3DPosition, :MIX_GetTrack3DPosition, [:pointer, :pointer], :bool],
|
|
150
|
+
[:MIX_CreateGroup, :MIX_CreateGroup, [:pointer], :pointer],
|
|
151
|
+
[:MIX_DestroyGroup, :MIX_DestroyGroup, [:pointer], :void],
|
|
152
|
+
[:MIX_GetGroupProperties, :MIX_GetGroupProperties, [:pointer], :uint],
|
|
153
|
+
[:MIX_GetGroupMixer, :MIX_GetGroupMixer, [:pointer], :pointer],
|
|
154
|
+
[:MIX_SetTrackGroup, :MIX_SetTrackGroup, [:pointer, :pointer], :bool],
|
|
155
|
+
[:MIX_SetTrackStoppedCallback, :MIX_SetTrackStoppedCallback, [:pointer, :MIX_TrackStoppedCallback, :pointer], :bool],
|
|
156
|
+
[:MIX_SetTrackRawCallback, :MIX_SetTrackRawCallback, [:pointer, :MIX_TrackMixCallback, :pointer], :bool],
|
|
157
|
+
[:MIX_SetTrackCookedCallback, :MIX_SetTrackCookedCallback, [:pointer, :MIX_TrackMixCallback, :pointer], :bool],
|
|
158
|
+
[:MIX_SetGroupPostMixCallback, :MIX_SetGroupPostMixCallback, [:pointer, :MIX_GroupMixCallback, :pointer], :bool],
|
|
159
|
+
[:MIX_SetPostMixCallback, :MIX_SetPostMixCallback, [:pointer, :MIX_PostMixCallback, :pointer], :bool],
|
|
160
|
+
[:MIX_Generate, :MIX_Generate, [:pointer, :pointer, :int], :bool],
|
|
161
|
+
[:MIX_CreateAudioDecoder, :MIX_CreateAudioDecoder, [:pointer, :uint], :pointer],
|
|
162
|
+
[:MIX_CreateAudioDecoder_IO, :MIX_CreateAudioDecoder_IO, [:pointer, :bool, :uint], :pointer],
|
|
163
|
+
[:MIX_DestroyAudioDecoder, :MIX_DestroyAudioDecoder, [:pointer], :void],
|
|
164
|
+
[:MIX_GetAudioDecoderProperties, :MIX_GetAudioDecoderProperties, [:pointer], :uint],
|
|
165
|
+
[:MIX_GetAudioDecoderFormat, :MIX_GetAudioDecoderFormat, [:pointer, :pointer], :bool],
|
|
166
|
+
[:MIX_DecodeAudio, :MIX_DecodeAudio, [:pointer, :pointer, :int, :pointer], :int],
|
|
169
167
|
]
|
|
170
168
|
entries.each do |entry|
|
|
171
169
|
attach_function entry[0], entry[1], entry[2], entry[3]
|
data/lib/sdl3_mouse.rb
CHANGED
|
@@ -48,9 +48,17 @@ module SDL
|
|
|
48
48
|
typedef :int, :SDL_SystemCursor
|
|
49
49
|
typedef :int, :SDL_MouseWheelDirection
|
|
50
50
|
typedef :uint, :SDL_MouseButtonFlags
|
|
51
|
+
callback :SDL_MouseMotionTransformCallback, [:pointer, :ulong_long, :pointer, :uint, :pointer, :pointer], :void
|
|
51
52
|
|
|
52
53
|
# Struct
|
|
53
54
|
|
|
55
|
+
class CursorFrameInfo < FFI::Struct
|
|
56
|
+
layout(
|
|
57
|
+
:surface, :pointer,
|
|
58
|
+
:duration, :uint,
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
54
62
|
|
|
55
63
|
# Function
|
|
56
64
|
|
|
@@ -65,11 +73,13 @@ module SDL
|
|
|
65
73
|
[:GetRelativeMouseState, :SDL_GetRelativeMouseState, [:pointer, :pointer], :uint],
|
|
66
74
|
[:WarpMouseInWindow, :SDL_WarpMouseInWindow, [:pointer, :float, :float], :void],
|
|
67
75
|
[:WarpMouseGlobal, :SDL_WarpMouseGlobal, [:float, :float], :bool],
|
|
76
|
+
[:SetRelativeMouseTransform, :SDL_SetRelativeMouseTransform, [:SDL_MouseMotionTransformCallback, :pointer], :bool],
|
|
68
77
|
[:SetWindowRelativeMouseMode, :SDL_SetWindowRelativeMouseMode, [:pointer, :bool], :bool],
|
|
69
78
|
[:GetWindowRelativeMouseMode, :SDL_GetWindowRelativeMouseMode, [:pointer], :bool],
|
|
70
79
|
[:CaptureMouse, :SDL_CaptureMouse, [:bool], :bool],
|
|
71
80
|
[:CreateCursor, :SDL_CreateCursor, [:pointer, :pointer, :int, :int, :int, :int], :pointer],
|
|
72
81
|
[:CreateColorCursor, :SDL_CreateColorCursor, [:pointer, :int, :int], :pointer],
|
|
82
|
+
[:CreateAnimatedCursor, :SDL_CreateAnimatedCursor, [:pointer, :int, :int, :int], :pointer],
|
|
73
83
|
[:CreateSystemCursor, :SDL_CreateSystemCursor, [:int], :pointer],
|
|
74
84
|
[:SetCursor, :SDL_SetCursor, [:pointer], :bool],
|
|
75
85
|
[:GetCursor, :SDL_GetCursor, [], :pointer],
|
data/lib/sdl3_pen.rb
CHANGED
|
@@ -19,6 +19,7 @@ module SDL
|
|
|
19
19
|
PEN_INPUT_BUTTON_4 = 1 << 4
|
|
20
20
|
PEN_INPUT_BUTTON_5 = 1 << 5
|
|
21
21
|
PEN_INPUT_ERASER_TIP = 1 << 30
|
|
22
|
+
PEN_INPUT_IN_PROXIMITY = 1 << 31
|
|
22
23
|
|
|
23
24
|
# Enum
|
|
24
25
|
|
|
@@ -30,12 +31,17 @@ module SDL
|
|
|
30
31
|
PEN_AXIS_SLIDER = 5
|
|
31
32
|
PEN_AXIS_TANGENTIAL_PRESSURE = 6
|
|
32
33
|
PEN_AXIS_COUNT = 7
|
|
34
|
+
PEN_DEVICE_TYPE_INVALID = -1
|
|
35
|
+
PEN_DEVICE_TYPE_UNKNOWN = 0
|
|
36
|
+
PEN_DEVICE_TYPE_DIRECT = 1
|
|
37
|
+
PEN_DEVICE_TYPE_INDIRECT = 2
|
|
33
38
|
|
|
34
39
|
# Typedef
|
|
35
40
|
|
|
36
41
|
typedef :uint, :SDL_PenID
|
|
37
42
|
typedef :uint, :SDL_PenInputFlags
|
|
38
43
|
typedef :int, :SDL_PenAxis
|
|
44
|
+
typedef :int, :SDL_PenDeviceType
|
|
39
45
|
|
|
40
46
|
# Struct
|
|
41
47
|
|
|
@@ -44,6 +50,7 @@ module SDL
|
|
|
44
50
|
|
|
45
51
|
def self.setup_pen_symbols(output_error = false)
|
|
46
52
|
entries = [
|
|
53
|
+
[:GetPenDeviceType, :SDL_GetPenDeviceType, [:uint], :int],
|
|
47
54
|
]
|
|
48
55
|
entries.each do |entry|
|
|
49
56
|
attach_function entry[0], entry[1], entry[2], entry[3]
|
data/lib/sdl3_pixels.rb
CHANGED
data/lib/sdl3_process.rb
CHANGED
|
@@ -12,6 +12,7 @@ module SDL
|
|
|
12
12
|
|
|
13
13
|
PROP_PROCESS_CREATE_ARGS_POINTER = "SDL.process.create.args"
|
|
14
14
|
PROP_PROCESS_CREATE_ENVIRONMENT_POINTER = "SDL.process.create.environment"
|
|
15
|
+
PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING = "SDL.process.create.working_directory"
|
|
15
16
|
PROP_PROCESS_CREATE_STDIN_NUMBER = "SDL.process.create.stdin_option"
|
|
16
17
|
PROP_PROCESS_CREATE_STDIN_POINTER = "SDL.process.create.stdin_source"
|
|
17
18
|
PROP_PROCESS_CREATE_STDOUT_NUMBER = "SDL.process.create.stdout_option"
|
|
@@ -20,6 +21,7 @@ module SDL
|
|
|
20
21
|
PROP_PROCESS_CREATE_STDERR_POINTER = "SDL.process.create.stderr_source"
|
|
21
22
|
PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN = "SDL.process.create.stderr_to_stdout"
|
|
22
23
|
PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN = "SDL.process.create.background"
|
|
24
|
+
PROP_PROCESS_CREATE_CMDLINE_STRING = "SDL.process.create.cmdline"
|
|
23
25
|
PROP_PROCESS_PID_NUMBER = "SDL.process.pid"
|
|
24
26
|
PROP_PROCESS_STDIN_POINTER = "SDL.process.stdin"
|
|
25
27
|
PROP_PROCESS_STDOUT_POINTER = "SDL.process.stdout"
|
data/lib/sdl3_properties.rb
CHANGED
data/lib/sdl3_render.rb
CHANGED
|
@@ -11,11 +11,16 @@ module SDL
|
|
|
11
11
|
# Define/Macro
|
|
12
12
|
|
|
13
13
|
SOFTWARE_RENDERER = "software"
|
|
14
|
+
GPU_RENDERER = "gpu"
|
|
14
15
|
PROP_RENDERER_CREATE_NAME_STRING = "SDL.renderer.create.name"
|
|
15
16
|
PROP_RENDERER_CREATE_WINDOW_POINTER = "SDL.renderer.create.window"
|
|
16
17
|
PROP_RENDERER_CREATE_SURFACE_POINTER = "SDL.renderer.create.surface"
|
|
17
18
|
PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER = "SDL.renderer.create.output_colorspace"
|
|
18
19
|
PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER = "SDL.renderer.create.present_vsync"
|
|
20
|
+
PROP_RENDERER_CREATE_GPU_DEVICE_POINTER = "SDL.renderer.create.gpu.device"
|
|
21
|
+
PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN = "SDL.renderer.create.gpu.shaders_spirv"
|
|
22
|
+
PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEAN = "SDL.renderer.create.gpu.shaders_dxil"
|
|
23
|
+
PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEAN = "SDL.renderer.create.gpu.shaders_msl"
|
|
19
24
|
PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER = "SDL.renderer.create.vulkan.instance"
|
|
20
25
|
PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER = "SDL.renderer.create.vulkan.surface"
|
|
21
26
|
PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER = "SDL.renderer.create.vulkan.physical_device"
|
|
@@ -28,6 +33,7 @@ module SDL
|
|
|
28
33
|
PROP_RENDERER_VSYNC_NUMBER = "SDL.renderer.vsync"
|
|
29
34
|
PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER = "SDL.renderer.max_texture_size"
|
|
30
35
|
PROP_RENDERER_TEXTURE_FORMATS_POINTER = "SDL.renderer.texture_formats"
|
|
36
|
+
PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN = "SDL.renderer.texture_wrapping"
|
|
31
37
|
PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER = "SDL.renderer.output_colorspace"
|
|
32
38
|
PROP_RENDERER_HDR_ENABLED_BOOLEAN = "SDL.renderer.HDR_enabled"
|
|
33
39
|
PROP_RENDERER_SDR_WHITE_POINT_FLOAT = "SDL.renderer.SDR_white_point"
|
|
@@ -51,6 +57,7 @@ module SDL
|
|
|
51
57
|
PROP_TEXTURE_CREATE_ACCESS_NUMBER = "SDL.texture.create.access"
|
|
52
58
|
PROP_TEXTURE_CREATE_WIDTH_NUMBER = "SDL.texture.create.width"
|
|
53
59
|
PROP_TEXTURE_CREATE_HEIGHT_NUMBER = "SDL.texture.create.height"
|
|
60
|
+
PROP_TEXTURE_CREATE_PALETTE_POINTER = "SDL.texture.create.palette"
|
|
54
61
|
PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT = "SDL.texture.create.SDR_white_point"
|
|
55
62
|
PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT = "SDL.texture.create.HDR_headroom"
|
|
56
63
|
PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER = "SDL.texture.create.d3d11.texture"
|
|
@@ -69,6 +76,11 @@ module SDL
|
|
|
69
76
|
PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER = "SDL.texture.create.opengles2.texture_u"
|
|
70
77
|
PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER = "SDL.texture.create.opengles2.texture_v"
|
|
71
78
|
PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER = "SDL.texture.create.vulkan.texture"
|
|
79
|
+
PROP_TEXTURE_CREATE_VULKAN_LAYOUT_NUMBER = "SDL.texture.create.vulkan.layout"
|
|
80
|
+
PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER = "SDL.texture.create.gpu.texture"
|
|
81
|
+
PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_POINTER = "SDL.texture.create.gpu.texture_uv"
|
|
82
|
+
PROP_TEXTURE_CREATE_GPU_TEXTURE_U_POINTER = "SDL.texture.create.gpu.texture_u"
|
|
83
|
+
PROP_TEXTURE_CREATE_GPU_TEXTURE_V_POINTER = "SDL.texture.create.gpu.texture_v"
|
|
72
84
|
PROP_TEXTURE_COLORSPACE_NUMBER = "SDL.texture.colorspace"
|
|
73
85
|
PROP_TEXTURE_FORMAT_NUMBER = "SDL.texture.format"
|
|
74
86
|
PROP_TEXTURE_ACCESS_NUMBER = "SDL.texture.access"
|
|
@@ -95,6 +107,10 @@ module SDL
|
|
|
95
107
|
PROP_TEXTURE_OPENGLES2_TEXTURE_V_NUMBER = "SDL.texture.opengles2.texture_v"
|
|
96
108
|
PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET_NUMBER = "SDL.texture.opengles2.target"
|
|
97
109
|
PROP_TEXTURE_VULKAN_TEXTURE_NUMBER = "SDL.texture.vulkan.texture"
|
|
110
|
+
PROP_TEXTURE_GPU_TEXTURE_POINTER = "SDL.texture.gpu.texture"
|
|
111
|
+
PROP_TEXTURE_GPU_TEXTURE_UV_POINTER = "SDL.texture.gpu.texture_uv"
|
|
112
|
+
PROP_TEXTURE_GPU_TEXTURE_U_POINTER = "SDL.texture.gpu.texture_u"
|
|
113
|
+
PROP_TEXTURE_GPU_TEXTURE_V_POINTER = "SDL.texture.gpu.texture_v"
|
|
98
114
|
RENDERER_VSYNC_DISABLED = 0
|
|
99
115
|
RENDERER_VSYNC_ADAPTIVE = -1
|
|
100
116
|
DEBUG_TEXT_FONT_CHARACTER_SIZE = 8
|
|
@@ -104,6 +120,10 @@ module SDL
|
|
|
104
120
|
TEXTUREACCESS_STATIC = 0
|
|
105
121
|
TEXTUREACCESS_STREAMING = 1
|
|
106
122
|
TEXTUREACCESS_TARGET = 2
|
|
123
|
+
TEXTURE_ADDRESS_INVALID = -1
|
|
124
|
+
TEXTURE_ADDRESS_AUTO = 0
|
|
125
|
+
TEXTURE_ADDRESS_CLAMP = 1
|
|
126
|
+
TEXTURE_ADDRESS_WRAP = 2
|
|
107
127
|
LOGICAL_PRESENTATION_DISABLED = 0
|
|
108
128
|
LOGICAL_PRESENTATION_STRETCH = 1
|
|
109
129
|
LOGICAL_PRESENTATION_LETTERBOX = 2
|
|
@@ -113,6 +133,7 @@ module SDL
|
|
|
113
133
|
# Typedef
|
|
114
134
|
|
|
115
135
|
typedef :int, :SDL_TextureAccess
|
|
136
|
+
typedef :int, :SDL_TextureAddressMode
|
|
116
137
|
typedef :int, :SDL_RendererLogicalPresentation
|
|
117
138
|
|
|
118
139
|
# Struct
|
|
@@ -134,6 +155,19 @@ module SDL
|
|
|
134
155
|
)
|
|
135
156
|
end
|
|
136
157
|
|
|
158
|
+
class GPURenderStateCreateInfo < FFI::Struct
|
|
159
|
+
layout(
|
|
160
|
+
:fragment_shader, :pointer,
|
|
161
|
+
:num_sampler_bindings, :int,
|
|
162
|
+
:sampler_bindings, :pointer,
|
|
163
|
+
:num_storage_textures, :int,
|
|
164
|
+
:storage_textures, :pointer,
|
|
165
|
+
:num_storage_buffers, :int,
|
|
166
|
+
:storage_buffers, :pointer,
|
|
167
|
+
:props, :uint,
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
|
|
137
171
|
|
|
138
172
|
# Function
|
|
139
173
|
|
|
@@ -144,6 +178,8 @@ module SDL
|
|
|
144
178
|
[:CreateWindowAndRenderer, :SDL_CreateWindowAndRenderer, [:pointer, :int, :int, :ulong_long, :pointer, :pointer], :bool],
|
|
145
179
|
[:CreateRenderer, :SDL_CreateRenderer, [:pointer, :pointer], :pointer],
|
|
146
180
|
[:CreateRendererWithProperties, :SDL_CreateRendererWithProperties, [:uint], :pointer],
|
|
181
|
+
[:CreateGPURenderer, :SDL_CreateGPURenderer, [:pointer, :pointer], :pointer],
|
|
182
|
+
[:GetGPURendererDevice, :SDL_GetGPURendererDevice, [:pointer], :pointer],
|
|
147
183
|
[:CreateSoftwareRenderer, :SDL_CreateSoftwareRenderer, [:pointer], :pointer],
|
|
148
184
|
[:GetRenderer, :SDL_GetRenderer, [:pointer], :pointer],
|
|
149
185
|
[:GetRenderWindow, :SDL_GetRenderWindow, [:pointer], :pointer],
|
|
@@ -157,6 +193,8 @@ module SDL
|
|
|
157
193
|
[:GetTextureProperties, :SDL_GetTextureProperties, [:pointer], :uint],
|
|
158
194
|
[:GetRendererFromTexture, :SDL_GetRendererFromTexture, [:pointer], :pointer],
|
|
159
195
|
[:GetTextureSize, :SDL_GetTextureSize, [:pointer, :pointer, :pointer], :bool],
|
|
196
|
+
[:SetTexturePalette, :SDL_SetTexturePalette, [:pointer, :pointer], :bool],
|
|
197
|
+
[:GetTexturePalette, :SDL_GetTexturePalette, [:pointer], :pointer],
|
|
160
198
|
[:SetTextureColorMod, :SDL_SetTextureColorMod, [:pointer, :uchar, :uchar, :uchar], :bool],
|
|
161
199
|
[:SetTextureColorModFloat, :SDL_SetTextureColorModFloat, [:pointer, :float, :float, :float], :bool],
|
|
162
200
|
[:GetTextureColorMod, :SDL_GetTextureColorMod, [:pointer, :pointer, :pointer, :pointer], :bool],
|
|
@@ -214,8 +252,11 @@ module SDL
|
|
|
214
252
|
[:RenderTextureAffine, :SDL_RenderTextureAffine, [:pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :bool],
|
|
215
253
|
[:RenderTextureTiled, :SDL_RenderTextureTiled, [:pointer, :pointer, :pointer, :float, :pointer], :bool],
|
|
216
254
|
[:RenderTexture9Grid, :SDL_RenderTexture9Grid, [:pointer, :pointer, :pointer, :float, :float, :float, :float, :float, :pointer], :bool],
|
|
255
|
+
[:RenderTexture9GridTiled, :SDL_RenderTexture9GridTiled, [:pointer, :pointer, :pointer, :float, :float, :float, :float, :float, :pointer, :float], :bool],
|
|
217
256
|
[:RenderGeometry, :SDL_RenderGeometry, [:pointer, :pointer, :pointer, :int, :pointer, :int], :bool],
|
|
218
257
|
[:RenderGeometryRaw, :SDL_RenderGeometryRaw, [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int, :int, :pointer, :int, :int], :bool],
|
|
258
|
+
[:SetRenderTextureAddressMode, :SDL_SetRenderTextureAddressMode, [:pointer, :int, :int], :bool],
|
|
259
|
+
[:GetRenderTextureAddressMode, :SDL_GetRenderTextureAddressMode, [:pointer, :pointer, :pointer], :bool],
|
|
219
260
|
[:RenderReadPixels, :SDL_RenderReadPixels, [:pointer, :pointer], :pointer],
|
|
220
261
|
[:RenderPresent, :SDL_RenderPresent, [:pointer], :bool],
|
|
221
262
|
[:DestroyTexture, :SDL_DestroyTexture, [:pointer], :void],
|
|
@@ -228,6 +269,12 @@ module SDL
|
|
|
228
269
|
[:GetRenderVSync, :SDL_GetRenderVSync, [:pointer, :pointer], :bool],
|
|
229
270
|
[:RenderDebugText, :SDL_RenderDebugText, [:pointer, :float, :float, :pointer], :bool],
|
|
230
271
|
[:RenderDebugTextFormat, :SDL_RenderDebugTextFormat, [:pointer, :float, :float, :pointer], :bool],
|
|
272
|
+
[:SetDefaultTextureScaleMode, :SDL_SetDefaultTextureScaleMode, [:pointer, :int], :bool],
|
|
273
|
+
[:GetDefaultTextureScaleMode, :SDL_GetDefaultTextureScaleMode, [:pointer, :pointer], :bool],
|
|
274
|
+
[:CreateGPURenderState, :SDL_CreateGPURenderState, [:pointer, :pointer], :pointer],
|
|
275
|
+
[:SetGPURenderStateFragmentUniforms, :SDL_SetGPURenderStateFragmentUniforms, [:pointer, :uint, :pointer, :uint], :bool],
|
|
276
|
+
[:SetGPURenderState, :SDL_SetGPURenderState, [:pointer, :pointer], :bool],
|
|
277
|
+
[:DestroyGPURenderState, :SDL_DestroyGPURenderState, [:pointer], :void],
|
|
231
278
|
]
|
|
232
279
|
entries.each do |entry|
|
|
233
280
|
attach_function entry[0], entry[1], entry[2], entry[3]
|
data/lib/sdl3_revision.rb
CHANGED
data/lib/sdl3_sensor.rb
CHANGED
data/lib/sdl3_sound.rb
CHANGED
|
@@ -10,9 +10,6 @@ module SDL
|
|
|
10
10
|
extend FFI::Library
|
|
11
11
|
# Define/Macro
|
|
12
12
|
|
|
13
|
-
SOUND_VER_MAJOR = 3
|
|
14
|
-
SOUND_VER_MINOR = 0
|
|
15
|
-
SOUND_VER_PATCH = 0
|
|
16
13
|
|
|
17
14
|
# Enum
|
|
18
15
|
|
|
@@ -28,14 +25,6 @@ module SDL
|
|
|
28
25
|
|
|
29
26
|
# Struct
|
|
30
27
|
|
|
31
|
-
class Sound_AudioInfo < FFI::Struct
|
|
32
|
-
layout(
|
|
33
|
-
:format, :ushort,
|
|
34
|
-
:channels, :uchar,
|
|
35
|
-
:rate, :uint,
|
|
36
|
-
)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
28
|
class Sound_DecoderInfo < FFI::Struct
|
|
40
29
|
layout(
|
|
41
30
|
:extensions, :pointer,
|
|
@@ -49,28 +38,20 @@ module SDL
|
|
|
49
38
|
layout(
|
|
50
39
|
:opaque, :pointer,
|
|
51
40
|
:decoder, :pointer,
|
|
52
|
-
:desired,
|
|
53
|
-
:actual,
|
|
41
|
+
:desired, AudioSpec,
|
|
42
|
+
:actual, AudioSpec,
|
|
54
43
|
:buffer, :pointer,
|
|
55
44
|
:buffer_size, :uint,
|
|
56
45
|
:flags, :int,
|
|
57
46
|
)
|
|
58
47
|
end
|
|
59
48
|
|
|
60
|
-
class Sound_Version < FFI::Struct
|
|
61
|
-
layout(
|
|
62
|
-
:major, :int,
|
|
63
|
-
:minor, :int,
|
|
64
|
-
:patch, :int,
|
|
65
|
-
)
|
|
66
|
-
end
|
|
67
|
-
|
|
68
49
|
|
|
69
50
|
# Function
|
|
70
51
|
|
|
71
52
|
def self.setup_sound_symbols(output_error = false)
|
|
72
53
|
entries = [
|
|
73
|
-
[:
|
|
54
|
+
[:Sound_Version, :Sound_Version, [], :int],
|
|
74
55
|
[:Sound_Init, :Sound_Init, [], :int],
|
|
75
56
|
[:Sound_Quit, :Sound_Quit, [], :int],
|
|
76
57
|
[:Sound_AvailableDecoders, :Sound_AvailableDecoders, [], :pointer],
|