nanogui: Alpha blending using Nano-X APIs
Subject:
Re: [nanogui] Alpha blending using Nano-X APIs
From:
Alan Chuang ####@####.####
Date:
7 Jun 2005 17:08:12 +0100
Message-Id: <f295c63305060709073737eb16@mail.gmail.com>
Hi Greg,
Thanks for the tip. I need to digest your suggestions a bit more.
Looks like I need to study the malpha.c a bit more.
Alan
On 6/7/05, Greg Haerr ####@####.#### wrote:
> > I am trying to test alpha-blending using Nano-X APIs. The malpha
> demo program is based upon win32 API. The sprite.c file has reference
> to GrNewAlpha function, but I can't find it anywhere.
>
> The GrNewAlpha function has been removed, it was originally
> used to set the ARGB "A" value before we allowed the values to
> be specified directly as ARGB.
>
> In any case, neither nano-X nor win32 APIs actually support
> software alpha blending at this time. There is support for
> hardware alpha blending using ARGB specifications.
>
> The win32 malpha.c program uses a very tricky subset case where
> a window can be alpha blended with another. The basic idea,
> from the WM_PAINT section of malpha.c follows, and would
> have to be duplicated using the nano-X API (but won't work in
> every case since we can't force window repaint based on z-order
> in nano-X):
>
> 1. repaint (refresh) all lower windows. This doesn't need to
> occur on the first alpha blend, but would need to if updating
> a blended window afterwords...
>
> 2. queue repaint for higher windows (delayed until after our drawing)
>
> 3. paint current window contents to offscreen pixmap
>
> 4. blend offscreen pixmap with root window using Blit function,
> MWROP_BLENDCONSTANT.
>
> Regards,
>
> Greg
>