ID3DXFont::OnLostDevice method

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.

Syntax

HRESULT OnLostDevice();

Parameters

This method has no parameters.

Return value

Type: HRESULT

If the method succeeds, the return value is S_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.

Remarks

This method should be called whenever the device is lost or before the user calls Reset. Even if the device was not actually lost, 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 Reset and then OnResetDevice.

Requirements

Requirement Value
Header
D3dx9core.h
Library
D3dx9.lib

See also

ID3DXFont