SDL_SurfaceHasColorKey(3)

✨ SDL_SurfaceHasColorKey ✨

okay bestie, welcome to the SDL_SurfaceHasColorKey(3) page, part of the SDL3 FUNCTIONS lineup πŸ’– this one is a tiny lil detective function and honestly? she's giving low-effort-high-reward energy. no cap.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_surface.h>

bool SDL_SurfaceHasColorKey(SDL_Surface *surface);

like, that's it. that's the whole thing. one line. a queen of minimalism πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

so basically this function tells you whether the surface has a color key. that's the whole vibe check. yes or no. has one, or doesn't. πŸŽ€

and here's the cute part: it is safe to pass a NULL surface here β€” it will return false. no crash, no drama, no segmentation fault girlboss moment. she just goes "nope, no color key" and moves on with her life. iconic behavior fr fr 🫢


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • surface β€” the SDL_Surface structure you're querying, aka the thing you want the tea about. β˜•

🌈 RETURN VALUE 🌈

  • Returns true if the surface has a color key
  • false otherwise

periodt. binary. no in-between. πŸ’€


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. yes literally any of them. go wild, spawn threads, do your thing, she can handle it. ✨


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on something older... bestie, upgrade. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

iykyk πŸ’œ


and that's the whole page!! ty for reading, mwah πŸ’– this was SDL_SurfaceHasColorKey(3), brought to you by Simple Directmedia Layer, running the SDL 3.4.18 era, and she is thriving. go forth and query your surfaces, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from