After some back and forth with Alex from ParaGUI there seems to be a
problem with alpha blended surfaces blitted onto a GL window.
My problem is that a label created in paragui apparently uses an alpha
blended surface and this one does not show up in the GL window when
blitted. Alex says this is a bug/problem in SDL and I have not seen any
postings on this here.
So is this new, or is anyone already working on this? Is this solvable?
Sorry if this is a FAQ, but as said - I haven’t seen this one before on
the list.
Maybe this explains the problem that Scott Russell wrote about yesterday.
I have a test script using paragui. Alex hacked the latest paragui (cvs)
to not use alpha blended surfaces for labels, so you will need the 0.6.3
from his homepage.
The problem:
Button shows up fine
label does not show at all
radiobutton - button shows up and text when moving mouse over it
I have a test script using paragui. Alex hacked the latest paragui (cvs)
to not use alpha blended surfaces for labels, so you will need the 0.6.3
from his homepage.
The problem:
Button shows up fine
label does not show at all
radiobutton - button shows up and text when moving mouse over it
Okay, the problem is easily fixed by noting the new alpha blit semantics
in the WhatsNew file. The relevant sections follow:
The blit semantics for surfaces with and without alpha and colorkey
have now been defined:
RGB->RGBA:
SDL_SRCALPHA set:
alpha-blend (using the source per-surface alpha value);
set destination alpha to opaque.
SDL_SRCALPHA not set:
copy RGB, set destination alpha to opaque.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source colour key.
RGBA->RGBA:
SDL_SRCALPHA set:
alpha-blend (using the source alpha channel) the RGB values;
leave destination alpha untouched. [Note: is this correct?]
SDL_SRCCOLORKEY ignored.
SDL_SRCALPHA not set:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source colour key, ignoring alpha in the
comparison.
Okay, so what you want is for SDL_SRCALPHA to not be set in the labels
so that the alpha is copied to the SDL screen texture.
Okay, so much for being smart. I just tried your test program with
the ParaGUI 1.6.3 from the web page, and everything looked fine. The
label showed up, and the radiobutton and text looked fine. Did Alex
backport his fix to ParaGUI 1.6.3?
I just double-checked against ParaGUI 1.6.4, and the behavior is exactly
the same with SDL CVS and both versions of ParaGUI.
See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software