Wiki Page Content

Differences between revisions 4 and 5
Revision 4 as of 2010-09-03 17:13:04
Size: 2088
Editor: SheenaSmith
Comment: update content - standard return value
Revision 5 as of 2010-09-22 23:55:58
Size: 2130
Editor: SheenaSmith
Comment: update content - rectangle
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
||'''dst'''||a pointer to the destination surface / [[SDL_Surface]] containing the rectangle||
||'''rect'''||a pointer to the rectangle / [[SDL_Rect]] to fill||
||'''dst'''||a pointer to the surface of type [[SDL_Surface]] containing the rectangle||
||'''rect'''||a pointer to the rectangle of type [[SDL_Rect]] to fill'', or NULL for the entire render target''||

DRAFT

SDL_FillRect

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

Syntax

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

Function Parameters

dst

a pointer to the surface of type SDL_Surface containing the rectangle

rect

a pointer to the rectangle of type SDL_Rect to fill, or NULL for the entire render target

color

the color to fill the rectangle with

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.

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

None: SDL_FillRect (last edited 2014-07-04 11:27:03 by PhilippWiesemann)

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