Returns a surface. This method is used internally and you should not call it directly in your application.
HRESULT CreateSurface( const DXGI_SURFACE_DESC *pDesc, UINT NumSurfaces, DXGI_USAGE Usage, const DXGI_SHARED_RESOURCE *pSharedResource, IDXGISurface **ppSurface );
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.
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.
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.