From 3d5e8e181a3d65ffd41a17110a8e552244d9f7bd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Jun 2015 13:42:44 -0600 Subject: demos: flush stdout after printing frame rate To get immediate output on Windows. Trivial. --- src/demos/fbo_firecube.c | 3 ++- src/demos/fire.c | 1 + src/demos/teapot.c | 1 + src/demos/terrain.c | 1 + src/demos/trispd.c | 1 + src/demos/tunnel.c | 1 + src/demos/tunnel2.c | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3