Chris Robinson : wgl: Properly handle GLX_DRAWABLE_TYPE queries.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 11 07:45:05 CST 2006


Module: wine
Branch: master
Commit: 9da10277ce21568c09539c0c705b781fe775751e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9da10277ce21568c09539c0c705b781fe775751e

Author: Chris Robinson <chris.kcat at gmail.com>
Date:   Sun Dec 10 00:00:47 2006 -0800

wgl: Properly handle GLX_DRAWABLE_TYPE queries.

---

 dlls/winex11.drv/opengl.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 9d42019..8f55c92 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -615,6 +615,7 @@ static int ConvertAttribWGLtoGLX(const i
   int nAttribs = 0;
   unsigned cur = 0; 
   int pop;
+  int drawattrib = 0;
   int isColor = 0;
   int wantColorBits = 0;
   int sz_alpha = 0;
@@ -692,25 +693,27 @@ static int ConvertAttribWGLtoGLX(const i
     case WGL_DRAW_TO_BITMAP_ARB:
       pop = iWGLAttr[++cur];
       TRACE("pAttr[%d] = WGL_DRAW_TO_BITMAP_ARB: %d\n", cur, pop);
+      /* GLX_DRAWABLE_TYPE flags need to be OR'd together. See below. */
       if (pop) {
-        PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT);
-        TRACE("pAttr[%d] = GLX_DRAWABLE_TYPE: GLX_PIXMAP_BIT\n", cur);
+        drawattrib |= GLX_PIXMAP_BIT;
       }
       break;
 
     case WGL_DRAW_TO_WINDOW_ARB:
       pop = iWGLAttr[++cur];
+      TRACE("pAttr[%d] = WGL_DRAW_TO_WINDOW_ARB: %d\n", cur, pop);
+      /* GLX_DRAWABLE_TYPE flags need to be OR'd together. See below. */
       if (pop) {
-        PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT);
-        TRACE("pAttr[%d] = GLX_DRAWABLE_TYPE: GLX_WINDOW_BIT\n", cur);
+        drawattrib |= GLX_WINDOW_BIT;
       }
       break;
 
     case WGL_DRAW_TO_PBUFFER_ARB:
       pop = iWGLAttr[++cur];
+      TRACE("pAttr[%d] = WGL_DRAW_TO_PBUFFER_ARB: %d\n", cur, pop);
+      /* GLX_DRAWABLE_TYPE flags need to be OR'd together. See below. */
       if (pop) {
-        PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT);
-        TRACE("pAttr[%d] = GLX_DRAWABLE_TYPE: GLX_PBUFFER_BIT\n", cur);
+        drawattrib |= GLX_PBUFFER_BIT;
       }
       break;
 
@@ -756,7 +759,7 @@ static int ConvertAttribWGLtoGLX(const i
           return -1; /** error: don't support it */
         } else {
           PUSH2(oGLXAttr, GLX_X_RENDERABLE, pop);
-          PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT);
+          drawattrib |= GLX_PBUFFER_BIT;
         }
       }
       break ;
@@ -807,6 +810,12 @@ static int ConvertAttribWGLtoGLX(const i
     TRACE("pAttr[%d] = WGL_COLOR_BITS_ARB: %d\n", cur, wantColorBits);
   }
 
+  /* Apply the OR'd drawable type bitmask now. */
+  if (drawattrib) {
+    PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, drawattrib);
+    TRACE("pAttr[?] = GLX_DRAWABLE_TYPE: %#x\n", drawattrib);
+  }
+
   return nAttribs;
 }
 
@@ -2433,6 +2442,7 @@ static GLboolean WINAPI X11DRV_wglGetPix
                 curCfg = cfgs[fmt_index];
             hTest = pglXGetFBConfigAttrib(gdi_display, curCfg, curGLXAttr, piValues + i);
             if (hTest) goto get_error;
+            curGLXAttr = 0;
         } else { 
             piValues[i] = GL_FALSE; 
         }




More information about the wine-cvs mailing list