IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface Interface


This represents an IDXGISurface and can be used to interop between Windows Runtime components that need to exchange IDXGISurface references.

public : interface IDirect3DSurface : IClosable
public interface IDirect3DSurface : IDisposable
Public Interface IDirect3DSurface Implements IDisposable
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


First include the necessary headers and namespaces:

#include <Windows.Graphics.DirectX.Direct3D11.interop.h>
#include <dxgi.h>
using namespace Windows::Graphics::DirectX::Direct3D11;
using namespace Microsoft::WRL;

To get the native DirectX surface that is wrapped by a Direct3DSurface:

IDirect3DSurface^ d3dSurface = ...;  
ComPtr<IDXGISurface> nativeSurface;
HRESULT hr = GetDXGIInterface(d3dSurface, nativeSurface.GetAddressOf());

To create a new Direct3DSurface object wrapping a native DirectX surface:

ComPtr<IDXGISurface> nativeSurface = ...;
IDirect3DSurface^ d3dSurface = CreateDirect3DSurface(nativeSurface.Get());


To move back and forth between IDirect3DSurface and IDXGISurface, use the CreateDirect3DSurface and GetDXGIInterface(IDirect3DSurface^, DXGIType**) functions.


Description Description Description Description

Gets a Direct3DSurfaceDescription describing the surface.

public : Direct3DSurfaceDescription Description { get; }
public Direct3DSurfaceDescription Description { get; }
Public ReadOnly Property Description As Direct3DSurfaceDescription
var direct3dSurfaceDescription = iDirect3DSurface.description;


Close Close Close Close

Releases system resources that are exposed by a Windows Runtime object.

.NET This interface appears as System.IDisposable.

C++/CX This interface appears as Platform::IDisposable.

(Inherited from IClosable)

See Also

  • IClosable IDisposable IDisposable IDisposable