[PATCH 4/4] winex11.drv: Print the error in wglCreateContextAttribsARB() when context creation fails. (try 2)

Matteo Bruni mbruni at codeweavers.com
Fri Apr 19 12:06:15 CDT 2013


---
 dlls/winex11.drv/opengl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 2313eca..6dd07fa 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1925,6 +1925,7 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg
 {
     struct wgl_context *ret = NULL;
     struct gl_drawable *gl;
+    int err = 0;
 
     TRACE("(%p %p %p)\n", hdc, hShareContext, attribList);
 
@@ -1983,10 +1984,10 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg
         X11DRV_expect_error(gdi_display, GLXErrorHandler, NULL);
         ret->ctx = create_glxcontext(gdi_display, ret, NULL);
         XSync(gdi_display, False);
-        if (X11DRV_check_error() || !ret->ctx)
+        if ((err = X11DRV_check_error()) || !ret->ctx)
         {
             /* In the future we should convert the GLX error to a win32 one here if needed */
-            ERR("Context creation failed\n");
+            ERR("Context creation failed (error %x)\n", err);
             HeapFree( GetProcessHeap(), 0, ret );
             ret = NULL;
         }
-- 
1.8.1.5




More information about the wine-patches mailing list