void CalculateFrameRate()
{
static float framesPerSecond = 0.0f; // This will store our fps
static float lastTime = 0.0f; // This will hold
void CalculateFrameRate()
{
static float framesPerSecond = 0.0f;
static int fps;
static float lastTime = 0.0f;
float currentTime = GetTickCount() * 0.001f;
++framesPerSecond;
glPrint("Current Frames Per Second: %d\n\n", fps);
if (currentTime - lastTime > 1.0f)
{
lastTime = currentTime;
fps = (int)framesPerSecond;
framesPerSecond = 0;
}
}