winemac: Force swap interval to 0 for single-buffered contexts to avoid vsync'ed flushes.
This commit is contained in:
parent
d30705bdfe
commit
967a49fcb2
|
@ -2901,7 +2901,9 @@ static BOOL macdrv_wglSwapIntervalEXT(int interval)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (interval > 1)
|
||||
if (!pixel_formats[context->format - 1].double_buffer)
|
||||
interval = 0;
|
||||
else if (interval > 1)
|
||||
interval = 1;
|
||||
|
||||
value = interval;
|
||||
|
@ -3238,8 +3240,14 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share)
|
|||
}
|
||||
|
||||
/* According to the WGL_EXT_swap_control docs, the default swap interval for
|
||||
a context is 1. CGL contexts default to 0, so we need to set it. */
|
||||
swap_interval = 1;
|
||||
a context is 1. CGL contexts default to 0, so we need to set it. This
|
||||
only make sense for double-buffered contexts, though. In theory, for
|
||||
single-buffered contexts, there's no such thing as a swap. But OS X
|
||||
will synchronize flushes of single-buffered contexts if this is set. */
|
||||
if (pf->double_buffer)
|
||||
swap_interval = 1;
|
||||
else
|
||||
swap_interval = 0;
|
||||
err = CGLSetParameter(context->cglcontext, kCGLCPSwapInterval, (GLint*)&swap_interval);
|
||||
if (err != kCGLNoError)
|
||||
WARN("CGLSetParameter(kCGLCPSwapInterval) failed with error %d %s; leaving un-vsynced\n", err, CGLErrorString(err));
|
||||
|
|
Loading…
Reference in New Issue