D3D10CreateDeviceAndSwapChain1 function

Create a Direct3D 10.1 device and a swap chain.

Syntax

HRESULT D3D10CreateDeviceAndSwapChain1(
  IDXGIAdapter         *pAdapter,
  D3D10_DRIVER_TYPE    DriverType,
  HMODULE              Software,
  UINT                 Flags,
  D3D10_FEATURE_LEVEL1 HardwareLevel,
  UINT                 SDKVersion,
  DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
  IDXGISwapChain       **ppSwapChain,
  ID3D10Device1        **ppDevice
);

Parameters

pAdapter

Type: IDXGIAdapter*

Pointer to a IDXGIAdapter.

DriverType

Type: D3D10_DRIVER_TYPE

The type of driver for the device. See D3D10_DRIVER_TYPE.

Software

Type: HMODULE

A handle to the DLL that implements a software rasterizer. Must be NULL if DriverType is non-software. The HMODULE of a DLL can be obtained with LoadLibrary, LoadLibraryEx, or GetModuleHandle.

Flags

Type: UINT

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

HardwareLevel

Type: D3D10_FEATURE_LEVEL1

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

SDKVersion

Type: UINT

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

pSwapChainDesc

Type: DXGI_SWAP_CHAIN_DESC*

Description of the swap chain. See DXGI_SWAP_CHAIN_DESC.

ppSwapChain

Type: IDXGISwapChain**

Address of a pointer to an IDXGISwapChain.

ppDevice

Type: ID3D10Device1**

Address of a pointer to an ID3D10Device1 Interface that will receive the newly created device.

Return Value

Type: HRESULT

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

Remarks

To create a device without creating a swap chain, see D3D10CreateDevice1.

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

Note  If you call this API in a Session 0 process, it returns DXGI_ERROR_NOT_CURRENTLY_AVAILABLE.
 

Requirements

   
Target Platform Windows
Header d3d10_1.h
Library D3D10_1.lib
DLL D3D10_1.dll

See Also

Core Functions