PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Another AlphaBlt question

When blitting to a surface using the AlphaBltFast function, is it possible to have it replace the destination surface instead of "merging" the result of the blit between the source and alpha bitmap?

I currently fillrect the area where the blit will be placed on the destination surface, but it would be useful to have a flag or some other way to have AlphaBlt replace the background with the blit result.

Eric Fortier
Hi! Did you remove your previous post? I was just about to answer it. :) Basically you got it right, you would just have to use a black surface as source.

I believe what you are looking for is key source on the destination surface. This can be avoided in all cases by drawing in a different Z-order, which is one of the reasons it is not included in GapiDraw.

/Johan
sbl wrote:Hi! Did you remove your previous post? I was just about to answer it. :) Basically you got it right, you would just have to use a black surface as source.

Yes, I found out that I had to set the source surface to the ship...

This was my first try ever at Alpha blending in 2D, so I was a running in circles a bit there.

Thanks!