SDL_SetRenderDrawBlendMode(3)

πŸ’– SDL_SetRenderDrawBlendMode(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_SetRenderDrawBlendMode β€” the girl who decides how your shapes and lines get blended together. she's giving render pipeline royalty, no cap. πŸ‘‘


✨ NAME ✨

SDL_SetRenderDrawBlendMode β€” set the blend mode used for drawing operations. that's it, that's the whole job, and she does it flawlessly. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_render.h>

bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode);

look at her. two params, one bool. clean, minimal, iconic. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: this blend mode is the one that gets used for any drawing that doesn't involve textures. like, if you're out here drawing plain rectangles and lines and stuff β€” no texture in sight β€” this is the blend mode in charge. she's the queen of the textureless era. πŸ‘‘

and here's the part you gotta know: if the blend mode you ask for is not supported, SDL doesn't just crash out or ignore you β€” it picks the closest supported mode instead. so you might not get exactly what you asked for, and that's just how it is. close enough is close enough. πŸ™ˆ


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • renderer β€” the rendering context. your whole render situation. hand her over. 🫢
  • blendMode β€” the SDL_BlendMode you want to use for blending. this is your vibe request. ✨

⭐ RETURN VALUE ⭐

returns true on success or false on failure. and if it's a false? do not panic, just call SDL_GetError() for more information β€” she will tell you exactly what went wrong. 😭


πŸ’€ THREAD SAFETY πŸ’€

this function should only be called on the main thread. periodt. don't try to be sneaky from some background thread, she will not tolerate it. main character energy only, and the main thread is the main character. πŸ‘‘

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, bestie... no she is not there. upgrade. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie, you ate it. this came to you straight from Simple Directmedia Layer, version SDL 3.4.18, and it's the SDL_SetRenderDrawBlendMode(3) page β€” go forth and blend responsibly. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from