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

PgSetClipping()

Limit the extent of drawing

Synopsis:

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

Library:

ph

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 is 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 PgSetMultiClip(), PtClipAdd(), and PtClipRemove() instead.


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() PhRect_t, PtClipAdd(), PtClipRemove()


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