mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 08:56:25 +00:00
mac/iOS: allow Metal in windows created without an explicit backend
Fixes SDL_CreateWindowAndRenderer (and similar situations) not choosing a Metal backend. See #3991. Passing an explicit backend into CreateWindow, eg SDL_WINDOW_OPENGL or SDL_WINDOW_METAL, will still prevent the window from being used with other backend types.
This commit is contained in:

committed by
Sam Lantinga

parent
9c1871c144
commit
9b9d0d484d
@@ -1674,7 +1674,7 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
}
|
||||
|
||||
window_flags = SDL_GetWindowFlags(window);
|
||||
if (!(window_flags & (SDL_WINDOW_METAL|SDL_WINDOW_OPENGL))) {
|
||||
if (!(window_flags & SDL_WINDOW_METAL)) {
|
||||
changed_window = SDL_TRUE;
|
||||
if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_OPENGL)) | SDL_WINDOW_METAL) < 0) {
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user