summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-06-22 13:42:44 -0600
committerBrian Paul <brianp@vmware.com>2015-06-22 13:43:17 -0600
commit3d5e8e181a3d65ffd41a17110a8e552244d9f7bd (patch)
treee4fb3eb912120f2a8572129f89f45b06582c287a
parentbf5ae602db3ff5d38b73c969c4b0aee2bf25bd73 (diff)
demos: flush stdout after printing frame rateHEADmaster
To get immediate output on Windows. Trivial.
-rw-r--r--src/demos/fbo_firecube.c3
-rw-r--r--src/demos/fire.c1
-rw-r--r--src/demos/teapot.c1
-rw-r--r--src/demos/terrain.c1
-rw-r--r--src/demos/trispd.c1
-rw-r--r--src/demos/tunnel.c1
-rw-r--r--src/demos/tunnel2.c1
7 files changed, 8 insertions, 1 deletions
diff --git a/src/demos/fbo_firecube.c b/src/demos/fbo_firecube.c
index 333c04c7..eefbb640 100644
--- a/src/demos/fbo_firecube.c
+++ b/src/demos/fbo_firecube.c
@@ -584,7 +584,8 @@ drawfire(void)
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
sprintf(frbuf, "Frame rate: %f", fps);
- printf("%s\n", frbuf);
+ printf("%s\n", frbuf);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/src/demos/fire.c b/src/demos/fire.c
index c40278ba..34fac440 100644
--- a/src/demos/fire.c
+++ b/src/demos/fire.c
@@ -529,6 +529,7 @@ drawfire(void)
GLfloat fps = Frames / seconds;
sprintf(frbuf, "Frame rate: %f", fps);
printf("%s\n", frbuf);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/src/demos/teapot.c b/src/demos/teapot.c
index f75ad944..23d2225b 100644
--- a/src/demos/teapot.c
+++ b/src/demos/teapot.c
@@ -491,6 +491,7 @@ static void draw(void)
GLfloat fps = Frames / seconds;
sprintf(frbuf, "Frame rate: %f", fps);
printf("%s\n", frbuf);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/src/demos/terrain.c b/src/demos/terrain.c
index 435912ae..9e3629db 100644
--- a/src/demos/terrain.c
+++ b/src/demos/terrain.c
@@ -426,6 +426,7 @@ drawscene(void)
GLfloat fps = Frames / seconds;
sprintf(frbuf, "Frame rate: %f", fps);
printf("%s\n", frbuf);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/src/demos/trispd.c b/src/demos/trispd.c
index 0c7ad6ec..d6e231e5 100644
--- a/src/demos/trispd.c
+++ b/src/demos/trispd.c
@@ -95,6 +95,7 @@ static void Display( void )
pixelRate = triRate * Size;
printf("Rate: %d tri in %gs = %g tri/s %d pixels/s\n",
triCount, t1-t0, triRate, (int)pixelRate);
+ fflush(stdout);
glutSwapBuffers();
}
diff --git a/src/demos/tunnel.c b/src/demos/tunnel.c
index 6e48ad46..dea689e0 100644
--- a/src/demos/tunnel.c
+++ b/src/demos/tunnel.c
@@ -470,6 +470,7 @@ draw(void)
GLfloat fps = Frames / seconds;
sprintf(frbuf, "Frame rate: %f", fps);
printf("%s\n", frbuf);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/src/demos/tunnel2.c b/src/demos/tunnel2.c
index 800ea7b0..1126a385 100644
--- a/src/demos/tunnel2.c
+++ b/src/demos/tunnel2.c
@@ -491,6 +491,7 @@ draw(void)
GLfloat fps = Frames / seconds;
sprintf(frbuf, "Frame rate: %f", fps);
printf("%s\n", frbuf);
+ fflush(stdout);
T0 = t;
Frames = 0;
}