From: Holger Schemel Date: Sun, 19 Jan 2025 18:34:50 +0000 (+0100) Subject: fixed clearing touch buttons in off-screen areas on Android X-Git-Tag: 4.4.0.2~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=fadcf529551b121c4a2daa1e040176b8c71237a8;p=rocksndiamonds.git fixed clearing touch buttons in off-screen areas on Android --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index e9a44036..65461671 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -205,13 +205,20 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay) } #endif +#if defined(PLATFORM_ANDROID) + // clear render target (complete window on Android to clear off-screen areas with touch buttons) + SDL_RenderClear(sdl_renderer); +#endif + // 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 +#if !defined(PLATFORM_ANDROID) + // clear render target (target texture only to prevent black flickering when using Metal on Mac) SDL_RenderClear(sdl_renderer); +#endif // copy backbuffer texture to render target buffer if (video.screen_rendering_mode != SPECIAL_RENDERING_TARGET)