SDL_PIXELTYPE(3)
π SDL_PIXELTYPE π
okay bestie, welcome to SDL_PIXELTYPE β she's a macro from the SDL3 FUNCTIONS fam, and she's here to pull the type out of an SDL_PixelFormat. no cap, that's the whole job. π
β¨ NAME β¨
SDL_PIXELTYPE β a macro to retrieve the type of an SDL_PixelFormat. literally that. one (1) macro, one (1) mission. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_pixels.h>
#define SDL_PIXELTYPE(format) (((format) >> 24) & 0x0F)
look at her. shifting right by 24 and masking with 0x0F. the way that she's doing bit math and looking this cute doing it?? iconic behavior fr fr. π
π¦ DESCRIPTION π¦
so what you get back is usually a value from the SDL_PixelType enumeration. that's the vibe. that's the whole description. iykyk. β¨
π MACRO PARAMETERS π
formatβ anSDL_PixelFormatto check. that's it, that's the one and only thing she wants from you. hand her a format, she hands you back its type. mutual exchange, healthy relationship, we love to see it. π«Ά
π RETURN VALUE π
Returns the type of format. boom. no drama, no surprises, just your answer. periodt. π
π§ THREAD SAFETY π§
good news bestie: it is safe to call this macro from any thread. no locks, no crying, no "wait which thread am i on" panic. go wild. π
β AVAILABILITY β
this macro has been available since SDL 3.2.0. so if you're on anything older... girl. upgrade. π
π reminder: the value it gives you is usually from the SDL_PixelType enumeration β the manpage said usually, so we're keeping that energy, okay? no adding extra lore that isn't there.
made with love by Simple Directmedia Layer, SDL 3.4.18, dated SDL_PIXELTYPE(3) β k bye, go shift some bits, you're gonna slay πβ¨π¦
π¦ 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