sdl2-compat: Don't pass removed flags to SDL_CreateRenderer()

From 9e6b1962cbc72678c4c2fa8283626bbb48964a21 Mon Sep 17 00:00:00 2001
From: Mathieu Eyraud <[EMAIL REDACTED]>
Date: Sat, 29 Jul 2023 13:10:28 +0200
Subject: [PATCH] Don't pass removed flags to SDL_CreateRenderer()

SDL2_RENDERER_TARGETTEXTURE was removed in https://github.com/libsdl-org/SDL/commit/dcd17f547324a143d66d79e3b586577a7da558ed
---
 src/sdl2_compat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 18f11da..d43bc07 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -3246,6 +3246,7 @@ SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags)
             return NULL;  /* assume SDL3_GetRenderDriver set the SDL error. */
         }
     }
+    flags = flags & ~SDL2_RENDERER_TARGETTEXTURE; /* clear flags removed in SDL3 */
     return SDL3_CreateRenderer(window, name, flags);
 }