SDL_GetRenderDrawColor(3)

πŸ’– SDL_GetRenderDrawColor(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the SDL_GetRenderDrawColor(3) manual page β€” yes that's the manual name, it's giving very demure, very mindful, and it's all about peeking at the color your renderer is using for drawing stuff ✨


🌸 NAME 🌸

SDL_GetRenderDrawColor β€” get the color used for drawing operations (Rect, Line and Clear) 🎨

like. THE color. the one doing all the heavy lifting for your rects, your lines, and your clears. main character behavior fr.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_render.h>

bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • renderer β€” the rendering context. your whole vibe. the canvas holder, the moment.
  • r β€” a pointer that gets filled in with the red value used to draw on the rendering target.
  • g β€” a pointer that gets filled in with the green value used to draw on the rendering target.
  • b β€” a pointer that gets filled in with the blue value used to draw on the rendering target.
  • a β€” a pointer that gets filled in with the alpha value used to draw on the rendering target; usually SDL_ALPHA_OPAQUE (255). so like, fully solid, no see-through nonsense, periodt πŸ’…
not me handing it four pointers and getting four values back. it's giving "fill in the blanks" but make it colorful 🫢

✨ RETURN VALUE ✨

Returns true on success or false on failure 😭 β€” and if it fails, bestie, call SDL_GetError() for more information. do NOT just sit there guessing. get the tea.


πŸ‘‘ THREAD SAFETY πŸ‘‘

This function should only be called on the main thread. no cap. don't be out here threading it from a side quest, it will not slay.


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. iconic. historic. a legend was born.


πŸ’œ SEE ALSO πŸ’œ

like, go get it, go set it, and if you want the float version, she's right there too. iykyk πŸ’–


and that's the whole page, bestie!! 🌟 this was brought to you by Simple Directmedia Layer, running SDL 3.4.18 β€” stay colorful, stay on the main thread, and go draw something gorgeous πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from