Advertisement Jump to content


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


FPS and related questions

This topic is 5845 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

Hello, all ! I''m new person on NeHe, but I''m already impressed with this site. Cool, very usefull. English is not my native language, I hope you''ll excuse some funny mistakes in this text :-) So, questions about FPS. 1. How to display it correctly ? How to print a string exactly at the place I want ? I have looked through lesson 13, of course. Using glRasterPos2f(..) function seems a bit buggy. The string with fps shows in different places of the window for different window sizes. If to find correct parameters for glRasterPos2f(..) for 640x480 window and than create 1024x768 window the string with FPS will be displayed at another position. 2. How to display FPS without slowing down the app ? I have turned the VERT sync off at all, but FPS is still about ~60 (I have Athlon XP 2000+, GF2). The performance of all app is remarkably different when printing FPS and when not. Thanks to everybody !

Share this post

Link to post
Share on other sites
About positioning...

It depends what corner is 0,0 - I think it''s lower left in the tutorial. If you wanted to place text in the lower left corner you could put it at 10,10 and it would stay there at any resolution. If you want text beginning at the center of the screen you should position it at width/2 and height/2.

If you want strings to display, say, about 10% the windows width from 0,0, then make the string print at 0.1*width... you get the idea.

Share this post

Link to post
Share on other sites
Parameters to glRasterPos2f(float, float) are not exact screen coordinates where the string is to be printed.
The object coordinates presented by glRasterPos are treated just like those of a glVertex command. They are transformed by the current modelview and projection matrices and passed to the clipping stage.

So, giving exact screen coords to this routine has no sence ...

May be you have working example of valid FPS printing ?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!