SDL_SetSurfaceBlendMode(3)
π SDL_SetSurfaceBlendMode π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_SetSurfaceBlendMode(3) β the lil function that decides how your surface blends when it gets blitted. slay.
β¨ NAME β¨
SDL_SetSurfaceBlendMode β set the blend mode used for blit operations. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_surface.h>
bool SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
π¦ DESCRIPTION π¦
so here's the tea: if you wanna copy a surface onto another surface (or a texture) and you want it to just replace the existing data β no blending, no mixing, no cute little alpha math β then the blend mode of the SOURCE surface should be set to SDL_BLENDMODE_NONE. periodt. that's the move π
π FUNCTION PARAMETERS π
surfaceβ theSDL_Surfacestructure you're updating. yes, that one. your fave.blendModeβ theSDL_BlendModeto use for blit blending. this is the vibe you're choosing β¨
π RETURN VALUE π
returns true on success or false on failure. and if it fails? call SDL_GetError() for more info, because it will tell you what went wrong, fr fr π
π§ THREAD SAFETY π§
this function can be called on different threads with different surfaces. so like, multitask girlie, but keep your surfaces separate, mkay? π«Ά
π AVAILABILITY π
this function is available since SDL 3.2.0. vintage but make it iconic β
π₯ SEE ALSO π₯
SDL_GetSurfaceBlendMode(3)β the other half of the duo, go read her too π
lowkey obsessed with how simple this one is. no cap, just set the blend mode and let it slay.
okay bye bestie, this page came to you from Simple Directmedia Layer π and it's living in SDL 3.4.18 β mwah, take care, drink water, and remember: SDL_BLENDMODE_NONE on the source surface is how you copy without the blending drama πΈπ
β¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms