SDL School

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

rendererThe renderer.
blendModeThe mode, for example SDL_BLENDMODE_NONE, SDL_BLENDMODE_BLEND, or SDL_BLENDMODE_ADD.

Return value

True on success. On failure it returns false.

Example

Particle toy
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD);

See this code run in Particle toy. Download the full program (.zip)

Notes

In SDL2

The name is the same.

See also