DXUTSetDevice
Microsoft DirectX 9.0 SDK Update (October 2004)

DXUTSetDevice Function


Sets an existing Microsoft Direct3D device for use by the sample framework.

Syntax

HRESULT DXUTSetDevice(      

    IDirect3DDevice9 *pd3dDevice );

Parameters

pd3dDevice
[in] Pointer to a IDirect3DDevice9 object to use for rendering.

Return Value

If the function succeeds, the return value is S_OK.

If the function fails, the return value can be one of the error codes in DXUTERR.

Remarks

This function relies on an existing Direct3D device object created by the application. Alternately, the application can call DXUTCreateDevice or DXUTCreateDeviceFromSettings to have the sample framework create a device. If neither DXUTCreateDevice, DXUTCreateDeviceFromSettings, nor DXUTSetDevice have been called before a framework method that relies on a device, the framework will automatically call DXUTCreateDevice using the default parameter values.

The application can call this function after a device has already been created to change the current device.

Function Information

Headerdxut.h
Import libraryNone
Minimum operating systems Windows 98

See Also

Using Your Own Device, DXUTCreateDevice, DXUTCreateDeviceFromSettings


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