In SDL engine force display rendering when brightness texture is changed

pull/79/head
Silvano Seva 2022-06-09 22:19:06 +02:00
rodzic 980fa32e73
commit 763eb0c2be
1 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -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;
}