diff options
| author | Michal Krol <michal@vmware.com> | 2009-12-12 16:48:32 +0100 |
|---|---|---|
| committer | Michal Krol <michal@vmware.com> | 2009-12-12 16:48:32 +0100 |
| commit | a3eb0f718e19653a2ad8e49396c904183be456f3 (patch) | |
| tree | 0092574c469ea586a6cab8b8ebb7ac62b8221a2a /progs/demos/multiarb.c | |
| parent | 491f384c3958067e6c4c994041f5d8d413b806bc (diff) | |
| parent | 784cca9fa527de771754d76545970f78094b9adf (diff) | |
Merge branch 'master' into glsl-pp-rework-2
Conflicts:
progs/perf/drawoverhead.c
progs/perf/teximage.c
progs/perf/vbo.c
progs/perf/vertexrate.c
src/mesa/shader/slang/library/slang_common_builtin_gc.h
Diffstat (limited to 'progs/demos/multiarb.c')
| -rw-r--r-- | progs/demos/multiarb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/progs/demos/multiarb.c b/progs/demos/multiarb.c index 85c4e3a266..3d89d3a13e 100644 --- a/progs/demos/multiarb.c +++ b/progs/demos/multiarb.c @@ -27,6 +27,8 @@ #define ANIMATE 10 #define QUIT 100 +static GLint T0 = 0; +static GLint Frames = 0; static GLboolean Animate = GL_TRUE; static GLint NumUnits = 1; static GLboolean TexEnabled[8]; @@ -105,6 +107,20 @@ static void Display( void ) glPopMatrix(); glutSwapBuffers(); + + Frames++; + + { + GLint t = glutGet(GLUT_ELAPSED_TIME); + if (t - T0 >= 5000) { + GLfloat seconds = (t - T0) / 1000.0; + GLfloat fps = Frames / seconds; + printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps); + fflush(stdout); + T0 = t; + Frames = 0; + } + } } |
