Results 1 to 2 of 2

Thread: DDUtil BltAlpha function

  1. #1

    DDUtil BltAlpha function

    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


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

    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.

  2. #2

    DDUtil BltAlpha function

    I haven't played around with DDUtil yet and I may be totally wrong but I guess you should write something like [pascal]MyRect := Rect(0, 0, 16, 16);
    BltAlpha(iDestX,iDestY,lpDDSSource , @MyRect, iAlpha, lwMode);[/pascal]
    to get PRect to work.
    Signature:
    <br />This is a block of text that can be added to posts you make. There is a 255 character limit

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •