Commit 9da10277 authored by Chris Robinson's avatar Chris Robinson Committed by Alexandre Julliard

wgl: Properly handle GLX_DRAWABLE_TYPE queries.

parent 71f41e5d
...@@ -615,6 +615,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf ...@@ -615,6 +615,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
int nAttribs = 0; int nAttribs = 0;
unsigned cur = 0; unsigned cur = 0;
int pop; int pop;
int drawattrib = 0;
int isColor = 0; int isColor = 0;
int wantColorBits = 0; int wantColorBits = 0;
int sz_alpha = 0; int sz_alpha = 0;
...@@ -692,25 +693,27 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf ...@@ -692,25 +693,27 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
case WGL_DRAW_TO_BITMAP_ARB: case WGL_DRAW_TO_BITMAP_ARB:
pop = iWGLAttr[++cur]; pop = iWGLAttr[++cur];
TRACE("pAttr[%d] = WGL_DRAW_TO_BITMAP_ARB: %d\n", cur, pop); 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) { if (pop) {
PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT); drawattrib |= GLX_PIXMAP_BIT;
TRACE("pAttr[%d] = GLX_DRAWABLE_TYPE: GLX_PIXMAP_BIT\n", cur);
} }
break; break;
case WGL_DRAW_TO_WINDOW_ARB: case WGL_DRAW_TO_WINDOW_ARB:
pop = iWGLAttr[++cur]; 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) { if (pop) {
PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT); drawattrib |= GLX_WINDOW_BIT;
TRACE("pAttr[%d] = GLX_DRAWABLE_TYPE: GLX_WINDOW_BIT\n", cur);
} }
break; break;
case WGL_DRAW_TO_PBUFFER_ARB: case WGL_DRAW_TO_PBUFFER_ARB:
pop = iWGLAttr[++cur]; 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) { if (pop) {
PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT); drawattrib |= GLX_PBUFFER_BIT;
TRACE("pAttr[%d] = GLX_DRAWABLE_TYPE: GLX_PBUFFER_BIT\n", cur);
} }
break; break;
...@@ -756,7 +759,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf ...@@ -756,7 +759,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
return -1; /** error: don't support it */ return -1; /** error: don't support it */
} else { } else {
PUSH2(oGLXAttr, GLX_X_RENDERABLE, pop); PUSH2(oGLXAttr, GLX_X_RENDERABLE, pop);
PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT); drawattrib |= GLX_PBUFFER_BIT;
} }
} }
break ; break ;
...@@ -807,6 +810,12 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf ...@@ -807,6 +810,12 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
TRACE("pAttr[%d] = WGL_COLOR_BITS_ARB: %d\n", cur, wantColorBits); 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; return nAttribs;
} }
...@@ -2433,6 +2442,7 @@ static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelF ...@@ -2433,6 +2442,7 @@ static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelF
curCfg = cfgs[fmt_index]; curCfg = cfgs[fmt_index];
hTest = pglXGetFBConfigAttrib(gdi_display, curCfg, curGLXAttr, piValues + i); hTest = pglXGetFBConfigAttrib(gdi_display, curCfg, curGLXAttr, piValues + i);
if (hTest) goto get_error; if (hTest) goto get_error;
curGLXAttr = 0;
} else { } else {
piValues[i] = GL_FALSE; piValues[i] = GL_FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment