Using Texture Wrapping

The process of enabling texture wrapping differs across versions the Direct3D device interfaces. If your application uses the IDirect3DDevice3 interface, you enable texture wrapping individually for each texture in the multi-texture cascade. In this case, call the IDirect3DDevice3::SetRenderState method to enable texture wrapping, passing one of the D3DRENDERSTATE_WRAP0 through D3DRENDERSTATE_WRAP7 enumerated values as the first parameter to identify which stage's wrapping state is being set. Specify the D3DWRAP_U and D3DWRAP_V flags in the second parameter to enable texture wrapping in the corresponding direction, or combine the two to enable wrapping in both directions. If you omit one or both of the flags, texture wrapping in the corresponding direction is disabled. To disable texture wrapping for a texture stage, set the value for the corresponding render state to 0.

If your application uses the legacy IDirect3DDevice2 or IDirect3DDevice interfaces, you still enable texture wrapping by calling the SetRenderState method; however, these interface versions do not support D3DRENDERSTATE_WRAP0 through D3DRENDERSTATE_WRAP7. Instead, use the D3DRENDERSTATE_WRAPU or D3DRENDERSTATE_WRAPV value in the first parameter. Specify TRUE as in the second parameter to enable wrapping, or FALSE to disable it.

Note  The IDirect3DDevice3 interface does recognize the legacy D3DRENDERSTATE_WRAPU and D3DRENDERSTATE_WRAPV render states, even though they were superseded by D3DRENDERSTATE_WRAP0 through D3DRENDERSTATE_WRAP7. These older render states, when passed to the IDirect3DDevice3 version of SetRenderState, affect U and V texture wrapping for the first texture stage (stage 0).