samleo
January 30, 2021, 1:15am
1
Hi,
some one can give me a example of how to draw a semi-transparenty rect?
I had tried like:
SDL_SetRenderDraw(Color(renderer, 255,0,0,128);
SDL_RenderFillRect(renderer);
But, the result rect is always solid.
So, I need change my render settings to fill transparenty rects? How do it?
Did you call SDL_SetRenderDrawBlendMode()
? The default mode is SDL_BLENDMODE_NONE which will result in the behavior you observed.
1 Like
samleo
January 30, 2021, 10:19pm
3
I don’t know about the blend mode, thanks.
Must I call it before fill rect or just once time after init the renderer?
I will try search for some example.
Just once (unless you need to change it subsequently).
samleo
January 30, 2021, 10:42pm
5
Ok man, thank you again, solved!
1 Like