Platform SDK: DirectX |
Direct3D maintains a list of up to eight current textures. It blends these textures onto all of the primitive it renders. Only textures created as texture interface pointers can be used in the set of current textures.
Applications call the IDirect3DDevice7::SetTexture method to assign textures into the set of current textures. The first parameter must be from the a number in the range of 0-7 inclusive. Pass the texture interface pointer as the second parameter.
The following C++ code fragment demonstrates how a texture can be assigned into the set of current textures.
// This code fragment assumes that the variable lpd3dDev is a valid // pointer to an IDirect3DDevice7 interface and lpd3dTexture is a valid // pointer to an IDirectDrawSurface7 interface. // Set the third texture. lpd3dDev->SetTexture(2, lpd3dTexture);
Applications written in Visual Basic call Direct3DDevice7.SetTexture to assign textures into the set of current textures. The first parameter must be from the a number in the range of 0-7 inclusive. Pass the texture interface pointer as the second parameter.
This Visual Basic code fragment demonstrates how a texture can be assigned into the set of current textures:
' This code fragment assumes that the variable d3dDev is a valid ' reference to a Direct3DDevice7 object and d3dTexture is a valid ' reference to a DirectDrawSurface7 object. ' Set the third texture. Call d3dDev.SetTexture(2, d3dTexture)
Note Software devices do not support assigning a texture to more than one texture stage at a time.