aboutsummaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorrobomage <superwizardrobot@gmail.com>2025-07-27 17:39:42 -0400
committerrobomage <superwizardrobot@gmail.com>2025-07-27 17:39:42 -0400
commit55de1dd92327bacc2ff6d4fcaa3aa4a87fd8f1a2 (patch)
treeca69c81cc10f0794229d41db12b0e9b96e07b58f /vendor
parenta93d3503b1bb647f3d1b4ec168ed6138d90ef1e3 (diff)
SDL2 - audio allow change bit_set
sdl.OpenAudioDevice was incorrectly using a bool instead of a c.int for it's last parameter. To make the proc call more idiomatic and inline with other bindings a new bit_set was introduced to be used in place of the constants
Diffstat (limited to 'vendor')
-rw-r--r--vendor/sdl2/sdl_audio.odin16
1 files changed, 9 insertions, 7 deletions
diff --git a/vendor/sdl2/sdl_audio.odin b/vendor/sdl2/sdl_audio.odin
index 6ff9e93f4..296a773c4 100644
--- a/vendor/sdl2/sdl_audio.odin
+++ b/vendor/sdl2/sdl_audio.odin
@@ -74,12 +74,14 @@ when ODIN_ENDIAN == .Little {
AUDIO_F32SYS :: AUDIO_F32MSB
}
-
-AUDIO_ALLOW_FREQUENCY_CHANGE :: 0x00000001
-AUDIO_ALLOW_FORMAT_CHANGE :: 0x00000002
-AUDIO_ALLOW_CHANNELS_CHANGE :: 0x00000004
-AUDIO_ALLOW_SAMPLES_CHANGE :: 0x00000008
-AUDIO_ALLOW_ANY_CHANGE :: AUDIO_ALLOW_FREQUENCY_CHANGE|AUDIO_ALLOW_FORMAT_CHANGE|AUDIO_ALLOW_CHANNELS_CHANGE|AUDIO_ALLOW_SAMPLES_CHANGE
+AudioAllowChangeFlags :: distinct bit_set[AudioAllowChangeFlag; c.int]
+AudioAllowChangeFlag :: enum c.int {
+ FREQUENCY = 0,
+ FORMAT = 1,
+ CHANNELS = 2,
+ SAMPLES = 3,
+}
+AUDIO_ALLOW_ANY_CHANGE :: AudioAllowChangeFlags{.FREQUENCY, .FORMAT, .CHANNELS, .SAMPLES}
AudioCallback :: proc "c" (userdata: rawptr, stream: [^]u8, len: c.int)
@@ -151,7 +153,7 @@ foreign lib {
iscapture: bool,
desired: ^AudioSpec,
obtained: ^AudioSpec,
- allowed_changes: bool) -> AudioDeviceID ---
+ allowed_changes: AudioAllowChangeFlags) -> AudioDeviceID ---
}