LPDXUTCALLBACKDEVICECREATED

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

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

Parameters

pd3dDevice
[out] Pointer to the newly created 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 failure 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 resources in D3DPOOL_MANAGED or D3DPOOL_SYSTEMMEM memory, since these resources do not need to be reloaded whenever the device is reset. Resources created in this callback function should be deleted in the LPDXUTCALLBACKDEVICEDESTROYED callback function.

Requirements

Header: Declared in Dxut.h.

See Also

DXUTSetCallbackDeviceCreated, DXUTSetCallbackDeviceDestroyed, LPDXUTCALLBACKDEVICEDESTROYED