Merge branch 'mesa_7_7_branch'
[mesa.git] / progs / egl / egltri.c
index 78c67939b28b5dfdd1c4358c9198ed9b3880185b..006e06eb03e32499c2910f9c6ac5764f7ff26fe3 100644 (file)
@@ -127,12 +127,11 @@ 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)
        {
-               double tt = current_time();
-               double dt = tt - ct;
-               ct = tt;
+               ct = current_time();
 
                draw();
 
@@ -141,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);
 }
 
@@ -174,7 +173,7 @@ int 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, &maj, &min)) {
@@ -201,7 +200,7 @@ int main(int argc, char *argv[])
                eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
                eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
                printf("%3d: %d x %d\n", i, w, h);
-               if (w > width && h > height && w <= 1280 && h <= 1024) {
+               if (w > width && h > height) {
                        width = w;
                        height = h;
                        chosenMode = i;
@@ -209,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");