SDL_ISPIXELFORMAT_PACKED(3)

πŸ’– SDL_ISPIXELFORMAT_PACKED πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we vibe-check pixel formats ✨

✨ NAME ✨

SDL_ISPIXELFORMAT_PACKED β€” a macro that tells you whether an SDL_PixelFormat is a packed format πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_pixels.h>

#define SDL_ISPIXELFORMAT_PACKED(format) \
    (!SDL_ISPIXELFORMAT_FOURCC(format) && \
     ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
      (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
      (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: this macro double-evaluates its parameter 😭 like it literally looks at your argument more than once. So do NOT hand it an expression with side-effects. Just don't. It's giving chaos and we are not here for that. πŸ’…

πŸ“ MACRO PARAMETERS πŸ“

  • format β€” an SDL_PixelFormat you want to check, boo 🫢

⭐ RETURN VALUE ⭐

Returns true if the format is packed, false otherwise. Simple. Iconic. No notes. πŸ‘‘

🌈 THREAD SAFETY 🌈

It is safe to call this macro from any thread. main character energy across every core, periodt πŸ’œ

πŸ’« AVAILABILITY πŸ’«

This macro is available since SDL 3.2.0 β€” she's been here, she's been serving ✨


and that's the whole page, bestie!! this one came to you from Simple Directmedia Layer, living in SDL 3.4.18 era, filed under SDL_ISPIXELFORMAT_PACKED(3) πŸ’– go forth and check your pixel formats, ily, bye πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from