summaryrefslogtreecommitdiffstats
path: root/progs/egl/peglgears.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-10-15 13:00:03 -0600
committerBrian Paul <brianp@vmware.com>2009-10-15 13:00:03 -0600
commit5b7d9053a08d5042206781a664ecd74efac0eb86 (patch)
treeb44099093dc947a68e3aed7c10af634c5792ea57 /progs/egl/peglgears.c
parent6c21c8862bc6edc9cddf3b6eb6f276961099a7a8 (diff)
downloadexternal_mesa3d-5b7d9053a08d5042206781a664ecd74efac0eb86.zip
external_mesa3d-5b7d9053a08d5042206781a664ecd74efac0eb86.tar.gz
external_mesa3d-5b7d9053a08d5042206781a664ecd74efac0eb86.tar.bz2
progs/egl: put declarations before code
Diffstat (limited to 'progs/egl/peglgears.c')
-rw-r--r--progs/egl/peglgears.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/progs/egl/peglgears.c b/progs/egl/peglgears.c
index 1ddb691..212d1ac 100644
--- a/progs/egl/peglgears.c
+++ b/progs/egl/peglgears.c
@@ -274,10 +274,10 @@ draw(void)
static void
reshape(int width, int height)
{
- glViewport(0, 0, (GLint) width, (GLint) height);
-
GLfloat h = (GLfloat) height / (GLfloat) width;
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
@@ -333,6 +333,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
double st = current_time();
double ct = st;
int frames = 0;
+ GLfloat seconds, fps;
+
while (ct - st < ttr)
{
double tt = current_time();
@@ -352,8 +354,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
frames++;
}
- GLfloat seconds = ct - st;
- GLfloat fps = frames / seconds;
+ seconds = ct - st;
+ fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
}