DRAFT |
SDL_BlendFillRect
Use this function to blend an RGBA value into the given rectangle.
Syntax
int SDL_BlendFillRect(SDL_Surface* dst,
const SDL_Rect* rect,
SDL_BlendMode blendMode,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a)
Function Parameters
dst |
the SDL_Surface structure containing the rectangle |
rect |
the SDL_Rect structure to be filled, or NULL for the entire render target |
blendMode |
an SDL_BlendMode structure to apply use for texture blending; see Remarks for details |
r |
the red value used to blend with the target |
g |
the green value used to blend with the target |
b |
the blue value used to blend with the target |
a |
the alpha value used to blend with the target |
Return Value
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
If rect is NULL, the whole surface will be blended with the color. I think this can be removed and included in params above instead.
blendMode can be one of these values:
SDL_BLENDMODE_NONE |
no blending |
SDL_BLENDMODE_MASK |
dst = A ? src : dst (alpha is mask) |
SDL_BLENDMODE_BLEND |
dst = (src * A) + (dst * (1-A)) |
SDL_BLENDMODE_ADD |
dst = (src * A) + dst |
SDL_BLENDMODE_MOD |
dst = src * dst |
If the blend mode is not supported, the closest supported mode is chosen.
This section and parameter description were taken from SDL_SetTextureBlendMode. Is it applicable?