X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=progs%2Fegl%2Fpeglgears.c;h=212d1acf692fc775a6ec585521df1eb87016bcee;hb=eb4dc547885994cc7961f7996c33ff484f664964;hp=bac16453c16f3c9cf85576230c051bbfa92f0f4f;hpb=608e14c5b265d331f89959b8e477796ac21c297c;p=mesa.git diff --git a/progs/egl/peglgears.c b/progs/egl/peglgears.c index bac16453c16..212d1acf692 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); } @@ -385,7 +387,7 @@ main(int argc, char *argv[]) } /* DBR : Create EGL context/surface etc */ - d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915"); + d = eglGetDisplay(EGL_DEFAULT_DISPLAY); assert(d); if (!eglInitialize(d, &major, &minor)) {