CreateDirect3D11DeviceFromDXGIDevice function
Creates an instance of IDirect3DDevice from an IDXGIDevice.
Syntax
HRESULT WINAPI CreateDirect3D11DeviceFromDXGIDevice( _In_ IDXGIDevice *dxgiDevice, _Out_ IInspectable **graphicsDevice );
Parameters
- dxgiDevice [in]
-
The IDXGIDevice to create the Direct3DDevice from.
- graphicsDevice [out]
-
A Direct3DDevice instance that wraps the DXGIDevice.
Return value
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
If you are using C++/CX then you should call CreateDirect3DDevice instead of CreateDirect3D11DeviceFromDXGIDevice. If you are using WRL then CreateDirect3D11DeviceFromDXGIDevice can used as shown in the example below:
Examples
The following is an example of how CreateDirect3D11DeviceFromDXGIDevice is used.
using namespace Microsoft::WRL; ComPtr<ABI::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice> device; ComPtr<IInspectable> inspectableSurface; If (SUCCEEDED(CreateDirect3D11DeviceFromDXGIDevice(dxgiDevice, &inspectableSurface)) { hr = inspectableSurface.As(&device); }
Requirements
|
Header |
|
|---|---|
|
Library |
|
|
DLL |
|