DirectX SDK

Clip Lists

[C++]

A clip list consists of one or more RECT structures, in pixel coordinates. DirectDraw manages clip lists by using a DirectDrawClipper object, which can be attached to any surface.

The IDirectDrawSurface7::Blt method copies data only to rectangles in the clip list. For instance, if the upper-right quarter of a surface was excluded by the rectangles in the clip list, and an application blitted to the entire area of the clipped surface, DirectDraw would effectively perform two blits, the first being to the upper-left corner of the surface, and the second being to the bottom half of the surface, as shown in the following diagram.

[Visual Basic]

A clip list consists of one or more RECT types, in pixel coordinates. DirectDraw manages clip lists by using a DirectDrawClipper object, which can be attached to any surface.

The DirectDrawSurface7.Blt method copies data only to rectangles in the clip list. For instance, if the upper-right quarter of a surface was excluded by the rectangles in the clip list, and an application blitted to the entire area of the clipped surface, DirectDraw would effectively perform two blits, the first being to the upper-left corner of the surface, and the second being to the bottom half of the surface, as shown in the following diagram.

You can manage a surface's clip list manually or, for a primary surface, have it done automatically by DirectDraw.

[C++]

To manage the clip list yourself, create a list of rectangles in the form of a RGNDATA structure and pass this to the IDirectDrawClipper::SetClipList method.

To have DirectDraw manage the clip list for a primary surface, you attach the clipper to a window (even a full-screen window) by calling the IDirectDrawClipper::SetHWnd method, specifying the target window's handle. This has the effect of setting the clipping region to the client area of the window and ensuring that the clip list is automatically updated as the window is resized, covered, or uncovered.

[Visual Basic]

To manage the clip list yourself, create a list of rectangles in the form of an array of RECT types and pass this to the DirectDrawClipper.SetClipList method.

To have DirectDraw manage the clip list for a primary surface, you attach the clipper to a window (even a full-screen window) by calling the DirectDrawClipper.SetHWnd method, specifying the target window's handle. This has the effect of setting the clipping region to the client area of the window and ensuring that the clip list is automatically updated as the window is resized, covered, or uncovered.

If you set a clipper using a window handle, you cannot set additional rectangles.

Clipping for overlay surfaces is supported only if the overlay hardware can support clipping and if destination color keying is not active.