XMConvertFloatToHalfStream
XMConvertHalfToFloatStream
XMMatrixDecompose
XMPlaneTransformStream
XMVector2TransformCoordStream
XMVector2TransformNormalStream
XMVector2TransformStream
XMVector3ProjectStream
XMVector3TransformCoordStream
XMVector3TransformNormalStream
XMVector3TransformStream
XMVector3UnprojectStream
XMVector4TransformStream
Expand Minimize

D2D1CreateDeviceContext function

Creates a new Direct2D device context associated with a DXGI surface.

Syntax


HRESULT WINAPI D2D1CreateDeviceContext(
  _In_      IDXGISurface *dxgiSurface,
  _In_opt_  const D2D1_CREATION_PROPERTIES *creationProperties,
  _Out_     ID2D1DeviceContext **d2dDeviceContext
);

Parameters

dxgiSurface [in]

The DXGI surface the Direct2D device context is associated with.

creationProperties [in, optional]

The properties to apply to the Direct2D device context.

d2dDeviceContext [out]

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

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.

This function will also create a new ID2D1Device that can be retrieved through ID2D1DeviceContext::GetDevice.

The DXGI device will be specified implicitly through dxgiSurface.

The created device context will have exactly the same behavior as if ID2D1DeviceContext::SetTargetSurface were called with the corresponding surface.

If creationProperties are not specified, the Direct2D device will inherit its threading mode from the DXGI device implied by dxgiSurface and debug tracing will not be enabled.

Windows Phone 8.1: This API is supported.

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]

Header

D2d1_1.h

DLL

D2d1.dll

See also

ID2D1Device
ID2D1Factory
ID2D1Resource::GetFactory
D2D1_CREATION_PROPERTIES
D2D1CreateDevice
D2D1CreateDeviceContext

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.