Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

DXGI.h

Library

DXGI.lib

See also

IDXGIDevice
DXGI Interfaces
ID3D11Device::CreateTexture2D
ID3D10Device::CreateTexture2D

 

 

Show:
© 2018 Microsoft