Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
Direct3D Reference
Core Reference
Core Functions
 D3D10CreateDevice1 function
D3D10CreateDevice1 function

Applies to: desktop apps only

Create a Direct3D 10.1 device that represents the display adapter.

Syntax

HRESULT D3D10CreateDevice1(
  __in   IDXGIAdapter *pAdapter,
  __in   D3D10_DRIVER_TYPE DriverType,
  __in   HMODULE Software,
  __in   UINT Flags,
  __in   D3D10_FEATURE_LEVEL1 HardwareLevel,
  __in   UINT SDKVersion,
  __out  ID3D10Device1 **ppDevice
);

Parameters

pAdapter [in]

Type: IDXGIAdapter*

Pointer to the display adapter (see IDXGIAdapter) when creating a hardware device; otherwise set this parameter to NULL. If NULL is specified when creating a hardware device, Direct3D will use the first adapter enumerated by EnumAdapters.

DriverType [in]

Type: D3D10_DRIVER_TYPE

The device-driver type (see D3D10_DRIVER_TYPE). The driver type determines the type of device you will create.

Software [in]

Type: HMODULE

This is set to NULL except for D3D10_DRIVER_TYPE_SOFTWARE driver types.

Flags [in]

Type: UINT

Optional. Device creation flags (see D3D10_CREATE_DEVICE_FLAG) that enable API layers. These flags can be bitwise OR'd together.

HardwareLevel [in]

Type: D3D10_FEATURE_LEVEL1

The version of hardware that is available for acceleration (see D3D10_FEATURE_LEVEL1).

SDKVersion [in]

Type: UINT

Bit flag that indicates the version of the SDK. Should be D3D10_1_SDK_VERSION, defined in D3D10.h.

ppDevice [out]

Type: ID3D10Device1**

Address of a pointer to the device created (see ID3D10Device1 Interface).

Return value

Type: HRESULT

This method returns one of the following Direct3D 10 Return Codes.

Remarks

To create a device and a swap chain at the same time, see D3D10CreateDeviceAndSwapChain1.

This method requires Windows Vista Service Pack 1, Windows Server 2008, or later release of Windows.

The object returned by D3D10CreateDevice1 implements the IUnknown interface and can be queried for other interfaces the object supports. To retrieve the IDXGIDevice interface of the object the following code could be used.


IDXGIDevice * pDXGIDevice;
hr = g_pd3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void **)&pDXGIDevice);
      

Requirements

Header

D3D10_1.h

Library

D3D10_1.dll

See also

Core Functions

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker