Jump to content
  • Advertisement
Sign in to follow this  
opendep

calculating frame rate and displaying it

This topic is 3961 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
Advertisement
if you do not require the FPS display built into your program, just use fraps
www.fraps.com (i think )

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!