Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost or before resetting a device.
HRESULT OnLostDevice();
None.
If the method succeeds, the return value is S_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
This method should be called whenever the device is lost or before the user calls IDirect3DDevice9::Reset. Even if the device was not actually lost, ID3DXSprite::OnLostDevice is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling IDirect3DDevice9::Reset and then ID3DXSprite::OnResetDevice.
Header: Declared in D3dx9core.h.