On Thu Sep 15 09:38:34 2022 +0000, Rémi Bernon wrote:
I tried again on a real hardware, and the results are the same: WM_DISPLAYCHANGE has the requested bpp.
How did you test it? And what's the Windows version and GPU?
I used the following code to change the resolution. And I setup spy++ beforehand to monitor WM_DISPLAYCHANGE. I tried the test on Windows 10 21H2 and Windows 11 in VirtualBox, also Windows 10 on a real machine with an AMD Vega GPU.
`
DEVMODEW devmode;
memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); devmode.dmPelsWidth = 1024; devmode.dmPelsHeight = 768; devmode.dmBitsPerPel = 16; devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; ChangeDisplaySettingsExW(NULL, &devmode, 0, CDS_RESET, NULL);
memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &devmode, 0); printf("depth %d\n", devmode.dmBitsPerPel); `
Anyway, this seems like the opportunity to make the tests more reliable if you're going to change the code.