Implements methods for generating DXGI objects.
This interface includes methods to create a newer version swap chain with more features than IDXGISwapChain and to monitor stereoscopic 3D capabilities.
interface IDXGIFactory2 : public IDXGIFactory1
To create a Microsoft DirectX Graphics Infrastructure (DXGI) 1.2 factory interface, pass IDXGIFactory2 into CreateDXGIFactory (desktop only) or CreateDXGIFactory1 (desktop only), or call QueryInterface from a factory object that either CreateDXGIFactory or CreateDXGIFactory1 returns.
Because you can create a Direct3D device without creating a swap chain, you might need to retrieve the factory that is used to create the device in order to create a swap chain. You can request the IDXGIDevice, IDXGIDevice1, or IDXGIDevice2 interface from the Direct3D device and then use the IDXGIObject::GetParent method to locate the factory. The following code shows how.
IDXGIDevice2 * pDXGIDevice;
hr = g_pd3dDevice->QueryInterface(__uuidof(IDXGIDevice2), (void **)&pDXGIDevice);
IDXGIAdapter * pDXGIAdapter;
hr = pDXGIDevice->GetParent(__uuidof(IDXGIAdapter), (void **)&pDXGIAdapter);
IDXGIFactory2 * pIDXGIFactory;
pDXGIAdapter->GetParent(__uuidof(IDXGIFactory2), (void **)&pIDXGIFactory);
Header: Declared in d3d11_x.h (dxgi1_2.h on other Windows platforms).
Library: Use d3d11_x.lib (dxgi.lib on other Windows platforms).