SDL_Renderer does not respect alpha when drawing geometry to a transparent window.
I'm creating a music visualizer with SDL 3.4.14 but the transparency doesn't work as intended.
This is my full rendering code: https://github.com/RedGreenBlue09/MusicBars/blob/deb505d4951c82ccef661cce3658a34644e7ea6c/Source/Render/Legacy.c#L91
With SDL_BLENDMODE_NONE, I expected all new pixels rendered on the canvas to replace the old ones, including the alpha channel. This works fine with SDL_RenderClear() but doesn't for the draw line/rectangle functions. For these, it draws opaque geometry.
I tried changing the rendering driver to opengl, vulkan, direct3d, software and tested on both Windows & Linux but the situation is the same.
If I render everything on a texture then render the texture afterwards, sometimes it renders the alpha correctly for something like 0.5 seconds before snapping back to opaque, and that's very hard to reproduce. Changing other programs' windows behind it seem to affect this alpha behavior (once I've seen the bars with transparency on top of another window while being opaque on others, simultaneously).
Source: libsdl-org/SDL