int frame=0,time=0,timebase=0;
void ShowFrameRate()
{
char s[100]={0};
frame++;
time=glutGet(GLUT_ELAPSED_TIME);
if (time - timebase > 1000) {
sprintf(s,"FPS:%4.2f",
frame*1000.0/(time-timebase));
timebase = time;
frame = 0;
printf("帧率为:%d\n",s);
}
}
void ShowFrameRate()
{
char s[100]={0};
frame++;
time=glutGet(GLUT_ELAPSED_TIME);
if (time - timebase > 1000) {
sprintf(s,"FPS:%4.2f",
frame*1000.0/(time-timebase));
timebase = time;
frame = 0;
printf("帧率为:%d\n",s);
}
}