Blt
Expand Minimize

CreateDevice routine

The CreateDevice function creates a graphics context that is referenced in subsequent calls.

Syntax


PFND3DDDI_CREATEDEVICE CreateDevice;

__checkReturn HRESULT APIENTRY CreateDevice(
  _In_     HANDLE hAdapter,
  _Inout_  D3DDDIARG_CREATEDEVICE *pCreateData
)
{ ... }

Parameters

hAdapter [in]

A handle that identifies the graphics adapter.

pCreateData [in, out]

A pointer to a D3DDDIARG_CREATEDEVICE structure. On input, this structure contains information that the driver can use. On output, the driver specifies information in the structure that the Microsoft Direct3D runtime can use.

Return value

CreateDevice returns one of the following values:

Return codeDescription
S_OK

The graphics context is successfully created.

E_OUTOFMEMORY

CreateDevice could not allocate the memory that was required for it to complete.

 

Remarks

A display device is a graphics context that is used to hold a collection of rendering state. Multiple devices can be created by the same process on a given adapter. Note that the number of display devices that can simultaneously exist is limited only by available system memory. That is, a driver cannot hardcode a maximum device limit.

Generally, devices are independent of each other, so that resources that are created in one device cannot be referenced or accessed by resources that are created in another. However, cross-process resources are an exception to this rule.

When the Direct3D runtime calls CreateDevice to create a device, the runtime does not create a default graphics processing unit (GPU) context thread of execution for the device. The driver must explicitly call the pfnCreateContextCb function to create one or more contexts as required.

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

D3dumddi.h (include D3dumddi.h)

See also

D3DDDI_ADAPTERFUNCS
D3DDDIARG_CREATEDEVICE
DestroyDevice

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft