SDL_DestroyPalette(3)

πŸ’– SDL_DestroyPalette(3) β€” SDL3 FUNCTIONS πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today we are saying goodbye to a palette 🎨✨


🌸 NAME 🌸

SDL_DestroyPalette β€” frees a palette that you made with SDL_CreatePalette(). that's it. that's the whole job. it's giving closure 🫢


✨ SYNOPSIS ✨

#include <SDL3/SDL_pixels.h>

void SDL_DestroyPalette(SDL_Palette *palette);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • palette β€” the SDL_Palette structure that needs to be freed. yes queen, hand her over, she's done her time πŸ’…

πŸ¦‹ THREAD SAFETY πŸ¦‹

good news!! it is safe to call this function from any thread πŸŽ‰ β€” as long as the palette isn't being modified or destroyed in another thread. so like, one thread at a time on this girl, we're not doing chaos here bestie 😭 no double-destroying, that's not the vibe.


🌈 AVAILABILITY 🌈

this one's been around since SDL 3.2.0 β€” so if your SDL is older than that, she simply does not exist, no cap 🫠


πŸ‘‘ SEE ALSO πŸ‘‘


fr fr the only rule: every palette you SDL_CreatePalette() deserves her SDL_DestroyPalette() moment. balance. main character energy for the allocator. periodt πŸ“

and that's the page!! brought to you by Simple Directmedia Layer, running the iconic SDL 3.4.18 β€” thanks for reading my little manual rant, mwah πŸ’–πŸ§šβ­

πŸ“¦ where this page comes from