1.
HR(dxgiFactory->MakeWindowAssociation(mhMainWnd, DXGI_MWA_NO_WINDOW_CHANGES));
2.
IDXGIAdapter * pAdapter;
std::vector <IDXGIAdapter*> vAdapters;
IDXGIFactory* pFactory = NULL;
// Create a DXGIFactory object.
if(FAILED(CreateDXGIFactory(__uuidof(IDXGIFactory) ,(void**)&pFactory)))
{
return vAdapters;
}
for ( UINT i = 0;
pFactory->EnumAdapters(i, &pAdapter) != DXGI_ERROR_NOT_FOUND;
++i )
{
vAdapters.push_back(pAdapter);
}
if(pFactory)
{
pFactory->Release();
}
return vAdapters;
3.
You can use CheckInterfaceSupport only to check whether a Direct3D 10.x interface is supported, and only on Windows Vista SP1 and later versions of the operating system. If you try to use CheckInterfaceSupport to check whether a Direct3D 11.x and later version interface is supported, CheckInterfaceSupport returns DXGI_ERROR_UNSUPPORTED. Therefore, do not use CheckInterfaceSupport.
4.
for (int i = 0; dxgiAdapter->EnumOutputs(i,&pOutput)!=DXGI_ERROR_NOT_FOUND; i++)
5.
IDXGIOutput* pOutput = NULL;
dxgiAdapter->EnumOutputs(0,&pOutput);
UINT numModes = 0;
DXGI_MODE_DESC* displayModes = NULL;
DXGI_FORMAT format = DXGI_FORMAT_R32G32B32A32_FLOAT;
// Get the number of elements
hr = pOutput->GetDisplayModeList( format, 0, &numModes, NULL);
displayModes = new DXGI_MODE_DESC[numModes];
// Get the list
hr = pOutput->GetDisplayModeList( format, 0, &numModes, displayModes);