cgD3D11GetDevice
Keywords: cgD3D11GetDevice, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> cgD3D11GetDevice - retrieves the current D3D11 device associated with a context

> ## Synopsis

>     #include <Cg/cgD3D11.h>

>     ID3D11Device * cgD3D11GetDevice( CGcontext context );

> ## Parameters

> context
>   The context from which to get the current device.

> ## Return Values

> Returns the current D3D11 device associated with context.

> ## Description

> cgD3D11GetDevice retrieves the current D3D11 device associated with context. Note that the returned device pointer may be NULL.

> ## Examples

>       ID3D11Device* curDevice = cgD3D11GetDevice(ctx);

> ## Errors

> CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.

> ## History

> cgD3D11GetDevice was introduced in Cg 3.0.

> ## See Also

> cgD3D11SetDevice