IDirect3DTexture2::GetHandle

The IDirect3DTexture2::GetHandle method obtains the texture handle to be used when rendering with the IDirect3DDevice2 or IDirect3DDevice interfaces.

HRESULT GetHandle(
  LPDIRECT3DDEVICE2 lpDirect3DDevice2,  
  LPD3DTEXTUREHANDLE lpHandle           
);
 

Parameters

lpDirect3DDevice2
Address of the Direct3DDevice2 object into which the texture is to be loaded.
lpHandle
Address that will contain the texture handle corresponding to the Direct3DTexture2 object.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value may be one of the following values:

DDERR_INVALIDPARAMS

Remarks

In the IDirect3DTexture interface, this method uses a pointer to a Direct3DDevice object instead of a Direct3DDevice2 object.

Texture handles are used only device interfaces earlier than IDirect3DDevice3. The IDirect3DDevice3 interface references textures using texture interface pointers, set through the IDirect3DDevice3::SetTexture method.

You cannot use this method to retrieve the handle of a texture that is managed by Direct3D. For more information, see Automatic Texture Management .

QuickInfo

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in d3d.h.
  Import Library: Use ddraw.lib.