Re: [AD] alpha blending in new GFX API

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> On the other hand, al_blit_region_3() is preferred method for alpha
> blending and it allows for src and dst color format not to match as a
> special case. Should the same be done to al_blit()?

I'd like to remove al_blit_region_3() from the API. It only really makes sense in very limited circumstances, and I think its practical usage restrictions (your draw routine must be based around it) make it somewhat difficult to use and error-prone.

The performance improvements would also only occur in limited cases (unaccelerated blending to unchached video memory).

It can be somewhat implemented on top of the existing al_select_*_bitmap() API, so I don't think it would be a great loss.


> Now, is color blending a color conversion?

No, it's not. Color blending is a RMW operation on the destination bitmap. Color conversion is just a write operation.

I've disallowing convert + blend in the general case because that would cause an explosion of little functions implementing all combinations of blending functions + color format conversions, which is simply enormous.

Now what we can do is support color format conversions and blending together at reduced performance in the general (unaccelerated) case by converting one line at a time then doing an AL_BLEND blit internally. This would limit the amount of code we'd need to write, yet still allow for this functionality.

In that later case though, we might as well allow all the other blit flags. This is extra functionality not currently supported by Allegro 4.


Milan Mimica wrote:
Elias Pschernig wrote:

Yeah, I'd assume that:

al_create_bitmap(0, display, 100, 100, AL_COLOR_8_8_8_8)


ehm, al_create_bitmap_2


choose some GL_RGBA format. (If we go by the current display idea
instead of explicit display parameters, it will use the current
display/opengl context, and no display parameters is needed.)


Yeah, seems better.


Docs for al_blit() say:
"Note however that color conversion is only available if the flags parameter is set to 0." Now, is color blending a color conversion? Is AL_BLEND allowed?

On the other hand, al_blit_region_3() is preferred method for alpha blending and it allows for src and dst color format not to match as a special case. Should the same be done to al_blit()?







Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/