Copies the display surface (front buffer) to a user-provided resource.
public:
HRESULT GetDisplaySurfaceData1(
IDXGIResource *pDestination
)
pDestination
Type: IDXGIResource *
[in] A pointer to a IDXGIResource resource interface that represents the resource to which GetDisplaySurfaceData1 copies the display surface.
Type: HRESULT
Returns one of the DXGI_ERROR values.
GetDisplaySurfaceData1 is similar to IDXGIOutput::GetDisplaySurfaceData except GetDisplaySurfaceData1 takes an IDXGIResource and IDXGIOutput::GetDisplaySurfaceData takes an IDXGISurface.
GetDisplaySurfaceData1 returns an error if the input resource is not a 2D texture (represented by the ID3D11Texture2D interface) with an array size (ArraySize member of the D3D11_TEXTURE2D_DESC structure) that is equal to the swap chain buffers.
The original IDXGIOutput::GetDisplaySurfaceData and the updated GetDisplaySurfaceData1 behave exactly the same. GetDisplaySurfaceData1 was required because textures with an array size equal to 2 (ArraySize = 2) do not implement IDXGISurface.
You can call GetDisplaySurfaceData1 only when an output is in full-screen mode. If GetDisplaySurfaceData1 succeeds, it fills the destination resource.
Use IDXGIOutput::GetDesc to determine the size (width and height) of the output when you want to allocate space for the destination resource. This is true regardless of target monitor rotation. A destination resource created by a graphics component (such as Direct3D 11) must be created with CPU write permission (see D3D11_CPU_ACCESS_WRITE). Other surfaces can be created with CPU read-write permission (D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE). GetDisplaySurfaceData1 modifies the surface data to fit the destination resource (stretch, shrink, convert format, rotate). GetDisplaySurfaceData1 performs the stretch and shrink with point sampling.
Header: Declared in dxgi1_2.h.
Library: Use dxgi.lib.