Any way to make a transparent white primitive?
Engired

I was trying to do a simple fade in fade out sort of thing with primitives, but it looks like al_map_rgba_f(1.0, 1.0, 1.0, 0.5 (as an example)) won't blend properly. I assume there's a better blending option that would make it work, but I'm a bit concerned that it'll make the transparent parts of my bitmaps not blend properly either. Fading with black works, so I can always just do that, but I'd love it if there is a way to do it with white.

(allegro 5 by the way)

gillius

It's been awhile since I used Allegro, but my guess is it's an issue with the blending mode.

https://www.allegro.cc/manual/5/al_set_blender

It seems like you want a weighted average of the source and destination color, which starts at alpha 0 (no effect) to 1.0 (full white).

In that case I think you'd want this:
al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA)

Engired

Works exactly as I wanted it to. Thanks for the help!

Thread #618811. Printed from Allegro.cc