From 763eb0c2be6ae3bb55c4080c36668a7c8e4756eb Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Thu, 9 Jun 2022 22:19:06 +0200 Subject: [PATCH] In SDL engine force display rendering when brightness texture is changed --- platform/targets/linux/emulator/sdl_engine.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/targets/linux/emulator/sdl_engine.c b/platform/targets/linux/emulator/sdl_engine.c index 87717405..dafca67d 100644 --- a/platform/targets/linux/emulator/sdl_engine.c +++ b/platform/targets/linux/emulator/sdl_engine.c @@ -259,10 +259,15 @@ static bool set_brightness(uint8_t brightness) * Color modulation is not always supported by the renderer; * it will return -1 if color modulation is not supported. */ - return SDL_SetTextureColorMod(displayTexture, - brightness, - brightness, - brightness) == 0; + int colMod = SDL_SetTextureColorMod(displayTexture, + brightness, + brightness, + brightness) == 0; + + SDL_RenderCopy(renderer, displayTexture, NULL, NULL); + SDL_RenderPresent(renderer); + + return colMod; }