08-01-2003, 10:55 AM
I have an texture and i want to write some
text on it.But i cant set the text color.
For example:
if i have a blue texture and i try to write
red text on it.But the color seems pink.Is this a blending problem ?
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); /* X1
glColor4ub(255,0,0,255);
Font->Print(10,200,"PROBLEM");
/*****************************************/
glColor3f(1,1,1);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);/* X2 I think this is the problem
/* This is a blue texture
glBindTexture(GL_TEXTURE_2D, gl->textures[1].texID);
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex3f(10, 200, 1.0f);
glTexCoord2f(1, 0); glVertex3f(266,200, 1.0f);
glTexCoord2f(1, 1); glVertex3f(266,232, 1.0f);
glTexCoord2f(0, 1); glVertex3f(10,232, 1.0f);
glEnd();
İf so what is the suitable X2 function?
Thanks...
text on it.But i cant set the text color.
For example:
if i have a blue texture and i try to write
red text on it.But the color seems pink.Is this a blending problem ?
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); /* X1
glColor4ub(255,0,0,255);
Font->Print(10,200,"PROBLEM");
/*****************************************/
glColor3f(1,1,1);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);/* X2 I think this is the problem
/* This is a blue texture
glBindTexture(GL_TEXTURE_2D, gl->textures[1].texID);
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex3f(10, 200, 1.0f);
glTexCoord2f(1, 0); glVertex3f(266,200, 1.0f);
glTexCoord2f(1, 1); glVertex3f(266,232, 1.0f);
glTexCoord2f(0, 1); glVertex3f(10,232, 1.0f);
glEnd();
İf so what is the suitable X2 function?
Thanks...