Returns a surface. This method is used internally and you should not call it directly in your application.
HRESULT CreateSurface( [in] const DXGI_SURFACE_DESC *pDesc, UINT NumSurfaces, DXGI_USAGE Usage, [in, optional] const DXGI_SHARED_RESOURCE *pSharedResource, [out] IDXGISurface **ppSurface );
- pDesc [in]
Type: const DXGI_SURFACE_DESC*
A pointer to a DXGI_SURFACE_DESC structure that describes the surface.
The number of surfaces to create.
A DXGI_USAGE flag that specifies how the surface is expected to be used.
- pSharedResource [in, optional]
Type: const DXGI_SHARED_RESOURCE*
An optional pointer to a DXGI_SHARED_RESOURCE structure that contains shared resource information for opening views of such resources.
- ppSurface [out]
The address of an IDXGISurface interface pointer to the first created surface.
Returns S_OK if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.
The CreateSurface method creates a buffer to exchange data between one or more devices. It is used internally, and you should not directly call it.
The runtime automatically creates an IDXGISurface interface when it creates a Direct3D resource object that represents a surface. For example, the runtime creates an IDXGISurface interface when it calls ID3D11Device::CreateTexture2D or ID3D10Device::CreateTexture2D to create a 2D texture. To retrieve the IDXGISurface interface that represents the 2D texture surface, call ID3D11Texture2D::QueryInterface or ID3D10Texture2D::QueryInterface. In this call, you must pass the identifier of IDXGISurface. If the 2D texture has only a single MIP-map level and does not consist of an array of textures, QueryInterface succeeds and returns a pointer to the IDXGISurface interface pointer. Otherwise, QueryInterface fails and does not return the pointer to IDXGISurface.
Windows Phone 8: This API is supported.