SDL_SetTextureBlendMode(3)

πŸ’– SDL_SetTextureBlendMode(3) πŸ’–

okay so bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today we're talking about SDL_SetTextureBlendMode β€” the glow-up button for your textures ✨


🌸 NAME 🌸

SDL_SetTextureBlendMode β€” set the blend mode for a texture, used by SDL_RenderTexture(). yes queen, this is the one that decides how your texture mixes with whatever's underneath it πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_render.h>

bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode);

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, this blend mode is what gets used for any drawing that involves this texture. every single time you draw with it, this is the vibe it's giving. 🌈

And here's the tea, no cap: if the blend mode you asked for isn't supported, SDL doesn't just crash out β€” it picks the closest supported mode instead and this function returns false. so you lowkey got what you wanted, but not exactly what you wanted. 😭


🫢 FUNCTION PARAMETERS 🫢

  • texture β€” the texture to update. the one getting the makeover πŸ’…
  • blendMode β€” the SDL_BlendMode to use for texture blending. pick your fighter ✨

⭐ RETURN VALUE ⭐

Returns true on success or false on failure β€” and when it's a flop, call SDL_GetError() for more information, because she will tell you what went wrong πŸ“’


πŸ”₯ THREAD SAFETY πŸ”₯

This function should only be called on the main thread. main character energy only, bestie β€” no side quests, no other threads, periodt. πŸ‘‘


πŸ’œ AVAILABILITY πŸ’œ

This function is available since SDL 3.2.0. iconic behavior honestly πŸŽ€


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, iykyk πŸ¦‹


mwah πŸ’‹ this little love letter to the docs came to you from Simple Directmedia Layer, rockin' version SDL 3.4.18, and it's filed under SDL_SetTextureBlendMode(3) β€” stay blended, stay slay πŸ’–βœ¨

πŸ“¦ where this page comes from