diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-01-27 15:44:40 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-01-27 15:44:40 +0000 |
commit | 0b3c2a9a245c2bff762263641c1ef8014d8ec542 (patch) | |
tree | 6f7e05a809025762c4851ae2041c5d9050322999 | |
parent | 5594ddbcfe199e7a1dc21ddf39d51364d7419902 (diff) | |
download | external_mesa3d-0b3c2a9a245c2bff762263641c1ef8014d8ec542.zip external_mesa3d-0b3c2a9a245c2bff762263641c1ef8014d8ec542.tar.gz external_mesa3d-0b3c2a9a245c2bff762263641c1ef8014d8ec542.tar.bz2 |
Don't do swapbuffers if -nodraw specified. Get t0 after setup code.
-rw-r--r-- | progs/tests/subtexrate.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/progs/tests/subtexrate.c b/progs/tests/subtexrate.c index f88fdc1..568b68d 100644 --- a/progs/tests/subtexrate.c +++ b/progs/tests/subtexrate.c @@ -146,7 +146,7 @@ SubTex(GLboolean doSubRect, const GLubyte *image) static void RunTest(GLboolean copyTex, GLboolean doSubRect) { - double t1, t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0; + double t0, t1; int iters = 0; float copyRate, mbRate; float rot = 0.0; @@ -171,6 +171,8 @@ RunTest(GLboolean copyTex, GLboolean doSubRect) glEnable(GL_TEXTURE_2D); glViewport(WinWidth / 2, 0, WinWidth / 2, WinHeight); + t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0; + do { if (copyTex) /* Framebuffer -> Texture */ @@ -198,7 +200,9 @@ RunTest(GLboolean copyTex, GLboolean doSubRect) rot += 2.0; t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - glutSwapBuffers(); + if (DrawQuad) { + glutSwapBuffers(); + } } while (t1 - t0 < 5.0); glDisable(GL_TEXTURE_2D); @@ -234,6 +238,9 @@ Draw(void) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); DrawTestImage(); + if (!DrawQuad) { + glutSwapBuffers(); + } RunTest(GL_FALSE, GL_FALSE); RunTest(GL_FALSE, GL_TRUE); |