How your application sets and retrieves texture addressing modes depends largely on which version of the Direct3D device interface it uses. When performing multiple texture blending by way of the IDirect3DDevice3 interface, you can set texture addressing modes for individual texture stages by calling the IDirect3DDevice3::SetTextureStageState method. Specify the desired texture stage identifier in the first parameter. Set the second parameter to D3DTSS_ADDRESS to change both the U and V texture addressing modes simultaneously, or use the D3DTSS_ADDRESSU or D3DTSS_ADDRESSV values to update the U or V addressing modes individually. The third parameter you pass to SetTextureStageState determines which mode is being set; this can be any one of the members of the D3DTEXTUREADDRESS enumerated type. To retrieve the current texture address mode for a given texture stage, call IDirect3DDevice3::GetTextureStageState, using the D3DTSS_ADDRESS, D3DTSS_ADDRESSU, or D3DTSS_ADDRESSV members of the D3DTEXTURESTAGESTATETYPE enumeration to identify about which address mode you want information.
If your application uses the IDirect3DDevice2 interface, you set texture addressing modes by calling the IDirect3DDevice2::SetRenderState method, using the D3DRENDERSTATE_TEXTUREADDRESS render state to simultaneously set U and V texture addressing. You can set U and V addressing individually with the D3DRENDERSTATE_TEXTUREADDRESSU or D3DRENDERSTATE_TEXTUREADDRESSV render states. Like their newer SetTextureStageState counterparts, these render states also use the values from D3DTEXTUREADDRESS enumerated type.
Note The IDirect3DDevice3::SetRenderState method (as opposed to the IDirect3DDevice2 version) still recognizes the D3DRENDERSTATE_TEXTUREADDRESS, D3DRENDERSTATE_TEXTUREADDRESSU, D3DRENDERSTATE_TEXTUREADDRESSV render states, even though they have been superseded. Instead of failing these legacy render states, the IDirect3DDevice3 implementation maps their effects to the first texture stage (stage 0). Applications should not mix the legacy render states with their corresponding texture stage states, as unpredictable results can occur.