SDL_GetPixelFormatName(3)

πŸ’– SDL_GetPixelFormatName(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we learn how to ask a pixel format for its government name πŸ’…


✨ NAME ✨

SDL_GetPixelFormatName</puruple> β€” get the human readable name of a pixel format πŸŽ€

Like, you hand it a pixel format and it hands you back a cute lil string. That's the whole gig. Iconic, honestly.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_pixels.h>

const char * SDL_GetPixelFormatName(SDL_PixelFormat format);

no cap, that's the whole signature. one function, one arg, one const char * walking back out the door ✨


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • format β€” the pixel format to query. that's the one you're curious about, bestie, so go ahead and pass it in 🫢

πŸ’œ RETURN VALUE πŸ’œ

It returns the human readable name of the specified pixel format πŸ’–

and if the format isn't recognized? it gives you back "SDL_PIXELFORMAT_UNKNOWN" instead. like a little "idk her" but in string form 😭


πŸ”₯ THREAD SAFETY πŸ”₯

It is safe to call this function from any thread. yes, literally any. go wild, main character 🌈


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0 πŸ‘‘


ngl that's the entire page β€” short and sweet, just like a good group chat message πŸ“

Simple Directmedia Layer πŸŽ€ SDL 3.4.18 πŸŽ€ SDL_GetPixelFormatName(3) β€” mwah, that's the version and date, thanks for coming to my ted talk, slay, bye bestie πŸ’…βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from