summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNicolas Bruguier <nicolas.bruguier@supersonicimagine.fr>2008-11-29 14:11:59 +0100
committerNicolas Bruguier <nicolas.bruguier@supersonicimagine.fr>2008-11-29 14:11:59 +0100
commitb69e9cff9325413326e4b04b6c33f245cd6ea933 (patch)
tree61cf962456c084ec753ac1c476bf9d2e502cfb31 /examples
parentcc14205ac0998afa2f5ae78253e7c6555480912d (diff)
[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.
Diffstat (limited to 'examples')
-rw-r--r--examples/cairogears/cairogears-glx.c29
1 files changed, 10 insertions, 19 deletions
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)),