LPDXUTCALLBACKDEVICECREATED
Microsoft DirectX 9.0 SDK Update (October 2004)

LPDXUTCALLBACKDEVICECREATED Prototype


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

Syntax

typedef HRESULT (CALLBACK *LPDXUTCALLBACKDEVICECREATED)(      

    IDirect3DDevice9 *pd3dDevice,     const D3DSURFACE_DESC *pBackBufferSurfaceDesc );

Parameters

pd3dDevice
[out] Pointer to the newly created IDirect3DDevice9 device.
pBackBufferSurfaceDesc
[out] Pointer to a D3DSURFACE_DESC surface description of the back buffer.

Return Value

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 the sample framework 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.

Prototype Information

Headerdxut.h
Import libraryNone
Minimum operating systems Windows 98

See Also

Device Events, DXUTSetCallbackDeviceCreated, DXUTSetCallbackDeviceDestroyed, LPDXUTCALLBACKDEVICEDESTROYED


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.