calculating frame rate and displaying it
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
if you do not require the FPS display built into your program, just use fraps
www.fraps.com (i think )
www.fraps.com (i think )
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);
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);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement