From e17048584954dc45bd938355da04f9aa3a3c10db Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 23 Jul 2019 23:11:24 +0100 Subject: [PATCH] Document a "bug" in the SDL_Texture backend --- src/Backends/Rendering/SDLTexture.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Backends/Rendering/SDLTexture.cpp b/src/Backends/Rendering/SDLTexture.cpp index f818658b..64f2d2f0 100644 --- a/src/Backends/Rendering/SDLTexture.cpp +++ b/src/Backends/Rendering/SDLTexture.cpp @@ -363,6 +363,11 @@ void Backend_UnloadGlyph(Backend_Glyph *glyph) void Backend_DrawGlyph(Backend_Surface *surface, Backend_Glyph *glyph, long x, long y, const unsigned char *colours) { + // This is actually slightly imperfect: the SDL_Texture side of things uses alpha, not a colour-key, + // so the bug where the font is blended with the colour key doesn't occur. SDL_Textures don't support + // colour-keys, so the next best thing is relying on the software fallback, but I don't like the idea + // of uploading textures to the GPU every time a glyph is drawn. + RECT rect; rect.left = 0; rect.top = 0;