Nehe bitmap font problems
Using Nehe''s code i''ve made an FPS counter for my game. Now, if the fps goes greater than something like 250 (possibly 255, that''ld make sense) it displays "1.#J". Im passing a float to glPrint(), i''ve tried other numbers like unsigned ints, longs etc but all seem to produce the same result. Anyone else have this problem?
--------------------Go Stick Your Head In A Pig
And what does your print code look like? It should be:
glPrint("FPS: %d", fps);
Is that what you are doing? If so you should have no problems.
Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
glPrint("FPS: %d", fps);
Is that what you are doing? If so you should have no problems.
Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
I said im passing a float, it looks like:
glPrint("FPS: %.2f", fps);
I''ve also tried using a double, still doesnt work.
glPrint("FPS: %.2f", fps);
I''ve also tried using a double, still doesnt work.
--------------------Go Stick Your Head In A Pig
Why do you need a float for frames per second? Try it with integers and see if the problem goes away.
Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
I already said in the original post that i''ve tried ints. It displays zero instead.
--------------------Go Stick Your Head In A Pig
This is due to the fact that it is a list base. Displays 0 - 255 chars. Make sure you transform the into a string before trying to display it. Otherwise a it thinks it a literal.
sprintf(Buffer,"%d",fps);
glPrint(Buffer);
Which should resolve the issue.
sprintf(Buffer,"%d",fps);
glPrint(Buffer);
Which should resolve the issue.
--What are you nutz?I have nothing to say to your unevolved little brain. The more I say gives you more weapons to ask stupid questions.
No, that doesnt work. This code inside glPrint(...) does that anyway:
|
--------------------Go Stick Your Head In A Pig
No one has an answer for this?
--------------------Go Stick Your Head In A Pig
Try converting the variables that you are using to calculate the FPS to floats sooner. The problem may be that you are mixing variable types in the calculation, and that is causing the result to not be converted to the correct type soon enough.
jw
jw
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement