Original Post
Yes I render text with FreeType and it's goes well .
[attachment=10597:???.jpg]
Yes seems every thing all right..
But see here:
view.setFontColor(255,255,255,255);
Yes I do want to set the font_color be white,but it show me the black text..
It's quite sure that the color of the pixels rendered by FreeType are all right:
for(int h = 0;h < bitmap_height;h++)
{
for(int w = 0;w < bitmap_width; w++)
{
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 0] = buffer[bitmap_width * h + w] * color[0] / 256;
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 1] = buffer[bitmap_width * h + w] * color[1] / 256;
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 2] = buffer[bitmap_width * h + w] * color[2] / 256;
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 3] = 255;
}
}
and when :
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);//first texture
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); //text texture
view.setFontColor(255,255,255,255);
[attachment=10598:???.jpg]
seems well.
but then:
view.setFontColor(255,0,0,255);
[attachment=10599:???.jpg]
yes ,it's red but not pure red one..
then what I want to do is see the text color as what I set.
there must be the reason of glTexEnvi
[attachment=10597:???.jpg]
Yes seems every thing all right..
But see here:
view.setFontColor(255,255,255,255);
Yes I do want to set the font_color be white,but it show me the black text..
It's quite sure that the color of the pixels rendered by FreeType are all right:
for(int h = 0;h < bitmap_height;h++)
{
for(int w = 0;w < bitmap_width; w++)
{
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 0] = buffer[bitmap_width * h + w] * color[0] / 256;
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 1] = buffer[bitmap_width * h + w] * color[1] / 256;
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 2] = buffer[bitmap_width * h + w] * color[2] / 256;
paper_buffer[((pen_y + h) * paper_width + pen_x + w + char_advance)*4 + 3] = 255;
}
}
and when :
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);//first texture
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); //text texture
view.setFontColor(255,255,255,255);
[attachment=10598:???.jpg]
seems well.
but then:
view.setFontColor(255,0,0,255);
[attachment=10599:???.jpg]
yes ,it's red but not pure red one..
then what I want to do is see the text color as what I set.
there must be the reason of glTexEnvi