The progs/es2/xegl/tri.c demo fails using, eglQuerySurface() with
EGL_SURFACE_TYPE.
Only eglGetConfigAttrib can query EGL_SURFACE_TYPE.
This patch replaces that with querying EGL_CONFIG_ID, then using that
ID to call eglChooseConfig and using  that config to call
eglGetConfigAttrib() with EGL_SURFACE_TYPE.

-- 

 Mike Stroyan - Software Architect
 LunarG, Inc.  - The Graphics Experts
 Cell:  (970) 219-7905
 Email: m...@lunarg.com
 Website: http://www.lunarg.com
From 4afd26abdeca4c0f600078abc21f000983296911 Mon Sep 17 00:00:00 2001
From: Mike Stroyan <m...@lunarg.com>
Date: Mon, 1 Feb 2010 14:32:40 -0700
Subject: [PATCH] Use eglGetConfigAttrib EGL_SURFACE_TYPE in tri.c

---
 progs/es2/xegl/tri.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/progs/es2/xegl/tri.c b/progs/es2/xegl/tri.c
index 7729a09..bb16780 100644
--- a/progs/es2/xegl/tri.c
+++ b/progs/es2/xegl/tri.c
@@ -340,8 +340,18 @@ make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
       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);
+      {
+	  EGLConfig config;
+	  EGLint num_configs;
+	  static EGLint attribs[3];
+	  attribs[0] = EGL_CONFIG_ID;
+	  attribs[2] = EGL_NONE;
+	  assert(eglQuerySurface(egl_dpy, *surfRet, EGL_CONFIG_ID, &attribs[1]));
+	  assert(eglChooseConfig(egl_dpy, attribs, &config, 1, &num_configs));
+	  assert(num_configs);
+	  assert(eglGetConfigAttrib(egl_dpy, config, EGL_SURFACE_TYPE, &val));
+	  assert(val & EGL_WINDOW_BIT);
+      }
    }
 
    XFree(visInfo);
-- 
1.6.3.3

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to