Partager via


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

Crée un instance d’IDirect3DSurface à partir d’un IDXGISurface.

Syntaxe

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

Paramètres

dgxiSurface

[out] graphicsSurface

Type : IInspectable**

Une instance IDirect3DSurface qui encapsule idXGISurface.

Valeur retournée

Type : HRESULT

Si la fonction réussit, elle retourne S_OK. Sinon, il retourne un code d’erreurHRESULT.

Remarques

Bien que nous recommandons C++/WinRT, si vous utilisez C++/CX, vous devez appeler CreateDirect3DSurface au lieu de CreateDirect3D11DeviceFromDXGIDevice. Si vous utilisez WRL, vous pouvez utiliser CreateDirect3D11DeviceFromDXGIDevice comme indiqué dans cet exemple de code.

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

Configuration requise

Condition requise Valeur
Plateforme cible Windows
En-tête windows.graphics.directx.direct3d11.interop.h
Bibliothèque D3D11.lib
DLL D3D11.dll

Voir aussi

Fonctions principales