SDL_ISPIXELFORMAT_FOURCC(3)
π SDL_ISPIXELFORMAT_FOURCC π
okay bestie, we're in the SDL3 FUNCTIONS section of the manual and this one is a macro, not a function, so buckle up π
β¨ NAME β¨
SDL_ISPIXELFORMAT_FOURCC β a macro that tells you whether an SDL_PixelFormat is a "FourCC" format. yes, that's the whole job. she's a specialist π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_pixels.h>
#define SDL_ISPIXELFORMAT_FOURCC(format) /* The flag is set to 1 because 0x1? is not in the printable ASCII range */ \
((format) && (SDL_PIXELFLAG(format) != 1))
ngl the comment in there is the actual reason the check looks like that: the flag is set to1because0x1?is not in the printable ASCII range. iconic little design note fr fr π«Ά
π¦ DESCRIPTION π¦
So what does this actually cover? custom and other unusual formats β the weird ones, the special ones, the ones that didn't fit the normal mould. main character formats only π
lowkey important warning: this macro double-evaluates its parameter. so do NOT pass it expressions with side-effects. like, if your argument does a thing when it gets evaluated, it's gonna do that thing twice. no cap, just don't. π
π MACRO PARAMETERS π
formatβ anSDL_PixelFormatto check. that's it, that's the one parameter π
β RETURN VALUE β
Returns true if the format has alpha, false otherwise.
π§ THREAD SAFETY π§
It is safe to call this macro from any thread. multi-threaded girlies, you're covered π
π AVAILABILITY π
This macro has been available since SDL 3.2.0. so if you're on anything older... bestie, upgrade β¨
mwah π that's the whole page. go check your pixel formats, you got this.
this has been your girl from the Simple Directmedia Layer, writing to you from SDL 3.4.18 β same energy, same facts, forever and always. periodt. π π
π¦ 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