Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Creates an ID2D1Device1 object.
Syntax
HRESULT CreateDevice(
[in] IDXGIDevice *dxgiDevice,
[out] ID2D1Device1 **d2dDevice1
);
Parameters
[in] dxgiDevice
Type: IDXGIDevice*
The IDXGIDevice object used when creating the ID2D1Device1.
[out] d2dDevice1
Type: ID2D1Device1**
The requested ID2D1Device1 object.
Return value
Type: HRESULT
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
HRESULT | Description |
---|---|
S_OK | No error occurred. |
E_OUTOFMEMORY | Direct2D could not allocate sufficient memory to complete the call. |
E_INVALIDARG | An invalid parameter was passed to the returning function. |
D3DERR_OUTOFVIDEOMEMORY | Direct3D 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 ID2D1Device1 object, even if you pass the same IDXGIDevice multiple times.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8.1 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2012 R2 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | d2d1_2.h |
Library | D2d1.lib |
DLL | D2d1.dll |