LPDXUTCALLBACKDEVICERESET

Application-defined resource creation callback function, called by DXUT after the Direct3D device is reset. Passes a pointer to the newly reset device.

HRESULT LPDXUTCALLBACKDEVICERESET(
  IDirect3DDevice9 * pd3dDevice,
  CONST D3DSURFACE_DESC * pBackBufferSurfaceDesc,
  void* pUserContext
);

Parameters

pd3dDevice
[out] Pointer to the reset IDirect3DDevice9 device.
pBackBufferSurfaceDesc
[out] Pointer to a D3DSURFACE_DESC surface description of the back buffer.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

In general, if no error occurs, program the function to return S_OK. Program the function to return an HRESULT error code if the function fails. If DXUT receives a failure HRESULT code, it will shut down the application.

Remarks

This callback function is the appropriate location for the application to create default pool resources, in D3DPOOL_DEFAULT memory, since these resources need to be reloaded whenever the device is reset. Resources created in this callback function should be deleted in the LPDXUTCALLBACKDEVICELOST callback function.

Requirements

Header: Declared in Dxut.h.

See Also

LPDXUTCALLBACKDEVICERESET, LPDXUTCALLBACKDEVICELOST, LPDXUTCALLBACKDEVICELOST, Lost Devices