void WritePixel(APTR handle, int x, int y, ULONG color, ULONG flags, struct hwTagList *tags);
flags
parameter to find out how to interpret the handle that
Hollywood has passed to your function. The following flags are currently recognized:
HWWPFLAGS_DESTVIDEOBITMAP:
HWVBMCAPS_OFFSCREENCOLOR
or
HWVBMCAPS_OFFSCREENALPHA
capabilities in HWSDATAG_VIDEOBITMAPCAPS
to enable
offscreen rendering to video bitmaps. Otherwise, HWWPFLAGS_DESTVIDEOBITMAP
will
never be set.
HWWPFLAGS_DESTALPHAONLY:
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_DESTALPHAONLY
. If HWWPFLAGS_DESTVIDEOBITMAP
is set and HWWPFLAGS_DESTALPHAONLY
isn't, you have to draw to the color channels of the video bitmap instead. Note that
HWWPFLAGS_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.
HWWPFLAGS_DESTBITMAP:
HWSDAFLAGS_BITMAPADAPTER
in your call to hw_SetDisplayAdapter(). Note that
HWWPFLAGS_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. HWWPFLAGS_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 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
WritePixel()
.
If your display adapter doesn't support video bitmaps or hooks into Hollywood's bitmap
handler, 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.
NULL
)