Skip to main content
GameDev.net gamedev.net
🔒 Locked

About Multi-texture - glTexEnvi

Started by FireInDark Aug 10, 2012 at 8:38 AM 0 replies 950+ views
Original Post
FireInDark
FireInDark
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

thumb-BF9E_5024D0C5.jpg

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.