Sign in to follow this  

calculating frame rate and displaying it

This topic is 3590 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, can anyone tell me how to calculate frame rate in open gl and display it.. my program (VC++ WIN32 project) displays 1000 cubes by calling the display function in nested for loops creating a grid like structure... using the regular text display techniques here causes a win32 exception. thank you very much

Share this post


Link to post
Share on other sites
This is how I do it in Opengl. It does not print it on the game screen but rather on the Run screen. I believe it works very good.



int startTime, endTime;

startTime = glutGet(GLUT_ELAPSED_TIME);
endTime = glutGet(GLUT_ELAPSED_TIME);


printf("Speed %.3f frames/sec (%d ms)\n", 1000.0/(endTime-startTime), endTime-startTime);

Share this post


Link to post
Share on other sites

This topic is 3590 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this