You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to draw thick lines without any blending during rendering (SDL_BLENDMODE_NONE), with the intent that if my source alpha channel value is 0, then destination's alpha value should also get set to 0.
with the intent that if my source alpha channel value is 0, then destination's alpha value should also get set to 0.
That's an unusual requirement. If you are not using alpha-blending, it should not matter what the destination alpha is set to (indeed with the default render target there probably is no alpha channel!), but if you are using alpha-blending you would not normally want the destination alpha to be set to zero, since your line will then not draw if blitted to another texture.
But, the current code for thickLineRGBA (
That is not one of my additions, it's one of the original functions in Ferzkopp's SDL2_gfxPrimitives.c although it has been modified since I forked it. So perhaps you should raise the issue with the author.
My requirement is that I want to set the alpha value of the pixels along the thick line as 0 (fully transparent) even if the pixels originally had a different alpha value (say some opaque color over them).
The way I am using this is by rendering a foreground texture with transparent pixels over a background texture (with SDL_TextureBlendMode() set to SDL_BLENDMODE_BLEND for the foreground texture so that wherever transparent pixels are drawn in the foreground texture, the background texture's colors should get visible).
(More specifically, I first renderCopy the background texture on the window, then renderCopy the foreground texture on the window. The background texture remains unchanged, the foreground texture is where I want to do the thick line drawing part)
Drawing a thick line over the foreground texture which has the effect of setting alpha channel value to 0 for those pixels would make the background texture pixels underneath those foreground texture pixels visible.
Hi,
I wanted to draw thick lines without any blending during rendering (SDL_BLENDMODE_NONE), with the intent that if my source alpha channel value is 0, then destination's alpha value should also get set to 0.
But, the current code for thickLineRGBA (
BBCSDL/src/SDL2_gfxPrimitives.c
Line 4223 in 93e8399
Should I add a function that allows to draw thick lines without setting the alpha blending mode before drawing ?
Thank you.
The text was updated successfully, but these errors were encountered: