SDL_GetRenderDrawColorFloat(3)

πŸ’– SDL_GetRenderDrawColorFloat(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_GetRenderDrawColorFloat β€” she's the one who tells you what color you've been drawing with. 🎨✨


🌸 NAME 🌸

SDL_GetRenderDrawColorFloat β€” get the color used for drawing operations (Rect, Line and Clear). yes gurl, all three of them πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_render.h>

bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a);

like, you hand her a renderer and four little float pointers and she fills them in. float energy only, no cap 🫢


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • renderer β€” the rendering context. the whole vibe, the canvas, the moment. πŸ–ΌοΈ
  • r β€” a pointer filled in with the red value used to draw on the rendering target. red alert but make it cute πŸ“
  • g β€” a pointer filled in with the green value used to draw on the rendering target. green flag behavior fr 🌿
  • b β€” a pointer filled in with the blue value used to draw on the rendering target. blue era πŸ¦‹
  • a β€” a pointer filled in with the alpha value used to draw on the rendering target. the transparency queen, she's giving invisibility realness πŸ‘‘
not me pointing out that all four of these are pointers that get filled in by the function β€” so yes, you gotta pass real memory, not vibes. 🫠

🌈 RETURN VALUE 🌈

Returns true on success or false on failure; call SDL_GetError() for more information. if she says false, go ask SDL_GetError() what went wrong, she always spills the tea β˜•πŸ˜­


🧚 THREAD SAFETY 🧚

This function should only be called on the main thread. periodt. no side-quest threads, no sneaky background gossip, main thread only bestie πŸ’œ


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older… girl, update. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page!! Simple Directmedia Layer, SDL 3.4.18 β€” mwah, tysm for reading, go draw something gorgeous with your floats πŸŒΈπŸ’…βœ¨

πŸ“¦ where this page comes from