当前位置:编程学习 > C/C++ >>

Introdution to 3D Game Programming With DirectX11

    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;


 

You can use CheckInte易做图ceSupport only to check whether a Direct3D 10.x inte易做图ce is supported, and only on Windows Vista SP1 and later versions of the operating system. If you try to use CheckInte易做图ceSupport to check whether a Direct3D 11.x and later version inte易做图ce is supported, CheckInte易做图ceSupport returns DXGI_ERROR_UNSUPPORTED. Therefore, do not use CheckInte易做图ceSupport.
IDXGIOutput* pOutput = NULL; 
HRESULT hr;

hr = pAdapter->EnumOutputs(0,&pOutput);

 

补充:软件开发 , C++ ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,