Texture handles are primarily provided for backward compatibility. New applications should use texture interface pointers. See Texture Interfaces.
The IDirect3D and IDirect3D2 interfaces are used when programming with Direct3D texture handles. A Direct3D texture is a DirectDraw surface. You can use a DirectDraw surface as a texture map by calling the IDirectDrawSurface4::QueryInterface method to retrieve an IDirect3DTexture2 interface. Use the IDirect3DTexture2 interface to load textures, retrieve handles, and track changes to palettes.
A texture map created with the IDirect3DTexture2 interface must be associated with a 3-D device. A texture handle identifies the coupling of a texture map and a device. A given texture can be associated with more than one device. When your application calls the IDirect3DTexture2::GetHandle method to associate a texture with a device, Direct3D validates it to ensure that the device supports the specified type of texture format and dimensions. The GetHandle method returns the texture handle if this validation succeeds. Your application can then use texture handles as parameters to render states. For details, see Render States.
Applications can use handles obtained using IDirect3DTexture or IDirect3DTexture2 for a given device interface interchangeably.
The IDirect3DTexture2 interface eliminates some unimplemented methods from the IDirect3DTexture interface.
This section presents information on creating and rendering with texture handles in the topics listed hereafter: