Wiki Page Content

Revision 7 as of 2010-12-21 02:06:00

Clear message

DRAFT

SDL_FillRect

Use this function to perform a fast fill of the given a rectangle with a specific color.

Syntax

int SDL_FillRect(SDL_Surface*    dst,
                 const SDL_Rect* rect,
                 Uint32          color)

green

Function Parameters

dst

the destination SDL_Surface structure

rect

the SDL_Rect structure to fill, or NULL to fill the entire render target; see Remarks for details

color

the color to fill the rectangle with; see Remarks for details

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 filled with color. green

The color should be a pixel of the format used by the surface, and can be generated by the SDL_MapRGB() *or SDL_MapRGBA()*functions. *If the color value contains an alpha value then the destination is simply "filled" with that alpha information, no blending takes place.

If there is a clip rectangle set on the destination (set via SDL_SetClipRect()), then this function will clip based on the intersection of the clip rectangle and the dstrect rectangle, and the dstrect rectangle will be modified to represent the area actually filled.

green

If you call this on the video surface (ie: the value of SDL_GetVideoSurface()) you may have to update the video surface to see the result. This can happen if you are using a shadowed surface that is not double buffered in Windows XP using build 1.2.9.
*


CategoryAPI, CategorySurface

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