Name
RectFill -- fill rectangular pixel area with color (V6.0)
Synopsis
void RectFill(APTR handle, int x, int y, int width, int height,
         ULONG color, ULONG flags, struct hwTagList *tags);
Function
This function must fill the specified rectangular area with the color passed in parameter 6. The destination handle can be either a display or a bitmap. You have to look at flags parameter to find out how to interpret the handle that Hollywood has passed to your function. The following flags are currently recognized:

HWRFFLAGS_DESTVIDEOBITMAP:
The handle passed is a video bitmap allocated by AllocVideoBitMap(). This can only happen if you've set the HWVBMCAPS_OFFSCREENCOLOR or HWVBMCAPS_OFFSCREENALPHA capabilities in HWSDATAG_VIDEOBITMAPCAPS to enable offscreen rendering to video bitmaps. Otherwise, HWRFFLAGS_DESTVIDEOBITMAP will never be set.

HWRFFLAGS_DESTALPHAONLY:
This is only set in connection with HWRFFLAGS_DESTVIDEOBITMAP. If Hollywood wants you to draw to the alpha channel of your video bitmap allocated by AllocVideoBitMap(), it will indicate this by setting HWRFFLAGS_DESTALPHAONLY. If HWRFFLAGS_DESTVIDEOBITMAP is set and HWRFFLAGS_DESTALPHAONLY isn't, you have to draw to the color channels of the video bitmap instead. Note that HWRFFLAGS_DESTALPHAONLY will only ever be set if you've set the HWVBMCAPS_OFFSCREENALPHA capability flag in HWSDATAG_VIDEOBITMAPCAPS to enable offscreen rendering to video bitmap alphachannels. In that case, the color parameter will contain just an 8-bit alpha transparency value ranging from 0 to 255.

HWRFFLAGS_DESTBITMAP:
The handle passed is a software bitmap allocated by Hollywood or your plugin's AllocBitMap() function if you've set the HWSDAFLAGS_BITMAPADAPTER in your call to hw_SetDisplayAdapter(). Note that HWRFFLAGS_DESTBITMAP will only ever be set if you've passed HWBMAHOOK_RECTFILL in HWSDAFLAGS_BITMAPHOOK. Otherwise, Hollywood will do the rendering to the software bitmap on its own and you don't have to care. HWRFFLAGS_DESTBITMAP will only ever be set if you've explicitly requested that you want to do offscreen drawing to software bitmaps on your own by setting the appropriate bitmap hook flags.

If you've set the HWSDAFLAGS_ALPHADRAW flag when calling hw_SetDisplayAdapter() to initialize your plugin, the color value passed in parameter 6 will contain an alpha value in its 8 most significant bits and your implementation is expected to draw to the destination with alpha blending enabled. If you haven't set HWSDAFLAGS_ALPHADRAW, the color will be just a 24-bit RGB value. If the HWRFFLAGS_DESTALPHAONLY flag is set, the color parameter will contain just an 8-bit alpha transparency value ranging from 0 to 255.

This function doesn't have to do any clipping. Hollywood will perform clipping itself before calling RectFill().

If your display adapter doesn't support video bitmaps or hooks into Hollywood's bitmap handler, RectFill() only has to be able to draw to the display which should be quite simple and straight-forward to implement.

If your plugin supports hardware double buffering and Hollywood has put your display into hardware double buffering mode by calling your plugin's BeginDoubleBuffer() function, this function must not draw anything to the display but only to the back buffer. Hollywood will call your plugin's Flip() function when it wants you to draw the back buffer to the display.

You might want to use the hw_RawRectFill() function in your implementation to draw rectangles to bitmaps stored as raw pixel buffers. See hw_RawRectFill for details.

Inputs
handle
destination display or bitmap (depends on the flags that are set, see above)
x
x offset of the rectangle to fill
y
y offset of the rectangle to fill
width
width in pixels of the area to fill
height
height in pixels of the area to fill
color
filling color
flags
flags specifying further parameters
tags
additional options (currently always NULL)

Show TOC