?/TD>
Microsoft DirectX 9.0

Culling State


As Microsoft?Direct3D?renders primitives, it culls primitives that are facing away from the user.

C++ applications set the culling mode by using the D3DRS_CULLMODE render state, which can be set to a member of the D3DCULL enumerated type. By default, Direct3D culls back faces with counterclockwise vertices.

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

// This code example assumes that d3dDevice is a valid 
// pointer to an IDirect3DDevice9 interface.
// Set the culling state.
d3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);


© 2002 Microsoft Corporation. All rights reserved.