Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method is used to create a Direct3D Mobile device object and obtain a pointer to an IDirect3DMobileDeviceinterface to it.

Syntax

HRESULT CreateDevice(
  UINT 
Adapter,
  D3DMDEVTYPE 
DeviceType,
  HWND 
hFocusWindow,
  ULONG 
BehaviorFlags,
  D3DMPRESENT_PARAMETERS* 
pPresentationParameters,
  IDirect3DMobileDevice** 
ppReturnedDeviceInterface
);

Parameters

Adapter

[in] A value indicting which device to provide information for. For possible values, see D3DMADAPTER Values.

DeviceType

[in] A D3DMDEVTYPEenumeration value that specifies the type of device.

hFocusWindow

[in] An HWND value that is a handle to the window that will be the focus for Direct3D Mobile operations. This window remains the focus until the device object is destroyed. This can only be a window without a parent window.

BehaviorFlags

[in] A ULONG value to control the multithreading behavior of the device. To enable multithreading support, set this value to D3DMCREATE_MULTITHREADED.

pPresentationParameters

[in] A pointer to a D3DMPRESENT_PARAMETERSstructure describing the properties of the swap that is implicitly created when the device is created.

ppReturnedDeviceInterface

[out] A pointer to the IDirect3DMobileDevicepointer for the device.

Return Value

If the device was created successfully, this method returns D3DM_OK. If the device was not created successfully, it returns one of the following error values:

  • D3DMERR_INVALIDCALL

  • D3DMERR_INVALIDDEVICE

  • D3DMERR_NOTAVAILABLE

  • E_OUTOFMEMORY

For more information, see D3DMERR Values.

Requirements

Header d3dm.h
Library D3dm.lib, D3dmguid.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also