From 31d089633683ea2a2716651c3c48e1456cc595bf Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 16 Jul 2014 13:44:33 +0100 Subject: [PATCH] hw/xwin/glx: Fix a couple of typo bugs in indirect.c fbConfigToPixelFormatIndex()'s drawableTypeOverride parameter is a drawable type bitmask, not a drawable type enum value WGL_SWAP_COPY_ARB is a value of the WGL_SWAP_METHOD_ARB attribute for wglChoosePixelFormatARB(), not an attribute itself also remove duplicate error reporting for wglChoosePixelFormat() and fix a comment Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/indirect.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 6c0303322..70b9156cc 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -1120,7 +1120,6 @@ glxWinSetPixelFormat(__GLXWinContext * gc, HDC hdc, int bppOverride, fbConfigToPixelFormatIndex(hdc, gc->base.config, drawableTypeOverride, winScreen); if (pixelFormat == 0) { - ErrorF("wglChoosePixelFormat error: %s\n", glxWinErrorMessage()); return FALSE; } @@ -1303,7 +1302,7 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) glxWinScreen *winScreen; int pixelFormat; - // XXX: which DC are supposed to use??? + // XXX: which DC are we supposed to use??? HDC screenDC = GetDC(NULL); if (!(gc->base.config->drawableType & GLX_PBUFFER_BIT)) { @@ -1316,10 +1315,8 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) pixelFormat = fbConfigToPixelFormatIndex(screenDC, gc->base.config, - GLX_DRAWABLE_PBUFFER, winScreen); + GLX_PBUFFER_BIT, winScreen); if (pixelFormat == 0) { - ErrorF("wglChoosePixelFormat error: %s\n", - glxWinErrorMessage()); return; } @@ -1758,7 +1755,7 @@ fbConfigToPixelFormatIndex(HDC hdc, __GLXconfig * mode, SET_ATTR_VALUE(WGL_SWAP_METHOD_ARB, WGL_SWAP_EXCHANGE_ARB); if (mode->swapMethod == GLX_SWAP_COPY_OML) - SET_ATTR_VALUE(WGL_SWAP_COPY_ARB, TRUE); + SET_ATTR_VALUE(WGL_SWAP_METHOD_ARB, WGL_SWAP_COPY_ARB); // XXX: this should probably be the other way around, but that messes up drawableTypeOverride if (mode->visualRating == GLX_SLOW_VISUAL_EXT)