void hw_RawPolyFill(APTR dst, struct hwVertex *v, int n, ULONG color, ULONG flags, struct hwTagList *tags);
hw_RawPolyFill()
in lots of different contexts. If you want to use hw_RawPolyFill()
on a Hollywood bitmap, you need to lock the bitmap first using hw_LockBitMap()
and then pass the raw pixel buffer pointer obtained by hw_LockBitMap()
to hw_RawPolyFill()
.
You have to pass an array of vertices defining the polygon in the v
parameter.
The n
parameter specifies how many vertices there are in n
. struct hwVertex
looks like this:
struct hwVertex { int X; int Y; }; |
Note that before hw_RawPolyFill()
starts drawing, the polygon vertices will be normalized.
Thus, it is also possible to use negative coordinates in v
. The destination bitmap must
be large enough to store the polygon
The following tags are recognized by hw_RawPolyFill()
:
HWRPFTAG_PIXFMT:
hw_RawPolyFill()
should use when drawing
into the pixel buffer. You have to pass a pixel format constant in the iData
member
of this tag. See Pixel format information for details. This tag defaults to HWOS_PIXFMT_ARGB32
.
HWRPFTAG_DSTWIDTH:
iData
member of this tag. If you don't pass this tag, hw_RawPolyFill()
won't work.
HWRPFTAG_X:
hw_RawPolyFill()
will always normalize the vertices
before drawing. (V9.1)
HWRPFTAG_Y:
hw_RawPolyFill()
will always normalize the vertices
before drawing. (V9.1)
Additionally, hw_RawPolyFill()
supports the following flags:
HWRPFFLAGS_BLEND:
hw_RawPolyFill()
will draw a polygon with alpha-blending
to the destination pixel buffer. The blend intensity is taken from the upper 8 bits
in the color
parameter that you've passed to hw_RawPolyFill()
. If this flag is not set,
then hw_RawPolyFill()
will just draw with a static color.
Note that this function does not do any clipping. You must make sure that the destination raw pixel buffer is large enough.
HWRPFFLAGS_BLEND
has been set