SDL Renderer: specify the correct flag when recreating the window
authorSylvain Becker
Wed, 02 Dec 2020 13:45:24 +0100
changeset 14425ea78516f975b
parent 14424 72d20b450b80
child 14426 b9517431b4e1
SDL Renderer: specify the correct flag when recreating the window
src/render/metal/SDL_render_metal.m
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
     1.1 --- a/src/render/metal/SDL_render_metal.m	Wed Dec 02 13:37:59 2020 +0100
     1.2 +++ b/src/render/metal/SDL_render_metal.m	Wed Dec 02 13:45:24 2020 +0100
     1.3 @@ -1640,7 +1640,7 @@
     1.4      window_flags = SDL_GetWindowFlags(window);
     1.5      if (!(window_flags & SDL_WINDOW_METAL)) {
     1.6          changed_window = SDL_TRUE;
     1.7 -        if (SDL_RecreateWindow(window, (window_flags & ~SDL_WINDOW_OPENGL) | SDL_WINDOW_METAL) < 0) {
     1.8 +        if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_OPENGL)) | SDL_WINDOW_METAL) < 0) {
     1.9              return NULL;
    1.10          }
    1.11      }
     2.1 --- a/src/render/opengl/SDL_render_gl.c	Wed Dec 02 13:37:59 2020 +0100
     2.2 +++ b/src/render/opengl/SDL_render_gl.c	Wed Dec 02 13:45:24 2020 +0100
     2.3 @@ -1545,7 +1545,7 @@
     2.4  }
     2.5  
     2.6  
     2.7 -SDL_Renderer *
     2.8 +static SDL_Renderer *
     2.9  GL_CreateRenderer(SDL_Window * window, Uint32 flags)
    2.10  {
    2.11      SDL_Renderer *renderer;
    2.12 @@ -1568,7 +1568,7 @@
    2.13          SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, RENDERER_CONTEXT_MAJOR);
    2.14          SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, RENDERER_CONTEXT_MINOR);
    2.15  
    2.16 -        if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
    2.17 +        if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)) | SDL_WINDOW_OPENGL) < 0) {
    2.18              goto error;
    2.19          }
    2.20      }
     3.1 --- a/src/render/opengles/SDL_render_gles.c	Wed Dec 02 13:37:59 2020 +0100
     3.2 +++ b/src/render/opengles/SDL_render_gles.c	Wed Dec 02 13:45:24 2020 +0100
     3.3 @@ -1165,7 +1165,7 @@
     3.4          SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, RENDERER_CONTEXT_MAJOR);
     3.5          SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, RENDERER_CONTEXT_MINOR);
     3.6  
     3.7 -        if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
     3.8 +        if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)) | SDL_WINDOW_OPENGL) < 0) {
     3.9              goto error;
    3.10          }
    3.11      }
     4.1 --- a/src/render/opengles2/SDL_render_gles2.c	Wed Dec 02 13:37:59 2020 +0100
     4.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Wed Dec 02 13:45:24 2020 +0100
     4.3 @@ -2012,7 +2012,7 @@
     4.4          SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, RENDERER_CONTEXT_MAJOR);
     4.5          SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, RENDERER_CONTEXT_MINOR);
     4.6  
     4.7 -        if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
     4.8 +        if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)) | SDL_WINDOW_OPENGL) < 0) {
     4.9              goto error;
    4.10          }
    4.11      }