SDL_GetTexturePalette(3)
π SDL_GetTexturePalette π
okay so bestie, welcome to the SDL_GetTexturePalette(3) page, part of the SDL3 functions crew β¨ this one's short and sweet and honestly kinda iconic β it's literally just "hey texture, what palette are you wearing today?" π
πΈ NAME πΈ
SDL_GetTexturePalette β get the palette used by a texture. that's it. that's the whole job. slay π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_render.h>
SDL_Palette * SDL_GetTexturePalette(SDL_Texture *texture);
look at that signature. clean. minimal. main character energy fr fr π
π«Ά FUNCTION PARAMETERS π«Ά
textureβ the texture you wanna query, bestie. the one you're asking about. the little guy you're side-eyeing like "so... what's ur palette?" π
π RETURN VALUE π
It returns a pointer to the palette that the texture is using β like, SDL_Palette *, the whole thing β or NULL if there is no palette used. that's the vibe check. if it comes back NULL, no palette, no problem, don't spiral π
π¦ THREAD SAFETY π¦
β οΈ okay so listen. This function should only be called on the main thread. not the side threads. not the little background gremlins. main thread only, periodt. π«π§΅
β AVAILABILITY β
This function is available since SDL 3.4.0. so if you're on something older, sorry babe, it's giving "not yet" π
π SEE ALSO π
SDL_SetTexturePalette(3)β the other half of the duo, the one that sets the palette instead of just asking about it. they're a matching set, iykyk π
and that's the whole page!! short, sweet, extremely functional, no notes π
okay bye bestie, this was Simple Directmedia Layer presenting SDL 3.4.18 β mwah, go query some palettes responsibly πβ¨π¦πΈπ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms