SDL_PIXELORDER(3)

πŸ’… SDL_PIXELORDER πŸ’…

okay bestie, welcome to SDL_PIXELORDER β€” a whole macro from the SDL3 FUNCTIONS crew whose entire job is telling you what order your pixels are in. yes really. that's the gig. and honestly? she ate. ✨


🌸 NAME 🌸

SDL_PIXELORDER β€” a macro to retrieve the order of an SDL_PixelFormat. that's it, that's the whole thing, and she does it flawlessly no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_pixels.h>

#define SDL_PIXELORDER(format)   (((format) >> 20) & 0x0F)

look at her. one line. shifting and masking like a boss. main character energy fr fr πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, the value you get back is usually one from the SDL_BitmapOrder, SDL_PackedOrder, or SDL_ArrayOrder enumerations β€” which one you're looking at depends on the format type, iykyk. 🧚


✨ MACRO PARAMETERS ✨

  • format β€” an SDL_PixelFormat to check. hand her over and she'll do her lil thing 🫢

πŸ’– RETURN VALUE πŸ’–

returns the order of format. periodt. πŸ’…


🌈 THREAD SAFETY 🌈

it is safe to call this macro from any thread. go wild, bestie, no locking required, we love a low-maintenance icon ⭐


πŸ“ AVAILABILITY πŸ“

this macro has been available since SDL 3.2.0. she's been here, she's been serving, she's not going anywhere πŸŽ€


lowkey reminder: it's a macro, not a function β€” so there's no pointer to take, no address to grab, just vibes and bit-shifting πŸ˜­πŸ’€

and that's the whole page, bestie!! this lil legend lives in Simple Directmedia Layer, version SDL 3.4.18 β€” signed, sealed, and slayed on her official man page date πŸ’œβœ¨ bye pookie, go shift some bits πŸ¦‹

πŸ“¦ where this page comes from