Culling State

As Direct3D renders primitives, it culls those primitives that are facing away from the viewer. The culling mode of HAL and MMX devices can be set using the D3DCULL enumerated type. See D3DRENDERSTATE_CULLMODE. By default, Direct3D culls back faces with counterclockwise vertices.

The following code sample illustrates the processor setting the culling mode to cull back faces with clockwise vertices.

// This code fragment assumes that lpD3DDevice3 is a valid pointer to
// an IDirect3DDevice3 interface.
 
// Set the culling state.
lpD3DDevice3->SetRenderState(D3DRENDERSTATE_CULLMODE, 
                             D3DCULL_CW);