No subject


Tue Aug 30 17:20:58 CDT 2005


trace:opengl:X11DRV_SwapBuffers (0x403d55e0)
trace:opengl:wglMakeCurrent ((nil),(nil))
X Error of failed request:  GLXBadDrawable

As the glXSwapBuffers call may return before the buffer swap is actually
done in hardware, it may happen that the driver does not handle properly an
application which unsets the current context before the actual swap is done
in the background.

Could you try to see if the attached 'hack' fixes the issue ? If yes, this
may be a bug in NVIDIA's GL drivers, if not, we will need to investigate a
bit more :-)

         Lionel

-- 
		 Lionel Ulmer - http://www.bbrox.org/

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="HACK.txt"

Index: dlls/opengl32/wgl.c
===================================================================
RCS file: /home/wine/wine/dlls/opengl32/wgl.c,v
retrieving revision 1.48
diff -u -r1.48 wgl.c
--- dlls/opengl32/wgl.c	25 Feb 2004 01:25:49 -0000	1.48
+++ dlls/opengl32/wgl.c	7 Apr 2004 20:50:34 -0000
@@ -414,6 +414,8 @@
 /***********************************************************************
  *		wglMakeCurrent (OPENGL32.@)
  */
+static HGLRC current_context;
+
 BOOL WINAPI wglMakeCurrent(HDC hdc,
 			   HGLRC hglrc) {
   BOOL ret;
@@ -422,6 +424,12 @@
 
   ENTER_GL();
   if (hglrc == NULL) {
+      if (current_context != NULL) {
+	  /* At least, when putting all three of them, I will be sure to handle all cases :-) */
+	  glXWaitGL();
+	  glXWaitX();
+	  glFinish();
+      }
       ret = glXMakeCurrent(default_display, None, NULL);
   } else {
       Wine_GLContext *ctx = (Wine_GLContext *) hglrc;
@@ -433,6 +441,9 @@
       }
       ret = glXMakeCurrent(ctx->display, drawable, ctx->ctx);
   }
+
+  current_context = hglrc;
+  
   LEAVE_GL();
   TRACE(" returning %s\n", (ret ? "True" : "False"));
   return ret;

--ikeVEW9yuYc//A+q--



More information about the wine-devel mailing list