Skip to main content
D2D1CreateDevice function

Creates a new Direct2D device associated with the provided DXGI device.

Syntax


HRESULT WINAPI D2D1CreateDevice(
  _In_           IDXGIDevice              *dxgiDevice,
  _In_opt_ const D2D1_CREATION_PROPERTIES *creationProperties,
  _Out_          ID2D1Device              **d2dDevice
);

Parameters

dxgiDevice [in]

The DXGI device the Direct2D device is associated with.

creationProperties [in, optional]

The properties to apply to the Direct2D device.

d2dDevice [out]

When this function returns, contains the address of a pointer to a Direct2D device.

Return value

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

HRESULTDescription
S_OKNo error occurred.
E_OUTOFMEMORYDirect2D could not allocate sufficient memory to complete the call.
E_INVALIDARGAn invalid value was passed to the method.

 

Remarks

This function will also create a new ID2D1Factory1 that can be retrieved through ID2D1Resource::GetFactory.

If the creation properties are not specified, then d2dDevice will inherit its threading mode from dxgiDevice and debug tracing will not be enabled.

Requirements

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1_1.h

DLL

D2d1.dll

See also

ID2D1Device
ID2D1Factory
ID2D1Resource::GetFactory
D2D1_CREATION_PROPERTIES
D2D1CreateFactory

 

 

Microsoft 正在进行一项网上调查,以了解您对 网站的意见。如果您选择参加,我们将会在您离开 网站时向您显示该网上调查。

是否要参加?