Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.SetTexture

Assigns a texture to a stage for a device.

object.SetTexture( _ 
    Stage As Long, _ 
    Texture As Direct3DBaseTexture8)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Stage
Stage identifier to which the texture is set. Stage identifiers are zero-based. Devices can have up to eight set textures, so the maximum allowable value allowed for Stage is 7.
Texture
A Direct3DBaseTexture8 object, representing the texture being set. For complex textures, such as mipmaps and cube textures, this parameter must be the top-level surface.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

This method increments the reference count of the texture surface being assigned, and it decrements the reference count of the previously selected texture if there is one. When the texture is no longer needed, set the texture at the appropriate stage to Nothing. Failure to do this results in a memory leak.

See Also

Direct3DDevice8.GetTexture, Direct3DDevice8.GetTextureStageState, Direct3DDevice8.SetTextureStageState