X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=progs%2Fegl%2Fegltri.c;h=006e06eb03e32499c2910f9c6ac5764f7ff26fe3;hb=eb4dc547885994cc7961f7996c33ff484f664964;hp=79f6702007e736b108dcbca3038e21e60ae07596;hpb=f67bc2e87255298ac22e8ccd98f482cc62d0ec26;p=mesa.git diff --git a/progs/egl/egltri.c b/progs/egl/egltri.c index 79f6702007e..006e06eb03e 100644 --- a/progs/egl/egltri.c +++ b/progs/egl/egltri.c @@ -127,6 +127,7 @@ static void run(EGLDisplay dpy, EGLSurface surf, int ttr) double st = current_time(); double ct = st; int frames = 0; + GLfloat seconds, fps; while (ct - st < ttr) { @@ -139,8 +140,8 @@ static void run(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); } @@ -207,6 +208,7 @@ int main(int argc, char *argv[]) } printf("egltri: Using screen mode/size %d: %d x %d\n", chosenMode, width, height); + eglBindAPI(EGL_OPENGL_API); ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL); if (ctx == EGL_NO_CONTEXT) { printf("egltri: failed to create context\n");