Commit 3044310518dbb2d4814b32c6521f332b8d69aae5

Ryan C. Gordon 2022-01-26T21:10:15

video: Don't add SDL_WINDOW_METAL to new windows if not using Cocoa or UIKit. Fixes #4656.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index b0a7058..e5dbf58 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -1595,7 +1595,9 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
         flags |= SDL_WINDOW_OPENGL;
 #endif
 #if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOSX__ || __IPHONEOS__)
-        flags |= SDL_WINDOW_METAL;
+        if ((SDL_strcmp(_this->name, "cocoa") == 0) || (SDL_strcmp(_this->name, "uikit") == 0)) {
+            flags |= SDL_WINDOW_METAL;
+        }
 #endif
     }