Commit 2cc53379 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Consolidate code paths for clearing the OpenGL context.

We clear it if the context or the view is NULL. If the context is non-NULL, we want to disassociate the views of both the current and passed-in contexts, if they differ.
parent d57a99b4
......@@ -154,11 +154,9 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
WineOpenGLContext *context = (WineOpenGLContext*)c;
NSView* view = (NSView*)v;
if (context)
if (context && view)
{
[context removeFromViews:NO];
if (view)
{
macdrv_add_view_opengl_context(v, c);
if (context.needsUpdate)
......@@ -181,19 +179,17 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
}
else
{
[WineOpenGLContext clearCurrentContext];
[context removeFromViews:YES];
}
}
else
{
WineOpenGLContext* currentContext = (WineOpenGLContext*)[WineOpenGLContext currentContext];
if ([currentContext isKindOfClass:[WineOpenGLContext class]])
{
[WineOpenGLContext clearCurrentContext];
if (currentContext != context)
[currentContext removeFromViews:YES];
}
if (context)
[context removeFromViews:YES];
}
[pool release];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment