libsdl-org / SDL-1.2

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!
https://libsdl.org
GNU Lesser General Public License v2.1
98 stars 81 forks source link

[WINDIB vs. Windows 8+] SDL_SetVideoMode fails (freezes) #856

Closed pionere closed 2 years ago

pionere commented 2 years ago

Calling SDL_SetVideoMode with (640, 480, 0, SDL_FULLSCREEN) freezes the application on Windows 8.1 with windib video driver.

The reason is ChangeDisplaySettingsA does not return on line 763 in SDL_dibvideo.c . Tried add CDS_TEST to the flags and that seems to work, but as soon as the display would be changed the function does not return. Without SDL_FULLSCREEN the application runs just fine too.

According to Microsoft, the minimum resolution of the applications is 1024x768 from Windows 8+. It seems that they forgot to update ChangeDisplaySettingsA to reflect on this new requirement.

Apparently they dropped this requirement in Windows 10...

pionere commented 2 years ago
After some investigation I found the followings. There seems to be a minimum required resolution for each windows version (wiki): Version Resolution
Windows XP, Vista 800x600 ?
Windows 7, 8, 8.1 1024x768 ?
Windows 10 800x600
Windows 11 1280x720

EnumDisplaySettings still reports valid resolutions from 320x200. ChangeDisplaySettings(Ex) reports DISP_CHANGE_SUCCESSFUL for resolutions from 320x200 (Probably uses EnumDisplaySettings) if run with CDS_TEST. ChangeDisplaySettings freezes when trying to set resolution to 640x480. The lowest available resolution is 1024x768 in the Control Panel on my system (Windows 8.1)

sezero commented 2 years ago

@icculus, @slouken: Anything to do with this?

slouken commented 2 years ago

Is this an issue with sdl12-compat?

pionere commented 2 years ago

No, sdl1.2. SDL2 works fine with d3d.

slouken commented 2 years ago

I recommend you use SDL12-compat, which will be future proof against these kinds of issues. @icculus is working on creating an official release which will be a drop-in replacement for SDL 1.2.