void WritePixel(APTR handle, int x, int y, ULONG color, ULONG flags, struct hwTagList *tags);
flagsparameter to find out how to interpret the handle that Hollywood has passed to your function. The following flags are currently recognized:
HWSDATAG_VIDEOBITMAPCAPSto enable offscreen rendering to video bitmaps. Otherwise,
HWWPFLAGS_DESTVIDEOBITMAPwill never be set.
HWWPFLAGS_DESTVIDEOBITMAP. If Hollywood wants you to draw to the alpha channel of your video bitmap allocated by AllocVideoBitMap(), it will indicate this by setting
HWWPFLAGS_DESTVIDEOBITMAPis set and
HWWPFLAGS_DESTALPHAONLYisn't, you have to draw to the color channels of the video bitmap instead. Note that
HWWPFLAGS_DESTALPHAONLYwill only ever be set if you've set the
HWVBMCAPS_OFFSCREENALPHAcapability flag in
HWSDATAG_VIDEOBITMAPCAPSto enable offscreen rendering to video bitmap alphachannels. In that case, the
colorparameter will contain just an 8-bit alpha transparency value ranging from 0 to 255.
HWSDAFLAGS_BITMAPADAPTERin your call to hw_SetDisplayAdapter(). Note that
HWWPFLAGS_DESTBITMAPwill only ever be set if you've passed
HWSDAFLAGS_BITMAPHOOK. Otherwise, Hollywood will do the rendering to the software bitmap on its own and you don't have to care.
HWWPFLAGS_DESTBITMAPwill 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 4 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
HWWPFLAGS_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
If your display adapter doesn't support video bitmaps or hooks into Hollywood's bitmap
WritePixel() 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_RawWritePixel() function in your implementation to plot pixels to bitmaps stored as raw pixel buffers. See hw_RawWritePixel for details.