Introdution to 3D Game Programming With DirectX11 第4章 习题解答

来源:互联网 发布:php 异步post请求 编辑:程序博客网 时间:2024/06/06 03:46

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 elementshr = pOutput->GetDisplayModeList( format, 0, &numModes, NULL);displayModes = new DXGI_MODE_DESC[numModes]; // Get the listhr = pOutput->GetDisplayModeList( format, 0, &numModes, displayModes);


0 0
原创粉丝点击