Still No Luck :(
Well, i have asked for help about 2-3 times about this now, no one can give me any info on how to fix it. So, i ask again, I cant seem to get TGA''s to show up as textures on objects. I use the code from Lesson 33 and i could never get the text to sho wup, but i could get a box to show up mapped with the font texture, but the glprint wouldnt show up. Now, i cant see anything i draw to the screen! Why is this? I have lights off, blending on and texturing enabled and i''m using the same initialization code (basically) from lesson 33, i didnt change anythign in the loadTGA or the glPrint or the BuildFont functions, except variable names. Thats it, so why doesnt it show up?!
what compiler do u use?
some compilers just don''t work to great with this stuff
some compilers just don''t work to great with this stuff
Why would the compiler matter? The is too abstract of a question to answer easily. There''s a lot of things that could be wrong, maybe you should delete the font function altogether, then rewrite/copy-paste it again. I''ve made some extremely hard to find typos copying code in the past, maybe you did too?
[Resist Windows XP''s Invasive Production Activation Technology!]
[Resist Windows XP''s Invasive Production Activation Technology!]
Well, I am using Visual Studio 6 Enterprise Edition, The lesson 33 code compiles just fine on it and i really doubt that would have anythign to do with it. Now, Everythign works fine in the lesson 33 code, i simple moved the functions over to my project. Maybe i dont have something set, what kind of blend/render/whatever type things do i need enabled/Disabled?
Like i said, same glPrint func as in 33, and i have same initialization code:
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClearDepth(1.0f);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
//glAlphaFunc(GL_GREATER,0.1f);
//glEnable(GL_ALPHA_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_CULL_FACE);
These are in my initialization code, just like in 33. See anythign wrong? Remember i am trying to use the TGA WITH ALPHA channels, RGBA images.
Like i said, same glPrint func as in 33, and i have same initialization code:
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClearDepth(1.0f);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
//glAlphaFunc(GL_GREATER,0.1f);
//glEnable(GL_ALPHA_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_CULL_FACE);
These are in my initialization code, just like in 33. See anythign wrong? Remember i am trying to use the TGA WITH ALPHA channels, RGBA images.
Turn off depth testing before rendering any 2D quads (like text). Also, alpha testing should be set to greater than 0.0f when you''re blending with that combination (for efficiency, no other reason).
[Resist Windows XP''s Invasive Production Activation Technology!]
[Resist Windows XP''s Invasive Production Activation Technology!]
Well, i turned depth testing off and anthing to do with it, and still blank screen pops up. Nothing. I dont get what went wrong. I had it working in my other code, but then it just stopped...i didnt change anything...?
This is just a shot in the dark, so if it''s not the problem, I apologize. Check that the texture you''re using is an uncompressed TGA, and that in the glTexImage2d() function you specify that you''re using a GL_RGBA (not GL_RGB). If you use GL_RGB, then the alpha is automatically set to 1.0f for the whole image.
I hope this helps!
Feel free to email me.
I hope this helps!
Feel free to email me.
[email=JValentine_13@hotmail.com]contact[/email]
Sorry man, but if th=at were the problem i would be able to see the image. I have it set to RGBA, the textures are uncompressed 32bit format, and i''m suing the SAME font tga from lesson 33, i copied the tga to my project, so it works in 33, it is fine. But why dont they show up in my code?!
Eww, I was hoping it was something easy. I know how irritating this particular problem is!
Ok, I don''t know the extent of your knowledge, so please, take no offense if I seem to state the obvious.
Have you modified the print function at all? Make sure that GL_CULL_FACE is not enabled (just see if disabling it helps, if not, don''t worry about it any more) What differences (if any, no matter how small) have you made?
And check that you are enabling GL_TEXTURE_2D before you load the texture. (I''ve forgotten this myself, and it was a pain to even find this easily overlooked problem)
If nothing here helps, then I really feel for you, I know what it''s like, and I don''t like it
Ok, I don''t know the extent of your knowledge, so please, take no offense if I seem to state the obvious.
Have you modified the print function at all? Make sure that GL_CULL_FACE is not enabled (just see if disabling it helps, if not, don''t worry about it any more) What differences (if any, no matter how small) have you made?
And check that you are enabling GL_TEXTURE_2D before you load the texture. (I''ve forgotten this myself, and it was a pain to even find this easily overlooked problem)
If nothing here helps, then I really feel for you, I know what it''s like, and I don''t like it
[email=JValentine_13@hotmail.com]contact[/email]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement