wgl: Fix a violation of the GLX specs in ConvertAttribWGLtoGLX.

Nvidia and Mesa ignore GLX_RENDER_TYPE when it is set to an invalid
value like 0 but AMD for instance doesn't, which is legal.
This commit is contained in:
Roderick Colenbrander 2009-11-11 16:27:43 +01:00 committed by Alexandre Julliard
parent f4a5294c89
commit 521598560e
1 changed files with 4 additions and 2 deletions

View File

@ -600,7 +600,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
int pop;
int drawattrib = 0;
int nvfloatattrib = GLX_DONT_CARE;
int pixelattrib = 0;
int pixelattrib = ~0;
/* The list of WGL attributes is allowed to be NULL. We don't return here for NULL
* because we need to do fixups for GLX_DRAWABLE_TYPE/GLX_RENDER_TYPE/GLX_FLOAT_COMPONENTS_NV. */
@ -801,7 +801,9 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, drawattrib);
TRACE("pAttr[?] = GLX_DRAWABLE_TYPE: %#x\n", drawattrib);
/* Set GLX_RENDER_TYPE all the time */
/* By default glXChooseFBConfig uses GLX_RGBA_BIT as the default value. Since wglChoosePixelFormatARB
* searches in all formats we have to do the same. For this reason we set GLX_RENDER_TYPE to ~0 unless
* it is overridden. */
PUSH2(oGLXAttr, GLX_RENDER_TYPE, pixelattrib);
TRACE("pAttr[?] = GLX_RENDER_TYPE: %#x\n", pixelattrib);