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@gmail.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Charles Davis 2016-02-18 17:40:54 -07:00 committed by Alexandre Julliard
parent 7dd90faaa3
commit 02416314ab
2 changed files with 10 additions and 1 deletions

View File

@ -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];

View File

@ -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)))
{