SDL_AUDIO_MASK_FLOAT(3)

πŸ’– SDL_AUDIO_MASK_FLOAT πŸ’–

okay bestie, so this is a page from the SDL3 FUNCTIONS manual and it's literally about one tiny macro. one. macro. and she's important, so let's give her the attention she deserves πŸŽ€


✨ NAME ✨

SDL_AUDIO_MASK_FLOAT β€” the mask of bits in an SDL_AudioFormat that hold the floating point flag. that's it, that's the whole job πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_audio.h>

#define SDL_AUDIO_MASK_FLOAT         (1u<<8)

yes queen, it's a #define, and the value is exactly (1u<<8). do not touch it. do not round it. do not get creative πŸ™ˆ


✨ DESCRIPTION ✨

so like, generally? you should be using SDL_AUDIO_ISFLOAT instead of this macro directly. fr fr. this one is the lowkey behind-the-scenes bitsy β€” she's the mask that carves out the floating point flag inside an SDL_AudioFormat, but she is not the one you're supposed to chat with at the function party. that's SDL_AUDIO_ISFLOAT's whole thing 🌸

think of SDL_AUDIO_MASK_FLOAT as the girl who holds the sign and SDL_AUDIO_ISFLOAT as the girl who reads it and tells you the answer. main character vs. supporting cast, iykyk πŸ’œ

lowkey a warning but in the gentlest way possible: the docs say "generally one should use SDL_AUDIO_ISFLOAT instead of this macro directly." so like. use the other one. she's right there. 🫢

✨ AVAILABILITY ✨

this macro has been slaying since SDL 3.2.0 ✨ so if you're on anything older, no she isn't. sorry bestie 😭


and that's the whole page!! obsessed with how short and iconic this one is. no cap, she ate and left zero crumbs πŸ¦‹

Simple Directmedia Layer β€” version SDL 3.4.18 β€” that's the source and the version, straight from the footer, mwah πŸ’‹ periodt πŸ‘‘

πŸ“¦ where this page comes from