update SDL3 to 3.2.6.

This commit is contained in:
Sasha Szpakowski
2025-03-02 14:42:35 -04:00
parent 3582488fbc
commit 30709de450
407 changed files with 20390 additions and 5388 deletions
@@ -1,5 +1,5 @@
If you're running this in a web browser, you need to click the window before you'll hear anything!
This example code creates an simple audio stream for playing sound, and
This example code creates a simple audio stream for playing sound, and
generates a sine wave sound effect for it to play as time goes on. This is the
simplest way to get up and running with procedural sound.
@@ -1,5 +1,5 @@
/*
* This example code creates an simple audio stream for playing sound, and
* This example code creates a simple audio stream for playing sound, and
* generates a sine wave sound effect for it to play as time goes on. This
* is the simplest way to get up and running with procedural sound.
*
@@ -69,7 +69,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
A sine wave is unchanging audio--easy to stream--but for video games, you'll want
to generate significantly _less_ audio ahead of time! */
const int minimum_audio = (8000 * sizeof (float)) / 2; /* 8000 float samples per second. Half of that. */
if (SDL_GetAudioStreamAvailable(stream) < minimum_audio) {
if (SDL_GetAudioStreamQueued(stream) < minimum_audio) {
static float samples[512]; /* this will feed 512 samples each frame until we get to our maximum. */
int i;
@@ -1,5 +1,5 @@
If you're running this in a web browser, you need to click the window before you'll hear anything!
This example code creates an simple audio stream for playing sound, and
This example code creates a simple audio stream for playing sound, and
generates a sine wave sound effect for it to play as time goes on. Unlike
the previous example, this uses a callback to generate sound.
@@ -1,5 +1,5 @@
/*
* This example code creates an simple audio stream for playing sound, and
* This example code creates a simple audio stream for playing sound, and
* generates a sine wave sound effect for it to play as time goes on. Unlike
* the previous example, this uses a callback to generate sound.
*
@@ -1,5 +1,5 @@
If you're running this in a web browser, you need to click the window before you'll hear anything!
This example code creates an simple audio stream for playing sound, and
This example code creates a simple audio stream for playing sound, and
loads a .wav file that is pushed through the stream in a loop.
@@ -1,5 +1,5 @@
/*
* This example code creates an simple audio stream for playing sound, and
* This example code creates a simple audio stream for playing sound, and
* loads a .wav file that is pushed through the stream in a loop.
*
* This code is public domain. Feel free to use it for any purpose!
@@ -82,7 +82,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
We're being lazy here, but if there's less than the entire wav file left to play,
just shove a whole copy of it into the queue, so we always have _tons_ of
data queued for playback. */
if (SDL_GetAudioStreamAvailable(stream) < (int)wav_data_len) {
if (SDL_GetAudioStreamQueued(stream) < (int)wav_data_len) {
/* feed more data to the stream. It will queue at the end, and trickle out as the hardware needs more data. */
SDL_PutAudioStreamData(stream, wav_data, wav_data_len);
}
@@ -104,7 +104,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
/* If less than a full copy of the audio is queued for playback, put another copy in there.
This is overkill, but easy when lots of RAM is cheap. One could be more careful and
queue less at a time, as long as the stream doesn't run dry. */
if (SDL_GetAudioStreamAvailable(sounds[i].stream) < ((int) sounds[i].wav_data_len)) {
if (SDL_GetAudioStreamQueued(sounds[i].stream) < ((int) sounds[i].wav_data_len)) {
SDL_PutAudioStreamData(sounds[i].stream, sounds[i].wav_data, (int) sounds[i].wav_data_len);
}
}