I show 2 triangles with png textures RGBA, it works without alpha activated.
But, when i activate alpha with
My all screen become black. But alpha works without texturing.
Someone can help me please ? Thanks
Most probably you do not fill the A of your texture properly the the bendfunc you use.
0.0 means completely transparent, 1.0 (or 255) means opaque.
Quick fix could be to use this instead :
Thanks, but with
alpha is replaced by a black color.
i tried with
it works for alpha, but all pixels are transformed, like this : a green pixel from texture_1 is transformed into a light blue pixel when it’s over the blue pixel from texture_0.
The problem was from SDL_CreateRGBSurface( … );
to direct copy blits :
SDL_CreateRGBSurface( … );
This allows all the alpha values from the source surface to be copied to the destination surface during blitting.