mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
SDL Renderer: specify the correct flag when recreating the window
This commit is contained in:
parent
035f8f2391
commit
754286c61c
@ -1640,7 +1640,7 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
window_flags = SDL_GetWindowFlags(window);
|
||||
if (!(window_flags & SDL_WINDOW_METAL)) {
|
||||
changed_window = SDL_TRUE;
|
||||
if (SDL_RecreateWindow(window, (window_flags & ~SDL_WINDOW_OPENGL) | SDL_WINDOW_METAL) < 0) {
|
||||
if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_OPENGL)) | SDL_WINDOW_METAL) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1545,7 +1545,7 @@ GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture)
|
||||
}
|
||||
|
||||
|
||||
SDL_Renderer *
|
||||
static SDL_Renderer *
|
||||
GL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
@ -1568,7 +1568,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, RENDERER_CONTEXT_MAJOR);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, RENDERER_CONTEXT_MINOR);
|
||||
|
||||
if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
|
||||
if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)) | SDL_WINDOW_OPENGL) < 0) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
@ -1165,7 +1165,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, RENDERER_CONTEXT_MAJOR);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, RENDERER_CONTEXT_MINOR);
|
||||
|
||||
if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
|
||||
if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)) | SDL_WINDOW_OPENGL) < 0) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
@ -2012,7 +2012,7 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, RENDERER_CONTEXT_MAJOR);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, RENDERER_CONTEXT_MINOR);
|
||||
|
||||
if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
|
||||
if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)) | SDL_WINDOW_OPENGL) < 0) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user