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 to 1 because 0x1? 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 β€” an SDL_PixelFormat to 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