PDA

View Full Version : DDUtil BltAlpha function



aweeks
08-07-2003, 05:03 AM
Hello everyone,

I'm trying to use the BltAlpha function of the TDisplay class found in DDUtil (the most recent version that I know of). I have Blt working just fine to draw a TSurface onto the TDisplay no problem, and it seemed like it would have taken a couple modifications to get the other to work, but no luck.

For the sake of reference, here is the function header for BltAlpha



function TDisplay.BltAlpha( iDestX, iDestY : integer; lpDDSSource : TSurface; lprcSource : PRECT; iAlpha : Byte;
lwMode : TRGBMode ) : HResult;


Okay, I know what iDestX and iDestY do; lpDDSSource would be the surface I want to draw. I think I can figure out the lwMode (I'm running in 16 bit, so I should need to use rgbm16, rgbm555, or rgbm565 - I'm planning to rely on trial and error for that part). The two before lwmode are what I have a problem with.

First, I can't seem to figure out how to declare an appropriate PRect. I can't seem to declare a Rect for a PRect in the same manner as I would a TRect (eg MyRect := Rect(0,0,16,16);), and typecasting doesn't help. I've tossed some pointer and reference symbols around with no positive results. Passing nil makes the program work, but the image doesn't show up.

Second, since I haven't gotten it to work in general, I can't mess around with Alpha. But I am assuming that 0 means no visibility, and 255 represents opaque. Would that be correct?

Thanks for any help that anyone could give me. I figure my problem lies in the whole PRect thing, but you never know.

Ultra
08-07-2003, 12:04 PM
I haven't played around with DDUtil yet and I may be totally wrong but I guess you should write something like MyRect := Rect(0, 0, 16, 16);
BltAlpha(iDestX,iDestY,lpDDSSource , @MyRect, iAlpha, lwMode);
to get PRect to work.