SDL_BlendRect

Use this function to blend an RGBA value into the outline of the given rectangle.

Syntax

int SDL_BlendRect(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 that is the drawing target

rect

the SDL_Rect structure representing the rectangle to be outlined, or NULL to outline the entire surface

blendMode

an SDL_BlendMode value defining how to blend the color; 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

blendMode may be one of the following:

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


CategoryAPI, CategorySurface

SDL_BlendRect (last edited 2011-01-07 05:27:39 by SheenaSmith)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit