SDL_AUDIO_ISFLOAT(3)
π SDL_AUDIO_ISFLOAT(3) β SDL3 FUNCTIONS π
okay bestie, welcome to the SDL3 functions corner of the group chat, where we answer the one question that keeps you up at night: is this audio format floaty or not? πΈ
β¨ NAME β¨
SDL_AUDIO_ISFLOAT β the macro that tells you whether an SDL_AudioFormat is giving floating point data energy. π¦
β¨ SYNOPSIS β¨
#include <SDL3/SDL_audio.h>
#define SDL_AUDIO_ISFLOAT(x) ((x) & SDL_AUDIO_MASK_FLOAT)
literally one line of macro, no cap. she's small but she's iconic. π
β¨ DESCRIPTION β¨
So here's the vibe: you hand her an SDL_AudioFormat, she peeks at it, and she's like "yeah that's float" or "nope, not float". that's the whole job. she's not doing your taxes. π
for example, SDL_AUDIO_ISFLOAT(SDL_AUDIO_S16) returns 0. because SDL_AUDIO_S16? not float. she said what she said. π
β¨ MACRO PARAMETERS β¨
xβ anSDL_AudioFormatvalue. that's it, that's the whole input, she's low maintenance. π
β¨ RETURN VALUE β¨
- non-zero if the format is floating point π
- zero otherwise π
so like, truthy or falsy. classic.
β¨ THREAD SAFETY β¨
it is safe to call this macro from any thread. any of them. all of them. every single thread. she does not care, she is unbothered, she is main character energy. π
β¨ AVAILABILITY β¨
this macro has been available since SDL 3.2.0. if you're on something olderβ¦ bestie. upgrade. π§
ngl if you're out here checking formats on ancient SDL you're gonna have a bad time. SDL 3.2.0 or later, periodt.
and that's the whole page!! mwah π
Simple Directmedia Layer came through with this one, and this doc is living in SDL 3.4.18 land β shoutout to the SDL crew, love that for them. π«Άπβ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms