|
@@ -322,14 +322,12 @@ static void swapBuffersWGL(_GLFWwindow* window)
|
|
|
{
|
|
|
if (!window->monitor)
|
|
|
{
|
|
|
- if (IsWindowsVistaOrGreater())
|
|
|
+ // HACK: Use DwmFlush when desktop composition is enabled on Windows Vista and 7
|
|
|
+ if (!IsWindows8OrGreater() && IsWindowsVistaOrGreater())
|
|
|
{
|
|
|
- // DWM Composition is always enabled on Win8+
|
|
|
- BOOL enabled = IsWindows8OrGreater();
|
|
|
+ BOOL enabled = FALSE;
|
|
|
|
|
|
- // HACK: Use DwmFlush when desktop composition is enabled
|
|
|
- if (enabled ||
|
|
|
- (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled))
|
|
|
+ if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
|
|
{
|
|
|
int count = abs(window->context.wgl.interval);
|
|
|
while (count--)
|
|
@@ -349,15 +347,13 @@ static void swapIntervalWGL(int interval)
|
|
|
|
|
|
if (!window->monitor)
|
|
|
{
|
|
|
- if (IsWindowsVistaOrGreater())
|
|
|
+ // HACK: Disable WGL swap interval when desktop composition is enabled on Windows
|
|
|
+ // Vista and 7 to avoid interfering with DWM vsync
|
|
|
+ if (!IsWindows8OrGreater() && IsWindowsVistaOrGreater())
|
|
|
{
|
|
|
- // DWM Composition is always enabled on Win8+
|
|
|
- BOOL enabled = IsWindows8OrGreater();
|
|
|
+ BOOL enabled = FALSE;
|
|
|
|
|
|
- // HACK: Disable WGL swap interval when desktop composition is enabled to
|
|
|
- // avoid interfering with DWM vsync
|
|
|
- if (enabled ||
|
|
|
- (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled))
|
|
|
+ if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
|
|
interval = 0;
|
|
|
}
|
|
|
}
|