IDirect3DDevice9::SetClipStatus method (d3d9helper.h)

Sets the clip status.

Syntax

HRESULT SetClipStatus(
  [in] const D3DCLIPSTATUS9 *pClipStatus
);

Parameters

[in] pClipStatus

Type: const D3DCLIPSTATUS9*

Pointer to a D3DCLIPSTATUS9 structure, describing the clip status settings to be set.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If one of the arguments is invalid, the return value is D3DERR_INVALIDCALL.

Remarks

Clip status is used during software vertex processing. Therefore, this method is not supported on pure or nonpure hardware processing devices. For more information about pure devices, see D3DCREATE.

When clipping is enabled during vertex processing (by IDirect3DDevice9::ProcessVertices, IDirect3DDevice9::DrawPrimitive, or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using D3DCLIPSTATUS9, which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise "OR" of all vertex clip codes and ClipIntersection is a bitwise "AND" of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When D3DRS_CLIPPING is set to FALSE, ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by IDirect3DDevice9::DrawRectPatch and IDirect3DDevice9::DrawTriPatch because there is no software emulation for them.

Requirements

Requirement Value
Target Platform Windows
Header d3d9helper.h (include D3D9.h)
Library D3D9.lib

See also

IDirect3DDevice9

IDirect3DDevice9::GetClipStatus