
IDXGIDevice::CreateSurface method
Returns a surface. This method is used internally and you should not call it directly in your application.
Syntax
HRESULT CreateSurface( [in] const DXGI_SURFACE_DESC *pDesc, UINT NumSurfaces, DXGI_USAGE Usage, [in, optional] const DXGI_SHARED_RESOURCE *pSharedResource, [out] IDXGISurface **ppSurface );
Parameters
- pDesc [in]
-
Type: const DXGI_SURFACE_DESC*
A pointer to a DXGI_SURFACE_DESC structure that describes the surface.
- NumSurfaces
-
Type: UINT
The number of surfaces to create.
- Usage
-
Type: DXGI_USAGE
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]
-
Type: IDXGISurface**
The address of an IDXGISurface interface pointer to the first created surface.
Return value
Type: HRESULT
Returns S_OK if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.
Remarks
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.
Requirements
Header |
|
---|---|
Library |
|
See also