SDL_GetTextureColorMod(3)

πŸ’– SDL_GetTextureColorMod(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_GetTextureColorMod β€” yes that's the whole name, we're not abbreviating, she earned it πŸ‘‘


✨ NAME ✨

SDL_GetTextureColorMod β€” get the additional color value multiplied into render copy operations.

like, the little color tint that gets multiplied into every render copy. that's the one. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_render.h>

bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b);

copy that include exactly, no cap. πŸ“‹


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • texture β€” the texture we're querying. the one we're interrogating. the subject of the vibe check πŸ’…
  • r β€” a pointer that gets filled in with the current red color value.
  • g β€” a pointer that gets filled in with the current green color value.
  • b β€” a pointer that gets filled in with the current blue color value.

three pointers, three colors, three little values handed back to you. it's giving RGB bestie era 🌈


⭐ RETURN VALUE ⭐

Returns true on success or false on failure. and if it fails? call SDL_GetError() for more information, she will tell you everything πŸ—£οΈ

fr fr, always check the return value. false is not a vibe, it's a warning.

πŸ’€ THREAD SAFETY πŸ’€

This function should only be called on the main thread.

main thread only!! do NOT go spawning threads and calling this from them, that's not the moment, that's not the energy πŸ™ˆ

πŸŽ€ AVAILABILITY πŸŽ€

This function is available since SDL 3.2.0. so if you're on something older, no she's not there yet, sorry bestie 😭


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're all part of the same friend group 🫢


and that's the whole page!! tysm for reading, ily, go tint something pretty βœ¨πŸ’œ

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_GetTextureColorMod(3) πŸ¦‹ that's the source, the version and the date all wrapped up in a little bow, mwah πŸ’…

πŸ“¦ where this page comes from