forked from libsdl-org/sdl2-compat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mode switching due to information loss when casting the mode struct
When entering exclusive fullscreen, SDL3 verifies that the requested mode parameters precisely match a mode exposed by the output, which can cause the mode switch to fail due to the float to int rounding of the refresh rate when converting between the SDL2 and SDL3 mode structs. Instead of casting directly, use the SDL2 mode parameters to try and find the closest matching SDL3 display mode. This fixes video mode switching for modes with refresh rates that are not precisely an integer, and allows for the removal of the DisplayMode_2to3() function entirely.
- Loading branch information
1 parent
a305041
commit b64bdb1
Showing
1 changed file
with
18 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters