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

PgSetClipping()

Limit the extent of drawing

Synopsis:

void PgSetClipping( unsigned short n,
                    PhRect_t const *rects );

Description:

This function lets you limit the extent of drawing by specifying which rectangles to draw in. Note that you can never draw outside of the current region.

The n argument contains the number of clip rectangles; rects contains an array of n clip rectangles, relative to the origin of the current region. To reset the clipping rectangle to the full size of the region, you should pass 0 rectangles.

All subsequent draws will be clipped to the intersection of the clipping rectangles set by PgSetClipping(), PgSetMultiClip(), and PgSetUserClip(), and PgSetRegion().


Note: PhAttach(), PhReattach(), and PgSetRegion() reset the clipping rectangle to the full size of the region.

Don't call PgSetClipping() in a widget's draw function; use PtClipAdd() and PtClipRemove() instead. For more information, see the Building Custom Widgets guide.


This function flushes the draw buffer.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgFlush(), PgSetMultiClip(), PgSetRegion(), PgSetUserClip(), PhAttach(), PhReattach()

PtClipAdd(), PtClipRemove() in the Building Custom Widgets guide.


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