Skip to content

Instantly share code, notes, and snippets.

@Joshua-Ashton
Created November 27, 2019 16:13
Show Gist options
  • Save Joshua-Ashton/51bd7ba33741e730a7623136a65c0b0b to your computer and use it in GitHub Desktop.
Save Joshua-Ashton/51bd7ba33741e730a7623136a65c0b0b to your computer and use it in GitHub Desktop.
D3DDISPLAYMODEEX mode;
mode.Size = sizeof(D3DDISPLAYMODEEX);
mode.Width = devMode.dmPelsWidth;
mode.Height = devMode.dmPelsHeight;
mode.RefreshRate = 0;
mode.Format = static_cast<D3DFORMAT>(Format);
mode.ScanLineOrdering = D3DSCANLINEORDERING_UNKNOWN;
if (devMode.dmFields & DM_DISPLAYFLAGS) {
mode.ScanLineOrdering = (devMode.dmDisplayFlags & DM_INTERLACED)
? D3DSCANLINEORDERING_INTERLACED
: D3DSCANLINEORDERING_PROGRESSIVE;
}
if (devMode.dmFields & DM_DISPLAYFREQUENCY)
mode.RefreshRate = devMode.dmDisplayFrequency;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment