Charles Davis : winemac.drv: Actually make the GL context current even if no drawables were given.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Feb 19 08:56:21 CST 2016


Module: wine
Branch: master
Commit: 02416314ab6fb7238b28f0047089adfee4a52abd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=02416314ab6fb7238b28f0047089adfee4a52abd

Author: Charles Davis <cdavis5x at gmail.com>
Date:   Thu Feb 18 17:40:54 2016 -0700

winemac.drv: Actually make the GL context current even if no drawables were given.

The spec for GL_ARB_framebuffer_object (and thus, OpenGL 3.x and up) is
quite clear on what happens when a context is made current with no
drawable(s). In fact, the WGL_ARB_create_context extension amends
WGL_ARB_make_current_read (as well as the base spec for wglMakeCurrent)
specifically to allow this.

Signed-off-by: Charles Davis <cdavis5x at gmail.com>
Signed-off-by: Ken Thomases <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winemac.drv/cocoa_opengl.m | 3 +++
 dlls/winemac.drv/opengl.c       | 8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m
index ec2b191..4694dfd 100644
--- a/dlls/winemac.drv/cocoa_opengl.m
+++ b/dlls/winemac.drv/cocoa_opengl.m
@@ -235,7 +235,10 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
         }
 
         if (context)
+        {
             [context removeFromViews:YES];
+            [context makeCurrentContext];
+        }
     }
 
     [pool release];
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index ab79a82..f0c7048 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -3057,7 +3057,13 @@ static BOOL macdrv_wglMakeContextCurrentARB(HDC draw_hdc, HDC read_hdc, struct w
         return TRUE;
     }
 
-    if ((hwnd = WindowFromDC(draw_hdc)))
+    if (!draw_hdc && !read_hdc)
+    {
+        context->draw_hwnd = NULL;
+        context->draw_view = NULL;
+        context->draw_pbuffer = NULL;
+    }
+    else if ((hwnd = WindowFromDC(draw_hdc)))
     {
         if (!(data = get_win_data(hwnd)))
         {




More information about the wine-cvs mailing list