Advertisement

Font rendering in lesson23

Started by July 21, 2001 01:55 AM
3 comments, last by dirtypope 23 years, 7 months ago
I made myself a nice font.h header file in my workspace, and went off of nehe''s tut #13 and modified it some to suit my needs, then i call it how he says to call it, and i get no errors, but i do get some bugs... 1) Instead of just the text being colored, theres a colored tint over the entire scrren so all my objects show up greenish like im wearing night vision (must find out whats causing this bug so that i dont have to think too hard to implement night vision later lol) 2) i cant even see the text... any idea''s whats causing this? im pretty positive the bug is in theese 2 lines... glColor3f(1.0f*float(cos(cnt1)),1.0f*float(sin(cnt2)),1.0f-0.5f*float(cos(cnt1+cnt2))); glRasterPos2f(-0.45f+0.05f*float(cos(cnt1)), 0.35f*float(sin(cnt2))); what i think is causing the nightvision effect is the glColor3f how can i make that only apply to my font... that might also be why i cant see the font, because it tints my objects that color.... if its not the color why i cant see it, its probably the glrasterpos, any of you have an idea on how to fix this?
Theres no such thing as stupid people... only people with under clocked brains. -dirty
You are getting this error, cause you do not reset the color...
You must set it to (1.0, 1.0, 1.0) after your text-code, to make the textures look right!

SnAkE''s Programming Resources
Advertisement
your fix to my problem did not work... i have the function in a header file (font.h) i called it lise it says in the tut and that didnt work... heres my current text code from DrawGLscene()

------------------------------------------------
glColor3f(0.5f,2.0f,1.5f);
glRasterPos2f(-0.45f,0.35f);
glPrint("TEST");
glColor3f(1.0f, 1.0f, 1.0f);
------------------------------------------------
as you can see i simplified it alot, the screen is no longer a tinted color, but i still cant see my text... man this is annoying me *rips hair out*

thx in advance for the help
Theres no such thing as stupid people... only people with under clocked brains. -dirty
YAY!! i got it somewhat working... my stupid problem was it wasnt after translatef! grrr the only part that needs fixing now, is the fact that it doesnt move with the camera, it just stays in one area lol.
Theres no such thing as stupid people... only people with under clocked brains. -dirty
another problem is the text stays black no matter what =(

i call the color before i call the text, then after the text i set it back to 1.0,1.0,1.0 text stays black =(
Theres no such thing as stupid people... only people with under clocked brains. -dirty

This topic is closed to new replies.

Advertisement