DirectX SDK |
You can set texture addressing modes for individual texture stages by calling the IDirect3DDevice7::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 IDirect3DDevice7::GetTextureStageState, using the D3DTSS_ADDRESS, D3DTSS_ADDRESSU, or D3DTSS_ADDRESSV members of the D3DTEXTURESTAGESTATETYPE enumeration to identify the address mode about which you want information.
If your application uses the legacy 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 IDirect3DDevice7::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 IDirect3DDevice7 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.
From Visual Basic, you set texture addressing modes for individual texture stages by calling the Direct3DDevice7.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 CONST_D3DTEXTUREADDRESS enumeration.
To retrieve the current texture address mode for a given texture stage, call Direct3DDevice7.GetTextureStageState, using the D3DTSS_ADDRESS, D3DTSS_ADDRESSU, or D3DTSS_ADDRESSV members of the CONST_D3DTEXTURESTAGESTATETYPE enumeration to the address mode about which you want information.