Jump to content

  • Log In with Google      Sign In   
  • Create Account

About Multi-texture - glTexEnvi


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 FireInDark   Members   -  Reputation: 148

Like
0Likes
Like

Posted 10 August 2012 - 02:38 AM

Yes I render text with FreeType and it's goes well .

未命名.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);
未命名.jpg
seems well.
but then:
view.setFontColor(255,0,0,255);
未命名.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

Posted Image

Edited by FireInDark, 10 August 2012 - 03:09 AM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS