eibwen
2007-07-31, 09:01
This appears to be a bug I found while working on one of my applets.
static SDL_Surface *draw_ttf_font(JiveFont *font, Uint32 color, const char *str) {
SDL_Color clr;
clr.r = (color >> 24) & 0xFF;
clr.g = (color >> 16) & 0xFF;
clr.b = (color >> 8) & 0xFF;
return TTF_RenderUTF8_Blended(font->ttf, str, clr);
}
RGB values are defined but the Alpha channel is ignored.
I did some investigating and it looks like this is either a limitation of SDL (SDL_Color which currently doesn't have a member for alpha) or the freetype library.
Does anyone have some insight into this?
static SDL_Surface *draw_ttf_font(JiveFont *font, Uint32 color, const char *str) {
SDL_Color clr;
clr.r = (color >> 24) & 0xFF;
clr.g = (color >> 16) & 0xFF;
clr.b = (color >> 8) & 0xFF;
return TTF_RenderUTF8_Blended(font->ttf, str, clr);
}
RGB values are defined but the Alpha channel is ignored.
I did some investigating and it looks like this is either a limitation of SDL (SDL_Color which currently doesn't have a member for alpha) or the freetype library.
Does anyone have some insight into this?