API reference / Windows and drawing
SDL_SetRenderDrawBlendMode
Function, SDL3
Sets how the next drawing calls mix with the pixels that are already there.
Declaration
#include <SDL3/SDL.h>
bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode);Parameters
renderer | The renderer. |
blendMode | The mode, for example SDL_BLENDMODE_NONE, SDL_BLENDMODE_BLEND, or SDL_BLENDMODE_ADD. |
Return value
True on success. On failure it returns false.
Example
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD);See this code run in Particle toy. Download the full program (.zip)
Notes
SDL_BLENDMODE_BLENDuses alpha for transparency.SDL_BLENDMODE_ADDadds the colors, which makes a glow.
In SDL2
The name is the same.