Tag: 播放

如何在OpenGL中计算FPS?

void CalculateFrameRate() { static float framesPerSecond = 0.0f; // This will store our fps static float lastTime = 0.0f; // This will hold the time from the last frame float currentTime = GetTickCount() * 0.001f; ++framesPerSecond; if( currentTime – lastTime > 1.0f ) { lastTime = currentTime; if(SHOW_FPS == 1) fprintf(stderr, “\nCurrent Frames Per Second: […]