Text and Textures
I have a quad with a texture. Before I draw the quad I use glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
Then after I draw the quad I then use glColor4f(1.0f, 1.0f, 1.0f, 0.0f); and try to draw a bitmap font. The font, though, does not get draw. What am I doing wrong? Or can''t u use bitmap font''s over a quad?
Thanks ofr any help given
Tera_Dragon
------------------------------------------------------------
Programmers Resource Central
Well first things first: If the quad and the text are both White, then how do you know its not drawing? It could be, but since its the same color, it might just be invisible. change the color of either the quad or the text.
other things:
Is alpha blending enabled? If so, what is your BlendFunc?
Try turning off depth testing when drawing the font, maybe its behind the quad.
Waramp.
Before you insult a man, walk a mile in his shoes.
That way, when you do insult him, you''ll be a mile away, and you''ll have his shoes.
other things:
Is alpha blending enabled? If so, what is your BlendFunc?
Try turning off depth testing when drawing the font, maybe its behind the quad.
Waramp.
Before you insult a man, walk a mile in his shoes.
That way, when you do insult him, you''ll be a mile away, and you''ll have his shoes.
I said in my first post that the quad had a texture on it, so it isn't white, which the text should be.
I am using glBlendFunc(GL_SRC_ALPHA, GL_ONE);
I tried turning off depth testing but it didn't work.
------------------------------------------------------------
Programmers Resource Central
[edited by - Tera_Dragon on May 27, 2004 10:07:15 AM]
I am using glBlendFunc(GL_SRC_ALPHA, GL_ONE);
I tried turning off depth testing but it didn't work.
------------------------------------------------------------
Programmers Resource Central
[edited by - Tera_Dragon on May 27, 2004 10:07:15 AM]
Any ideas anyone?
Also when I have 2 quad with textures, and both are semi-transparent (0.5f), but when I have a light in the scene the transparency seems to dissapear. Whys this?
Also when I have 2 quad with textures, and both are semi-transparent (0.5f), but when I have a light in the scene the transparency seems to dissapear. Whys this?
thanks! This solved my problem :-)
------------------------------------------------------------
Programmers Resource Central
------------------------------------------------------------
Programmers Resource Central
Is there a quick way to add a char to a string when that key is pressed? I don''t want to have to write out:
if(keyPressed[''M''] && !mp)
{
mp = true;
word += "m";
}
if(!keyPressed[''M''])
{
mp = false;
}
for every key.
if(keyPressed[''M''] && !mp)
{
mp = true;
word += "m";
}
if(!keyPressed[''M''])
{
mp = false;
}
for every key.
I have this:
but it doesn''t work, y not?
void outPut(){ for(static int i = 97; i < 122; i++) { if(keyPressed[(i - 97)] && !key[(i - 97)]) { key[(i - 97)] = true; word += i; } if(!keyPressed[(i - 97)]) { key[(i - 97)] = false; } }}
but it doesn''t work, y not?
//Shouldn't this:keyPressed[(i - 97)]//be like this:keyPressed[i]// ????
[edited by - TomasH on May 27, 2004 12:15:37 PM]
quote:Original post by TomasH
//Shouldn't this:keyPressed[(i - 97)]//be like this:keyPressed[ i]// ????yeah, I got that worng, but even when ifxed it didn't help.Now I'm using wParam in my WndProc function.But I am now getting problems with deleting characters from a string. I am using: case VK_BACK: word.erase( (word.length()-1), 1); break;
but this for some reason doesn't change the length of the string. So I can only delete 1 character.
------------------------------------------------------------
Programmers Resource Central
[edited by - Tera_Dragon on May 27, 2004 12:39:31 PM]
[edited by - Tera_Dragon on May 27, 2004 1:12:27 PM]
[edited by - Tera_Dragon on May 27, 2004 1:12:59 PM]
[edited by - Tera_Dragon on May 27, 2004 1:13:40 PM]
[edited by - Tera_Dragon on May 27, 2004 1:14:16 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement