From 3f9c4b887f37e865afda0058d52fb27af19d88ce Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 5 Nov 2024 13:06:32 +0100 Subject: [PATCH] Apareixia brossa en la textura al crear un text i no netejarla primer (en el windows de la faena) --- source/text.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/text.cpp b/source/text.cpp index 473d123..dfef3d3 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -164,6 +164,8 @@ std::shared_ptr Text::writeToTexture(const std::string &text, int zoom, texture->createBlank(width, height, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET); texture->setBlendMode(SDL_BLENDMODE_BLEND); texture->setAsRenderTarget(renderer); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); + SDL_RenderClear(renderer); zoom == 1 ? write(0, 0, text, kerning) : write2X(0, 0, text, kerning); return texture;