#include#include IDXGIFactory* pFactory = nullptr; HRESULT hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&pFactory);
#includeThis code starts by creating an IDXGIFactory object, then enumerating the available adapters and outputs to obtain the display modes. Finally, it uses the available display modes as needed. The package/library requirements for using IDXGIFactory are the DirectX SDK libraries, which are part of the Windows SDK. This library contains the necessary header files and compiled binaries for using DirectX, including DXGI and D3D11 interfaces.#include IDXGIFactory* pFactory = nullptr; HRESULT hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&pFactory); if (SUCCEEDED(hr)) { IDXGIAdapter* pAdapter = nullptr; hr = pFactory->EnumAdapters(0, &pAdapter); if (SUCCEEDED(hr)) { IDXGIOutput* pOutput = nullptr; hr = pAdapter->EnumOutputs(0, &pOutput); if (SUCCEEDED(hr)) { UINT numModes = 0; DXGI_MODE_DESC* pModes = nullptr; hr = pOutput->GetDisplayModeList(DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_ENUM_MODES_INTERLACED, &numModes, nullptr); if (SUCCEEDED(hr)) { pModes = new DXGI_MODE_DESC[numModes]; hr = pOutput->GetDisplayModeList(DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_ENUM_MODES_INTERLACED, &numModes, pModes); if (SUCCEEDED(hr)) { // Use display modes } } delete[] pModes; } pOutput->Release(); } pAdapter->Release(); } pFactory->Release();