progs/es2: Fix an assertion failure in tri.
authorChia-I Wu <olvaffe@gmail.com>
Tue, 2 Feb 2010 02:40:32 +0000 (10:40 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Tue, 2 Feb 2010 02:45:00 +0000 (10:45 +0800)
EGL_SURFACE_TYPE is a config attribute, not a surface attribute.  Thanks
to Mike Stroyan for pointing out this error.

progs/es2/xegl/tri.c

index 7729a099578678c9c04a7c7d147a23242425dc8f..8981d8a7e217e9a5e8507b503fba8da39dc934d6 100644 (file)
@@ -334,14 +334,15 @@ make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
       exit(1);
    }
 
+   /* sanity checks */
    {
       EGLint val;
       eglQuerySurface(egl_dpy, *surfRet, EGL_WIDTH, &val);
       assert(val == width);
       eglQuerySurface(egl_dpy, *surfRet, EGL_HEIGHT, &val);
       assert(val == height);
-      eglQuerySurface(egl_dpy, *surfRet, EGL_SURFACE_TYPE, &val);
-      assert(val == EGL_WINDOW_BIT);
+      assert(eglGetConfigAttrib(egl_dpy, config, EGL_SURFACE_TYPE, &val));
+      assert(val & EGL_WINDOW_BIT);
    }
 
    XFree(visInfo);