Does FrameBuffer.clear(new Color(0, 0, 0, 0)) ignore its alpha value?

Started by AGP, April 19, 2010, 04:22:54 PM

Previous topic - Next topic

AGP

I'm trying to write a widget whose background is transparent and, to do so, I need to be able to set the pixels alpha values. Since the transparency isn't working, I'm starting to question whether the FrameBuffer ignores its alpha value. Please help, Egon, I really need this to work!

EgonOlsen

Yes, it ignores it. I never saw a reason to clear with alpha, but i've already changed that for jPCT-AE on request and now for "desktop" jPCT too. Get the latest beta here: http://www.jpct.net/download/beta/jpct.jar and see if this helps.

Just to be sure: We are talking about the hardware renderer here? Because if not, then this is a different story...

AGP


EgonOlsen


AGP

Oh, I thought there was a big reason behind it. :- )

Anyway, if you needed a reason to implement it, this is a big one: http://java.sun.com/docs/books/tutorial/uiswing/misc/trans_shaped_windows.html

raft

i suppose it's partially supported by SW renderer. see Config.useFramebufferWithAlpha

combining it with a semi transparent background, you can have effects like below. or combine with a semi transparent frame like in the link you posted..

AGP

Thanks for the suggestion. But now I can't seem to clear the screen anymore. I've even tried clear() with no color arguments, but when I turn off Config.useFramebufferWithAlpha, clearing works again.

EgonOlsen

I forgot about this setting...so yes, software supports it too. It even applies a colors alpha value when clearing just like hardware mode does.

@AGP: I don't really understand which renderer you need this for, because you seemed to be happy with the change for the hardware renderer but say that useFramebufferWithAlpha disables clearing, which it can't do with hardware, because it has no effect on it!?

AGP

I'm happy to have either, but I would lilke for it to work for me in software as well (for compatibility reasons).