Printing font problems.

Started by
4 comments, last by Psycho1 22 years, 5 months ago
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.)
Advertisement
i dont know if i mentioned this, but i need help on this!
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.
------------------------------------KaBeeM Web
<><
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??
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)
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

This topic is closed to new replies.

Advertisement