interop::CreateDirect3D11SurfaceFromDXGISurface 函数 (windows.graphics.directx.direct3d11.interop.h)

IDXGISurface 创建 IDirect3DSurface实例。

语法

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

参数

dgxiSurface

[out] graphicsSurface

类型: IInspectable**

包装 IDXGISurfaceIDirect3DSurface 实例。

返回值

类型: HRESULT

如果函数成功,则返回 S_OK。 否则,它将返回 HRESULT错误代码

注解

虽然我们建议 使用 C++/WinRT,但如果使用的是 C++/CX,则应调用 CreateDirect3DSurface 而不是 CreateDirect3D11DeviceFromDXGIDevice。 如果使用的是 WRL,则可以使用此代码示例所示的 CreateDirect3D11DeviceFromDXGIDevice

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

要求

要求
目标平台 Windows
标头 windows.graphics.directx.direct3d11.interop.h
Library D3D11.lib
DLL D3D11.dll

另请参阅

核心函数