HRESULT hr; IDXGIFactory* pFactory; hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&pFactory)); IDXGIAdapter* pAdapter; hr = pFactory->EnumAdapters(0, &pAdapter); DXGI_ADAPTER_DESC adapterDesc; hr = pAdapter->GetDesc(&adapterDesc);
HRESULT hr; IDXGIFactory* pFactory; hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&pFactory)); IDXGIAdapter* pAdapter; hr = pFactory->EnumAdapters(0, &pAdapter); DXGI_ADAPTER_DESC adapterDesc; hr = pAdapter->GetDesc(&adapterDesc); std::cout << "Vendor ID: " << std::hex << adapterDesc.VendorId << std::endl; std::cout << "Device ID: " << std::hex << adapterDesc.DeviceId << std::endl; std::cout << "Dedicated video memory: " << (adapterDesc.DedicatedVideoMemory / (1024*1024)) << " MB" << std::endl; std::cout << "Shared system memory: " << (adapterDesc.SharedSystemMemory / (1024*1024)) << " MB" << std::endl; std::cout << "Description: " << adapterDesc.Description << std::endl;In this example, we retrieve the adapter description and display some of its properties, such as the vendor ID, device ID, and memory information. The package library for IDXGIAdapter GetDesc is DXGI.lib.