Archived

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

Printing font problems.

This topic is 5884 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 edited the font printing tool, so it would only show in one spont and stay in one spot, though, but its having problems It seems to interact with another freture in my program. Im making a small game where their are two ships and they dual it out to see who wins, and i need a bit of textprinting. Whenever i press L, the following code activates:: if ((Lazer.LazerFired) && (Lazer.LazerTime > 0)) { glBindTexture(GL_TEXTURE_2D, LazerTex[0]); glBegin(GL_QUADS); glTexCoord2f(0.0f,1.0f); glVertex3f((Ship1X - 0.1f),10.0f,-0.3f); glTexCoord2f(1.0f,1.0f); glVertex3f((Ship1X + 0.1f),10.0f,-0.3f); glTexCoord2f(1.0f,0.0f); glVertex3f((Ship1X + 0.1f),-3.0f,-0.3f); glTexCoord2f(0.0f,0.0f); glVertex3f((Ship1X - 0.1f),-3.0f,-0.3f); glEnd(); } For some reason, though, when that happens, the text is show on the screen, and any other time it does not. It the text part is above that, the lazer been has to be over the text for the text to show, and it only shows the part under the lazer texture. If its under that code, it shows the full thing no matter where the lazer is. Why is it doing that and how can i fix it? X_X the program itself is at ff-u.tripod.com/SB.exe its not much, but its a start for me (so far their is just one ship floating around that can be moved with the arrows left and right, and fire missiles + lazer beem, but its fast paced, which isnt nearly as fast on my pc cause my v.card sucks), and i want the text to show up as well, so it can print Health, for the ships.)

Share this post


Link to post
Share on other sites
I''m no expert but I believe the problem is that you are only copying to the screen and not the back buffer. You might want to tell it to always print the text and then if you press L, modify the text. I''m sorta unclear in my understanding and my writing.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
uhh, i did another test, if i have both BuildFont() the texture loading command in the init function, the font does not show. for some reason, the lazer showed it. =/
any idea how to fix it??

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think you have the same problem I had
just before you call your glPrint() routine or whatever, disable GL_TEXTURE_2D and disable GL_LIGHTING
then re-enable them after you''ve drawn it.
I think that may be what your problem is (it draws the font in whatever texture was bound last, and then has lights work on it, so the ship texture would be dark (assumed) and the lights would have no accurate ''normal'' to reflect off the text)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
sorry, forgot to add this,
if you want an example of my code, e-mail me Matryx@Matryx.org.uk and I''ll send you my delphi code snippets for my font printing

Share this post


Link to post
Share on other sites