Fix for the BadMatch error (bug #4945)

Wino Rojo winorojo at hotmail.com
Tue May 30 13:15:12 CDT 2006


This patch fixes bug 4945

ChangeLog:
- We require a visual with 24 bits depth and 8 bits alpha (instead of 16 
bits depth and no alpha)

_________________________________________________________________
MSN® Calendar keeps you organized and takes the effort out of scheduling 
get-togethers. 
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 
  Start enjoying all the benefits of MSN® Premium right now and get the 
first two months FREE*.
-------------- next part --------------
? patch.txt
Index: opengl.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/opengl.c,v
retrieving revision 1.28
diff -u -r1.28 opengl.c
--- opengl.c	23 May 2006 12:49:02 -0000	1.28
+++ opengl.c	30 May 2006 18:01:18 -0000
@@ -554,24 +554,33 @@
{
     XVisualInfo *visual = NULL;
     /* In order to support OpenGL or D3D, we require a double-buffered 
visual and stencil buffer support, */
-    int dblBuf[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, 
GLX_DOUBLEBUFFER, None};
+    int dblBuf[] = {GLX_RGBA,GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, 
GLX_ALPHA_SIZE, 8, GLX_DOUBLEBUFFER, None};
     if (!has_opengl()) return NULL;

     wine_tsx11_lock();
     visual = pglXChooseVisual(display, DefaultScreen(display), dblBuf);
     wine_tsx11_unlock();
     if (visual == NULL) {
-        /* fallback to no stencil */
-        int dblBuf2[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, 
None};
-        WARN("Failed to get a visual with at least 8 bits of stencil\n");
+        /* fallback to 16 bits depth, no alpha */
+        int dblBuf2[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, 
GLX_DOUBLEBUFFER, None};
+        WARN("Failed to get a visual with at least 24 bits depth\n");

         wine_tsx11_lock();
         visual = pglXChooseVisual(display, DefaultScreen(display), 
dblBuf2);
         wine_tsx11_unlock();
         if (visual == NULL) {
-            /* This should only happen if we cannot find a match with a 
depth size 16 */
-            FIXME("Failed to find a suitable visual\n");
-            return visual;
+            /* fallback to no stencil */
+            int dblBuf2[] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, 
None};
+            WARN("Failed to get a visual with at least 8 bits of 
stencil\n");
+
+            wine_tsx11_lock();
+            visual = pglXChooseVisual(display, DefaultScreen(display), 
dblBuf2);
+            wine_tsx11_unlock();
+            if (visual == NULL) {
+                /* This should only happen if we cannot find a match with a 
depth size 16 */
+                FIXME("Failed to find a suitable visual\n");
+               return visual;
+           }
         }
     }
     TRACE("Visual ID %lx Chosen\n",visual->visualid);



More information about the wine-patches mailing list