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.

ID2D1Factory1::CreateDevice method

Creates a ID2D1Device object.

Syntax


HRESULT CreateDevice(
  [in]  IDXGIDevice *dxgiDevice,
  [out] ID2D1Device **d2dDevice
);

Parameters

dxgiDevice [in]

Type: IDXGIDevice*

The IDXGIDevice object used when creating the ID2D1Device.

d2dDevice [out]

Type: ID2D1Device**

The requested ID2D1Device object.

Return value

Type: HRESULT

The method 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 parameter was passed to the returning function.
D3DERR_OUTOFVIDEOMEMORYDirect3D does not have enough display memory to perform the operation.

 

Remarks

The Direct2D device defines a resource domain in which a set of Direct2D objects and Direct2D device contexts can be used together. Each call to CreateDevice returns a unique ID2D1Device object, even if you pass the same IDXGIDevice multiple times.

Requirements

Minimum supported client

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

Minimum supported server

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

Minimum supported phone

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

Header

D2d1_1.h

Library

D2d1.lib

DLL

D2d1.dll

See also

ID2D1Factory1
ID2D1Device
ID2D1DeviceContext
ID2D1DeviceContext::GetDevice

 

 

Show:
© 2017 Microsoft