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: %d\n\n", (int)framesPerSecond);
framesPerSecond = 0;
}
}
क्या मुझे यह फ़ंक्शन void play(void)
या void display(void)
में कॉल करना चाहिए?ओपनजीएल में एफपीएस की गणना कैसे करें?
या इससे कोई फर्क नहीं पड़ता?
'प्ले (शून्य) 'क्या है? ध्यान दें कि चीजें थोड़ा अधिक जटिल हैं क्योंकि जीपीयू अप्रत्याशित हैं: http://stackoverflow.com/questions/8779936/correct-way-to-calculate-the-fps –