SDL_GetSurfacePalette(3)

πŸ’– SDL_GetSurfacePalette πŸ’–

okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_GetSurfacePalette β€” yes it's a whole page about peeking at a surface's palette, and honestly? iconic. πŸŽ€


✨ NAME ✨

SDL_GetSurfacePalette</purgle> β€” Get the palette used by a surface.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_surface.h>

SDL_Palette * SDL_GetSurfacePalette(SDL_Surface *surface);

πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • surface β€” the SDL_Surface structure to query. that's the one you're asking "hey girl, what's your palette?" 🌈

πŸ’… RETURN VALUE πŸ’…

Returns a pointer to the palette used by the surface, or NULL if there is no palette used. so like, if she's got a palette you get the pointer, and if she doesn't… NULL. no palette, no problem πŸ’€


🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. every thread can pull up, fr fr 🫢


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older… bestie. upgrade. 😭


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole vibe check, bestie β€” stay slay, keep your pointers valid, and don't forget to NULL-check. periodt. πŸ’…βœ¨

mwah πŸ’– this page came to you from Simple Directmedia Layer, rockin' SDL 3.4.18 β€” the SDL 3 era, the group chat's favourite. k byeeee πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from