mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 00:49:48 +00:00
Use DwmFlush when DWM is enabled.
Use DwmFlush instead of WGL_EXT_swap_control when desktop compositing is enabled, to avoid the jitter of DWM and WGL vsync fighting. Fixes #516.
This commit is contained in:
+6
-9
@@ -565,15 +565,12 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
|
||||
case WM_DWMCOMPOSITIONCHANGED:
|
||||
{
|
||||
if (_glfwIsCompositionEnabled())
|
||||
{
|
||||
_GLFWwindow* previous = _glfwPlatformGetCurrentContext();
|
||||
_glfwPlatformMakeContextCurrent(window);
|
||||
_glfwPlatformSwapInterval(0);
|
||||
_glfwPlatformMakeContextCurrent(previous);
|
||||
}
|
||||
|
||||
// TODO: Restore vsync if compositing was disabled
|
||||
// HACK: Re-apply interval when desktop composition is toggled to
|
||||
// ensure WGL swap interval is disabled when necessary
|
||||
_GLFWwindow* previous = _glfwPlatformGetCurrentContext();
|
||||
_glfwPlatformMakeContextCurrent(window);
|
||||
_glfwPlatformSwapInterval(window->wgl.interval);
|
||||
_glfwPlatformMakeContextCurrent(previous);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user