Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Tera_Dragon

Text and Textures

This topic is 5110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I have this:

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?

Share this post


Link to post
Share on other sites
//Shouldn't this:

keyPressed[(i - 97)]
//be like this:

keyPressed[i]
// ????


[edited by - TomasH on May 27, 2004 12:15:37 PM]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!