From ee2ccfe3f34f72728f8945e5472f8c684f2563bb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 14 Jan 2025 08:33:45 +0100 Subject: [PATCH] fixed black screen flickering when using Metal render driver on Mac --- src/libgame/sdl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 8bb732ab..e9a44036 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -205,14 +205,14 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay) } #endif - // clear render target buffer - SDL_RenderClear(sdl_renderer); - // set renderer to use target texture for rendering if (video.screen_rendering_mode == SPECIAL_RENDERING_TARGET || video.screen_rendering_mode == SPECIAL_RENDERING_DOUBLE) SDL_SetRenderTarget(sdl_renderer, sdl_texture_target); + // clear render target buffer + SDL_RenderClear(sdl_renderer); + // copy backbuffer texture to render target buffer if (video.screen_rendering_mode != SPECIAL_RENDERING_TARGET) SDL_RenderCopy(sdl_renderer, sdl_texture_stream, src_rect1, dst_rect1); -- 2.34.1