interop::CreateDirect3D11SurfaceFromDXGISurface function (windows.graphics.directx.direct3d11.interop.h)

Creates an instance of IDirect3DSurface from an IDXGISurface.

Syntax

HRESULT CreateDirect3D11SurfaceFromDXGISurface(
        IDXGISurface *dgxiSurface,
  [out] IInspectable **graphicsSurface
);

Parameters

dgxiSurface

[out] graphicsSurface

Type: IInspectable**

An IDirect3DSurface instance that wraps the IDXGISurface.

Return value

Type: HRESULT

If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

While we recommend C++/WinRT, if you're using C++/CX then you should call CreateDirect3DSurface instead of CreateDirect3D11DeviceFromDXGIDevice. If you're using WRL then CreateDirect3D11DeviceFromDXGIDevice can be used as shown in this code example.

using namespace Microsoft::WRL;
ComPtr<ABI::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface> surface;
ComPtr<IInspectable> inspectableSurface;
If (SUCCEEDED(CreateDirect3D11SurfaceFromDXGISurface(dxgiSurface, &inspectableSurface))
{
    hr = inspectableSurface.As(&surface);
}

Requirements

Requirement Value
Target Platform Windows
Header windows.graphics.directx.direct3d11.interop.h
Library D3D11.lib
DLL D3D11.dll

See also

Core functions