IDirect3D9Ex::CreateDeviceEx 

IDirect3D9Ex::CreateDeviceEx

Creates a device to represent the display adapter.

  HRESULT 
  CreateDeviceEx(
  UINT Adapter,
  D3DDEVTYPE DeviceType,
  HWND hFocusWindow,
  DWORD BehaviorFlags,
  D3DPRESENT_PARAMETERS* pPresentationParameters,
  D3DDISPLAYMODEEX* pFullscreenDisplayMode,
  IDirect3DDevice9Ex** ppReturnedDeviceInterface
);

Parameters

  • Adapter
    Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.
  • DeviceType
    Member of the D3DDEVTYPE enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. See D3DDEVTYPE.
  • hFocusWindow
    The focus window alerts Direct3D when an application switches from foreground mode to background mode.
  • BehaviorFlags
    Combination of one or more options that control device creation. For more information, see D3DCREATE.
  • pPresentationParameters
    [in, out] Pointer to a D3DPRESENT_PARAMETERS structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies D3DCREATE_ADAPTERGROUP_DEVICE, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. See D3DPRESENT_PARAMETERS.
  • pFullscreenDisplayMode
    [in, out] The display mode for when the device is set to fullscreen. See D3DDISPLAYMODEEX.
  • ppReturnedDeviceInterface
    [out, retval] Address of a pointer to the returned IDirect3DDevice9Ex Interface, which represents the created device.

Return Values

This method returns S_OK when rendering device along with swapchain buffers are created successfully. D3DERR_DEVICELOST is returned when any error other than invalid caller input is encountered.

See Also

IDirect3D9Ex Interface