Signed-off-by: Ken Thomases ken@codeweavers.com --- dlls/winemac.drv/opengl.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index d83a4ce..c3c2bee 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -1539,8 +1539,7 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns } context->major = major;
- if (allow_vsync) - InterlockedExchange(&context->update_swap_interval, TRUE); + InterlockedExchange(&context->update_swap_interval, TRUE);
TRACE("created context %p/%p/%p\n", context, context->context, context->cglcontext);
@@ -1742,7 +1741,9 @@ static void sync_swap_interval(struct wgl_context *context) { int interval;
- if (context->draw_hwnd) + if (!allow_vsync) + interval = 0; + else if (context->draw_hwnd) { struct macdrv_win_data *data = get_win_data(context->draw_hwnd); if (data) @@ -3478,7 +3479,7 @@ static int macdrv_wglGetSwapIntervalEXT(void) release_win_data(data);
if (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE)) - set_swap_interval(context, value); + set_swap_interval(context, allow_vsync ? value : 0); } else { @@ -3543,8 +3544,8 @@ static BOOL macdrv_wglMakeContextCurrentARB(HDC draw_hdc, HDC read_hdc, struct w return FALSE; }
- if (allow_vsync && (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE) || hwnd != context->draw_hwnd)) - set_swap_interval(context, data->swap_interval); + if (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE) || hwnd != context->draw_hwnd) + set_swap_interval(context, allow_vsync ? data->swap_interval : 0);
context->draw_hwnd = hwnd; context->draw_view = data->client_cocoa_view; @@ -3569,8 +3570,7 @@ static BOOL macdrv_wglMakeContextCurrentARB(HDC draw_hdc, HDC read_hdc, struct w return FALSE; }
- if (allow_vsync && - (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE) || pbuffer != context->draw_pbuffer)) + if (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE) || pbuffer != context->draw_pbuffer) set_swap_interval(context, 0); } else @@ -4115,6 +4115,9 @@ static BOOL macdrv_wglSwapIntervalEXT(int interval) else /* pbuffer */ interval = 0;
+ if (!allow_vsync) + interval = 0; + InterlockedExchange(&context->update_swap_interval, FALSE); if (!set_swap_interval(context, interval)) {