SDL_PIXELFLAG(3)
SDL_PIXELFLAG π β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we vibe with pixels π
β¨ NAME β¨
SDL_PIXELFLAG β it's a macro, and its whole entire job is to go get the flags out of an SDL_PixelFormat. that's it. that's the girl. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_pixels.h>
#define SDL_PIXELFLAG(format) (((format) >> 28) & 0x0F)
look at her. shifting right by 28 and masking with 0x0F. she's doing bit math and she's doing it flawlessly. π
π¦ DESCRIPTION π¦
so here's the tea β β this macro is generally not needed directly by an app. like, it exists, it's cute, it works, but most of the time you should be reaching for specific tests instead, like SDL_ISPIXELFORMAT_FOURCC. that's the one you actually want in your group chat. π«Ά
ngl this is giving "you can use me but you should use the other one" energy, and honestly? respect. π
π§ MACRO PARAMETERS π§
formatβ anSDL_PixelFormatto check. hand her over and let the macro do its little investigation. π
π RETURN VALUE π
Returns the flags of format. periodt. π
β¨
π THREAD SAFETY π
It is safe to call this macro from any thread. go wild, queen, thread it up, no locks required, she's built different. π
β AVAILABILITY β
This macro is available since SDL 3.2.0. so if you're on something olderβ¦ bestie, upgrade. π
π¨ real talk: nothing here is deprecated or dangerous, but remember the DESCRIPTION β for actual app code, use specific tests like SDL_ISPIXELFORMAT_FOURCC rather than this macro directly. iykyk. π
Simple Directmedia Layer π¦ SDL 3.4.18 β mwah, that's the source and the version, love u, bye bestie! ππβ¨
π¦ 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