2

How can I get the current display mode in DirectX 11, including the refresh rate.

In DX9 there was GetAdapterDisplayMode(). As far as DX11 is concerned I can only see DXGIOutput::GetDesc() but the DXGI_OUPUT_DESC structure does not contain any information about refresh rate.

jossgray
  • 497
  • 6
  • 20
  • Well, DirectX 9 hasn't gone anywhere, so you could just use that. Otherwise this question address your problem: http://stackoverflow.com/questions/15583294/how-to-get-current-display-mode-resolution-refresh-rate-of-a-monitor-output-i – Ross Ridge Jul 18 '14 at 20:46
  • I can't use DX9 because in DX9 refresh rates are treated as unsigned integers, in DX11 they are floating point numbers. – jossgray Jul 21 '14 at 10:04

1 Answers1

0

You can call IDXGIOutput::GetDisplayModeList() to get DXGI_MODE_DESC*.

Then, DXGI_MODE_DESC has RefreshRate member.

Jiho Choi
  • 119
  • 1
  • 8
  • But how can I tell which DXGI_MODE_DESC is the correct one? – jossgray Jul 18 '14 at 10:52
  • You can find the one that matches your desired(or desktop's) width/height. You can refer to this link. http://www.rastertek.com/dx11tut03.html – Jiho Choi Jul 18 '14 at 11:24
  • 3
    In some cases there are multiple modes with the same resolution but different refresh rates. – jossgray Jul 18 '14 at 14:17
  • You can check this question: http://stackoverflow.com/questions/18844654/how-to-find-out-real-screen-refresh-rate-not-the-rounded-number – Jiho Choi Jul 20 '14 at 22:45