[Previous] [Contents] [Index] [Next]

PgSetDrawMode()

Set draw mode

Synopsis:

int PgSetDrawMode( int mode );

Description:

This function controls how pixels are combined with video memory. You can set mode to one of the following:

mode value Description
Pg_DRAWMODE_OPAQUE Use default draw mode (the draw overwrites the screen).
Pg_DRAWMODE_XOR XOR drawn pixels with the screen.
Pg_DRAWMODE_AND AND drawn pixels with the screen.
Pg_DRAWMODE_OR OR drawn pixels with the screen.

Note: The effect of this function depends on the physical video mode. If the video mode is "true color," the RGB value being drawn will modify the RGB value of the pixel that's in video memory. If the video mode is palette based, the palette index of the draw color will modify the palette index of the pixel that's in video memory.

To facilitate XOR drawing, you can use the special draw color Pg_INVERT_COLOR. This color remains highly visible regardless of video mode (see PgSetFillColor()). If the video mode is true color, the graphics driver will XOR the screen pixels with pure white. If the video mode is palette based, the driver will invert the pixel index.

Returns:

The previous drawing mode.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgDefaultMode(), PgSetFillColor(), PgSetFillDither(), PgSetFillTransPat()


[Previous] [Contents] [Index] [Next]