SDL_GetSurfaceColorMod(3)

πŸ’– SDL_GetSurfaceColorMod πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we're talking about SDL_GetSurfaceColorMod β€” the little cutie that tells you what extra color value is getting multiplied into your blit operations. ✨


🌸 NAME 🌸

SDL_GetSurfaceColorMod β€” get the additional color value multiplied into blit operations. that's it, that's the whole vibe check. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_surface.h>

bool SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);

✨ FUNCTION PARAMETERS ✨

so you're passing in four things, and like, each one matters, no cap:

  • surface β€” the SDL_Surface structure you wanna query. it's the main character here, she's the one getting interrogated. πŸ‘‘
  • r β€” a pointer that gets filled in with the current red color value. yes it's a pointer, yes you have to give her somewhere to live.
  • g β€” a pointer that gets filled in with the current green color value. same deal, she needs a home too. 🌿
  • b β€” a pointer that gets filled in with the current blue color value. trio complete, slay. πŸ’™

🫢 RETURN VALUE 🫢

returns true on success or false on failure β€” and if it's giving failure, call SDL_GetError() for more information, because she will tell you what went wrong, bestie. 😭


🧚 THREAD SAFETY 🧚

this function can be called on different threads with different surfaces. so like, parallel besties, different surfaces, everyone minding their own business. periodt. πŸ’…


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. iconic behavior from day one, honestly. ⭐


πŸ’œ SEE ALSO πŸ’œ


ngl if you're reading the whole set of these you're lowkey becoming a surface mod connoisseur and i'm obsessed with that for you. πŸ”₯

and that's the tea, bestie β€” this page came straight out of the Simple Directmedia Layer era, version SDL 3.4.18, with SDL_GetSurfaceColorMod(3) holding it down. go forth and multiply those color values, you got this. πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from