Name
sdl.SetTextureBlendMode -- set texture blend mode
Synopsis
r = sdl.SetTextureBlendMode(tex, blendmode)
Function
Use this function to set the blend mode for a texture, used by sdl.RenderCopy().

blendmode may be one of the following:

#SDL_BLENDMODE_NONE
no blending

 
dstRGBA = srcRGBA

#SDL_BLENDMODE_BLEND
alpha blending

 
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
dstA = srcA + (dstA * (1-srcA))

#SDL_BLENDMODE_ADD
additive blending

 
dstRGB = (srcRGB * srcA) + dstRGB
dstA = dstA

#SDL_BLENDMODE_MOD
color modulate

 
dstRGB = srcRGB * dstRGB
dstA = dstA

If the blend mode is not supported, the closest supported mode is chosen and this function returns -1. The tex argument must simply be the identifier of a hardware brush.

Inputs
tex
identifier of hardware brush
blendmode
the blend mode to use for texture blending (see above)
Results
r
0 on success or a negative error code on failure

Show TOC