Hi Evgeny,

> >After updating libftgl2 from version 2.1.3~rc5-5 to version 2.3.0-3, text 
> >rendering in Megaglest is broken. Text is shown correctly in menus, but text 
> >displayed in the game itself is replaced by white rectangles.
> 
> Thanks for the report.
> 
> Any idea of what's going on, Frank?
> 
> For me it works in some menus, there are white squares in others.  zaz,
> another application using ftgl, seems to work fine, while critterding
> also shows white squares.

That's probably a consequence of a fix made by sammy in 2009(!)
(commit 29603ae: "Remove GL_BLEND tampering. It's the caller
application's responsibility to enable or disable blending").

For some reason, that patch (and a few others) hadn't made it into
Debian before and only now got in as a "bycatch" when we
synchronized everything.

Though it is an incompatible change, it was a necessary one, since
what the library did before was wrong (which prompted a bug report
of my own, #742469 which would solve it for some particular cases
while adding a dependency on GL_GLEXT_PROTOTYPES). So the better
solution is probably the earlier (and now current) one which puts
the responsibility on the caller.

I had seen the same problem in another test program recently, and in
this case it helped to add the following two lines in an appropriate
place. You can try the same in your code (shouldn't hurt if compiled
with older ftgl versions as well):

  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Or, if you like a better blending function (see my description in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742469), you can
use this instead:

#define GL_GLEXT_PROTOTYPES

  glEnable(GL_BLEND);
  glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
                      GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

Regards,
Frank

Reply via email to