From: Holger Schemel Date: Tue, 14 Jan 2025 07:33:45 +0000 (+0100) Subject: fixed black screen flickering when using Metal render driver on Mac X-Git-Tag: 4.4.0.1~17 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ee2ccfe3f34f72728f8945e5472f8c684f2563bb;p=rocksndiamonds.git fixed black screen flickering when using Metal render driver on Mac --- 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);