Demos (master): demos: print framerates to stdout

Keith Whitwell keithw at kemper.freedesktop.org
Tue Oct 5 08:57:39 UTC 2010


Module: Demos
Branch: master
Commit: 21e7e5f4823c5e4b20a13fd2b9bbc154a9004e1d
URL:    http://cgit.freedesktop.org/mesa/demos/commit/?id=21e7e5f4823c5e4b20a13fd2b9bbc154a9004e1d

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Oct  5 09:55:39 2010 +0100

demos: print framerates to stdout

Useful if you want to capture this information automatically, or if
you're doing experiments like disabling texturing or swapbuffers which
mean you can't read the onscreen display.

---

 src/demos/fbo_firecube.c |    1 +
 src/demos/fire.c         |    1 +
 src/demos/ipers.c        |    1 +
 src/demos/ray.c          |    1 +
 src/demos/teapot.c       |    1 +
 src/demos/terrain.c      |    1 +
 src/demos/tunnel.c       |    1 +
 src/demos/tunnel2.c      |    1 +
 8 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/demos/fbo_firecube.c b/src/demos/fbo_firecube.c
index afda1d7..3fd7413 100644
--- a/src/demos/fbo_firecube.c
+++ b/src/demos/fbo_firecube.c
@@ -584,6 +584,7 @@ drawfire(void)
 	 GLfloat seconds = (t - T0) / 1000.0;
 	 GLfloat fps = Frames / seconds;
 	 sprintf(frbuf, "Frame rate: %f", fps);
+         printf("%s\n", frbuf);
 	 T0 = t;
 	 Frames = 0;
       }
diff --git a/src/demos/fire.c b/src/demos/fire.c
index bb912fb..2e15985 100644
--- a/src/demos/fire.c
+++ b/src/demos/fire.c
@@ -528,6 +528,7 @@ drawfire(void)
          GLfloat seconds = (t - T0) / 1000.0;
          GLfloat fps = Frames / seconds;
          sprintf(frbuf, "Frame rate: %f", fps);
+         printf("%s\n", frbuf);
          T0 = t;
          Frames = 0;
       }
diff --git a/src/demos/ipers.c b/src/demos/ipers.c
index 265378b..4b57d78 100644
--- a/src/demos/ipers.c
+++ b/src/demos/ipers.c
@@ -668,6 +668,7 @@ draw(void)
       if (t - T0 >= 2000) {
          GLfloat seconds = (t - T0) / 1000.0;
          fr = Frames / seconds;
+         printf("Frame rate: %f\n", fr);
          T0 = t;
          Frames = 0;
       }
diff --git a/src/demos/ray.c b/src/demos/ray.c
index 9cc464d..bcb6355 100644
--- a/src/demos/ray.c
+++ b/src/demos/ray.c
@@ -739,6 +739,7 @@ draw(void)
          GLfloat seconds = (t - T0) / 1000.0;
          GLfloat fps = Frames / seconds;
          sprintf(frbuf, "Frame rate: %f", fps);
+         printf("%s\n", frbuf);
          T0 = t;
          Frames = 0;
       }
diff --git a/src/demos/teapot.c b/src/demos/teapot.c
index 04a675f..fb79708 100644
--- a/src/demos/teapot.c
+++ b/src/demos/teapot.c
@@ -490,6 +490,7 @@ static void draw(void)
          GLfloat seconds = (t - T0) / 1000.0;
          GLfloat fps = Frames / seconds;
          sprintf(frbuf, "Frame rate: %f", fps);
+         printf("%s\n", frbuf);
          T0 = t;
          Frames = 0;
       }
diff --git a/src/demos/terrain.c b/src/demos/terrain.c
index a72c8d3..97c4656 100644
--- a/src/demos/terrain.c
+++ b/src/demos/terrain.c
@@ -425,6 +425,7 @@ drawscene(void)
          GLfloat seconds = (t - T0) / 1000.0;
          GLfloat fps = Frames / seconds;
          sprintf(frbuf, "Frame rate: %f", fps);
+         printf("%s\n", frbuf);
          T0 = t;
          Frames = 0;
       }
diff --git a/src/demos/tunnel.c b/src/demos/tunnel.c
index efc007c..6fe0f67 100644
--- a/src/demos/tunnel.c
+++ b/src/demos/tunnel.c
@@ -469,6 +469,7 @@ draw(void)
          GLfloat seconds = (t - T0) / 1000.0;
          GLfloat fps = Frames / seconds;
          sprintf(frbuf, "Frame rate: %f", fps);
+         printf("%s\n", frbuf);
          T0 = t;
          Frames = 0;
       }
diff --git a/src/demos/tunnel2.c b/src/demos/tunnel2.c
index f15da95..90a9ef3 100644
--- a/src/demos/tunnel2.c
+++ b/src/demos/tunnel2.c
@@ -490,6 +490,7 @@ draw(void)
          GLfloat seconds = (t - T0) / 1000.0;
          GLfloat fps = Frames / seconds;
          sprintf(frbuf, "Frame rate: %f", fps);
+         printf("%s\n", frbuf);
          T0 = t;
          Frames = 0;
       }




More information about the mesa-commit mailing list