DXUTSetCallbackDeviceCreated

Sets the Direct3D device-created callback function.

VOID DXUTSetCallbackDeviceCreated(
  LPDXUTCALLBACKDEVICECREATED pCallbackDeviceCreated,
  void* pUserContext
);

Parameters

pCallbackDeviceCreated
[in] Pointer to a LPDXUTCALLBACKDEVICECREATED callback function. If the callback function is supplied, it will be called after the Direct3D device has been created. Device creation will happen during application initialization and if the device is changed. If NULL, DXUT will not notify the application about device creation.
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

No return value.

Remarks

The LPDXUTCALLBACKDEVICECREATED callback function is the appropriate location for the application to create resources in D3DPOOL_MANAGED or D3DPOOL_SYSTEMMEM memory, because these resources do not need to be reloaded whenever the device is reset. Resources created in the LPDXUTCALLBACKDEVICECREATED callback function should be deleted in the LPDXUTCALLBACKDEVICEDESTROYED callback function.

Requirements

Header: Declared in Dxut.h.

See Also

LPDXUTCALLBACKDEVICECREATED, LPDXUTCALLBACKDEVICEDESTROYED, DXUTSetCallbackDeviceDestroyed