> ## Name

> cgD3D9GetDevice - retrieves the current D3D9 device associated with the runtime

> ## Synopsis

>     #include <Cg/cgD3D9.h>

>     IDirect3DDevice9 * cgD3D9GetDevice( void );

> ## Parameters

> None.

> ## Return Values

> Returns the current D3D9 device associated with the runtime.

> ## Description

> cgD3D9GetDevice retrieves the current D3D9 device associated with the runtime. Note that the returned device pointer may be NULL.

> ## Examples

>       IDirect3DDevice9* curDevice = cgD3D9GetDevice();

> ## Errors

> None.

> ## History

> cgD3D9GetDevice was introduced in Cg 1.1.

> ## See Also

> cgD3D9SetDevice