Name
Line -- draw a line (V6.0)
Synopsis
void Line(APTR handle, int x1, int y1, int x2, int y2, ULONG color,
         ULONG flags, struct hwTagList *tags);
Function
This function must draw a line between the two points passed to this function. 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:

HWLIFLAGS_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, HWLIFLAGS_DESTVIDEOBITMAP will never be set.

HWLIFLAGS_DESTALPHAONLY:
This is only set in connection with HWLIFLAGS_DESTVIDEOBITMAP. If Hollywood wants you to draw to the alpha channel of your video bitmap allocated by AllocVideoBitMap(), it will indicate this by setting HWLIFLAGS_DESTALPHAONLY. If HWLIFLAGS_DESTVIDEOBITMAP is set and HWLIFLAGS_DESTALPHAONLY isn't, you have to draw to the color channels of the video bitmap instead. Note that HWLIFLAGS_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.

HWLIFLAGS_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 HWLIFLAGS_DESTBITMAP will only ever be set if you've passed HWBMAHOOK_WRITEPIXEL in HWSDAFLAGS_BITMAPHOOK. Otherwise, Hollywood will do the rendering to the software bitmap on its own and you don't have to care. HWLIFLAGS_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 HWLIFLAGS_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 Line().

If your display adapter doesn't support video bitmaps or hooks into Hollywood's bitmap handler, Line() 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_RawLine() function in your implementation to draw lines to bitmaps stored as raw pixel buffers. See hw_RawLine for details.

Inputs
handle
destination display or bitmap (depends on the flags that are set, see above)
x1
start x offset for the line
y1
start y offset for the line
x2
end x offset for the line
y2
end y offset for the line
color
desired line color
flags
flags specifying further parameters
tags
additional options (currently always NULL)

Show TOC