Rendering with Texture Interface Pointers

As part of the multitexturing functionality of that was introduced in the IDirect3DDevice3 interface, Direct3D supports texture stages. Each texture stage contains a texture and operations that can be performed on the texture. The textures in the texture stages form the set of current textures. For more information, see Multiple Texture Blending. The state of each texture is encapsulated in its texture stage. Therefore, the state of each texture must be set with the IDirect3DDevice3::SetTextureStageState method. Pass the stage number (0-7) as the value of the first parameter. Set the value of the second parameter to a member of the member of the D3DTEXTURESTAGESTATETYPE enumerated type. The final parameter is the state value for the particular texture state.

Using texture interface pointers, your application can render a blend of up to eight textures. Set the current textures by invoking the IDirect3DDevice3::SetTexture method. Direct3D will blend all current textures onto the primitives that it renders.

Your application can set the texture wrapping state for the current textures by calling the IDirect3DDevice3::SetRenderState method. Pass a value from D3DRENDERSTATE_WRAP0 through D3DRENDERSTATE_WRAP7 as the value of the first parameter, and use a combination of the D3DWRAP_U or D3DWRAP_V flags to enable wrapping in the u or v directions.

Your application can also set the texture perspective and texture filtering states. See Texture Perspective State, Texture Filtering, and Texture Filtering State.