[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

The write mask is a RastPort variable that determines which of the
bitplanes are currently writable. For most applications, this variable is
set to all bits on.  This means that all bitplanes defined in the BitMap
are affected by a graphics writing operation.  You can selectively disable
one or more bitplanes by simply specifying a 0 bit in that specific
position in the control byte.  For example:

    #include <graphics/gfxmacros.h>

    SetWrMsk(&rastPort, 0xFB);    /* disable bitplane 2 */

A useful application for the Mask field is to set or clear plane 6 while
in the Extra-Half-Brite display mode to create shadow effects.  For
example:


    SetWrMsk(&rastPort, 0xE0);          /* Disable planes 1 through 5. */

    SetAPen(&rastPort, 0);           /* Clear the Extra-Half-Brite bit */
    RectFill(&rastPort, 20, 20, 40, 30);    /*   in the old rectangle. */

    SetAPen(&rastPort, 32);            /* Set the Extra-Half-Brite bit */
    RectFill(&rastPort, 30, 25, 50, 35);    /*   in the new rectangle. */

    SetWrMsk(&rastPort, -1);                  /* Re-enable all planes. */