mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-05 18:24:33 +00:00
Prefer display modes that exactly match the desired format or refresh rate
This commit is contained in:
committed by
Sam Lantinga
parent
596096a86a
commit
6c6b497f89
@@ -994,7 +994,7 @@ static SDL_DisplayMode *SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay *di
|
|||||||
match = current;
|
match = current;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (current->format != match->format) {
|
if (current->format != match->format && match->format != target_format) {
|
||||||
/* Sorted highest depth to lowest */
|
/* Sorted highest depth to lowest */
|
||||||
if (current->format == target_format ||
|
if (current->format == target_format ||
|
||||||
(SDL_BITSPERPIXEL(current->format) >=
|
(SDL_BITSPERPIXEL(current->format) >=
|
||||||
@@ -1005,7 +1005,7 @@ static SDL_DisplayMode *SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay *di
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (current->refresh_rate != match->refresh_rate) {
|
if (current->refresh_rate != match->refresh_rate && match->refresh_rate != target_refresh_rate) {
|
||||||
/* Sorted highest refresh to lowest */
|
/* Sorted highest refresh to lowest */
|
||||||
if (current->refresh_rate >= target_refresh_rate) {
|
if (current->refresh_rate >= target_refresh_rate) {
|
||||||
match = current;
|
match = current;
|
||||||
|
|||||||
Reference in New Issue
Block a user