Assignment 1: Simulating a Jello Cube

Measuring the frame rate (FPS)

There is no direct way to query the frame rate in OpenGL, but you can compute it by yourself, by inserting timers into your code. You can download Jernej's performanceCounter class (6.1. Measure code execution time). It is accurate up to a few microseconds. Same interface works under Windows, Linux, Mac OS X.

In order to compute FPS, stop the counter at the beginning of your idle handler (e.g., DoIdle()), query its value, and restart it. FPS = 1 / elapsedTime.