Wiki Page Content

Differences between revisions 7 and 8
Revision 7 as of 2010-12-21 02:06:00
Size: 2416
Editor: SheenaSmith
Comment: update formatting - enums, structs, the/an
Revision 8 as of 2011-01-06 18:40:10
Size: 1412
Editor: SheenaSmith
Comment: update content - w/ Sam; remove draft
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
||<tablewidth="100%" style="color: #FF0000;" :> DRAFT||
Line 6: Line 5:
Use this function to perform a fast fill of ,,the given,, ^a^ rectangle with ^a specific^ color. Use this function to perform a fast fill of a rectangle with a specific color.
Line 17: Line 16:
<<Color2(green,Why is this a ''const'' SDL_Rect? Doesn't it have to be written to with the new fill? Or does a new filled Rect end up on the surface w/o changing the old one?)>>
Line 20: Line 17:
||'''dst'''||the destination [[SDL_Surface]] structure||
||'''rect'''||the [[SDL_Rect]] structure to fill^, or NULL to fill the entire render target^; see [[#Remarks|Remarks]] for details||
||'''color'''||the color to fill the rectangle with; see [[#Remarks|Remarks]] for details||
||'''dst'''||the [[SDL_Surface]] structure that is the drawing target||
||'''rect'''||the [[SDL_Rect]] structure representing the rectangle to fill, or NULL to fill the entire surface||
||'''color'''||the color to fill with
; see [[#Remarks|Remarks]] for details||
Line 33: Line 30:
If '''rect''' is NULL, the whole surface will be filled with color. <<Color2(green,Move this up into the param as above?)>> '''color''' should be a pixel of the format used by the surface, and can be generated by [[SDL_MapRGB]]() or [[SDL_MapRGBA]](). If the color value contains an alpha component then the destination is simply filled with that alpha information, no blending takes place.
Line 35: Line 32:
,,The,, '''color''' should be a pixel of the format used by the surface, and can be generated by the [[SDL_MapRGB]]() *or [[SDL_MapRGBA]]()*function^s^. *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 '''rect'''.
Line 37: Line 34:
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 ''',,dst,,rect''' rectangle, and the ''',,dst,,rect''' rectangle will be modified to represent the area actually filled.

<<Color2(green,I suspect that this section is now defunct. The referenced function has no page in 1.3.)>>

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. <<BR>>*
Line 44: Line 36:
 .[[SDL_BlitSurface]] *
Line 46: Line 37:
 .[[SDL_MapRGB]] *
 .[[SDL_MapRGBA]] *
 .[[SDL_SetClipRect]] ?*

SDL_FillRect

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

Syntax

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

Function Parameters

dst

the SDL_Surface structure that is the drawing target

rect

the SDL_Rect structure representing the rectangle to fill, or NULL to fill the entire surface

color

the color to fill 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

color should be a pixel of the format used by the surface, and can be generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an alpha component 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 rect.


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