From b69e9cff9325413326e4b04b6c33f245cd6ea933 Mon Sep 17 00:00:00 2001 From: Nicolas Bruguier Date: Sat, 29 Nov 2008 14:11:59 +0100 Subject: [examples] Use the first format find by glitz Use the first format find by glitz instead search the format match the visual with 32 bits depth. The glx sort format allow it's the better format for render. --- examples/cairogears/cairogears-glx.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'examples') diff --git a/examples/cairogears/cairogears-glx.c b/examples/cairogears/cairogears-glx.c index f4e69d9..7a2c244 100644 --- a/examples/cairogears/cairogears-glx.c +++ b/examples/cairogears/cairogears-glx.c @@ -176,7 +176,6 @@ main (int argc, char **argv) { XSelectInput (dpy, win, StructureNotifyMask); } else { - int i; xsh.flags = PSize; xsh.width = width; @@ -185,24 +184,16 @@ main (int argc, char **argv) { xsh.y = 0; mask = 0; - - templ.doublebuffer = 1; - mask |= GLITZ_FORMAT_DOUBLEBUFFER_MASK; - - i = 0; - do { - dformat = glitz_glx_find_window_format (dpy, DefaultScreen (dpy), - mask, &templ, i++); - if (!dformat) { - dformat = glitz_glx_find_window_format (dpy, DefaultScreen (dpy), - mask, &templ, 0); - i = -1; - } - vinfo = glitz_glx_get_visual_info_from_format (dpy, - DefaultScreen (dpy), - dformat); - } while ((!vinfo || vinfo->depth != 32) && i != -1); - + + templ.doublebuffer = 1; + mask |= GLITZ_FORMAT_DOUBLEBUFFER_MASK; + + dformat = glitz_glx_find_window_format (dpy, DefaultScreen (dpy), + mask, &templ, 0); + + vinfo = glitz_glx_get_visual_info_from_format (dpy, + DefaultScreen (dpy), + dformat); xswa.colormap = XCreateColormap (dpy, RootWindow (dpy, DefaultScreen (dpy)), -- cgit v1.2.3