Introdution to 3D Game Programming With DirectX11 第4章 练习题解答
Introdution to 3D Game Programming With DirectX11 第4章 习题解答
2:
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:
IDXGIOutput* pOutput = NULL; HRESULT hr; hr = pAdapter->EnumOutputs(0,&pOutput);