About the Border Color Texture Address Mode

The "border color" texture address mode, identified by the D3DTADDRESS_BORDER member of the D3DTEXTUREADDRESS enumerated type, causes Direct3D to use an arbitrary color, known as the border color, for any texture coordinates outside the range of 0.0 through 1.0, inclusive.

This is shown in the next illustration in which the application specified that the texture be applied to the primitive using a red border.

How your application sets the border color depends on what version of the Direct3D device interface it uses. If your application uses the IDirect3DDevice3 interface, set the border color by calling IDirect3DDevice3::SetTextureStageState. Set the first parameter for the call to the desired texture stage identifier, the second parameter to the D3DTSS_BORDERCOLOR stage state value, and the third parameter to the new RGBA border color.

If your application stills uses the legacy IDirect3DDevice2 interface, you can set the border color by calling IDirect3DDevice2::SetRenderState method, specifying the D3DRENDERSTATE_BORDERCOLOR render state value and the new RGBA border color as parameters.

Note  The IDirect3DDevice3::SetRenderState method (as opposed to the IDirect3DDevice2 version) still recognizes the D3DRENDERSTATE_BORDERCOLOR render state, even though it has been superseded. Instead of failing this legacy render state, the IDirect3DDevice3 implementation maps the effect of this render state 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.