I'm using EnumDisplaySettings
to try to get all the resolutions supported by the user's monitor, but users with ultrawide monitors are reporting that the native resolution is not being listed.
(The code is using some Unreal-specific containers but this should work on any Windows setup)
TArray<FIntPoint> GetResolutionsForDisplayDevice( DISPLAY_DEVICE& dd )
{
TArray<FIntPoint> resolutions;
DEVMODE dm = { 0 };
dm.dmSize = sizeof( DEVMODE );
dm.dmDriverExtra = 0;
for ( uint32 i = 0; EnumDisplaySettings( dd.DeviceName, i, &dm ) != 0; i++ )
{
resolutions.AddUnique( FIntPoint( dm.dmPelsWidth, dm.dmPelsHeight ) );
}
return resolutions;
}
For example this code when run on a computer with one monitor, with a native resolution of 5120x1440, it lists a bunch of resolutions but the largest one is 3840x1080.