Просмотр исходного кода

Make sure the current resolution is in the fullscreen mode list

Custom resolutions don't enumerate normally, but make sure the current resolution is in the mode list.

Fixes https://github.com/libsdl-org/SDL/issues/11551
Sam Lantinga 11 месяцев назад
Родитель
Сommit
b1c2dd8433
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/video/windows/SDL_windowsmodes.c

+ 2 - 1
src/video/windows/SDL_windowsmodes.c

@@ -783,7 +783,8 @@ bool WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
 
 
     dxgi_output = WIN_GetDXGIOutput(_this, data->DeviceName);
     dxgi_output = WIN_GetDXGIOutput(_this, data->DeviceName);
 
 
-    for (i = 0;; ++i) {
+    // Make sure we add the current mode to the list in case it's a custom mode that doesn't enumerate
+    for (i = ENUM_CURRENT_SETTINGS; ; ++i) {
         if (!WIN_GetDisplayMode(_this, dxgi_output, data->MonitorHandle, data->DeviceName, i, &mode, NULL, NULL)) {
         if (!WIN_GetDisplayMode(_this, dxgi_output, data->MonitorHandle, data->DeviceName, i, &mode, NULL, NULL)) {
             break;
             break;
         }
         }