IDirect3DMobileDevice::SetTexture (Windows CE 5.0)

Send Feedback

This method is used to change the current texture map bound to texture stage.

HRESULT SetTexture(  DWORD Stage,  IDirect3DMobileBaseTexture* pTexture);


  • Stage
    [in] A DWORD value identifying the texture stage to bind the texture map to.

  • pTexture
    [in] A pointer to an IDirect3DMobileBaseTexture interface for the texture that will be bound to the stage identified by Stage.

    The IDirect3DMobileDevice::SetTexture method maintains a reference to the texture map's interface so long as the texture map is bound to the stage. Setting this parameter to NULL clears the texture map currently bound to a stage.

Return Values

If the method succeeds, the return value is D3DM_OK (see D3DM Values).

If the method fails, the return value can be D3DMERR_INVALIDCALL (see D3DMERR Values).


There are no default texture maps in Direct3D Mobile, and nothing is automatically bound to any texture stage.

This method increments the reference count of the texture surface being assigned and 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 NULL. Failure to do this results in a memory leak.


OS Versions: Windows CE 5.0 and later.
Header: D3dm.h.
Link Library: D3dm.lib, D3dmguid.lib.

See Also

IDirect3DMobileDevice | IDirect3DMobileBaseTexture

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.