mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Win32: Bypass composition check on Windows 8+
DWM composition is always enabled on Windows 8 and later, so there's no need to call DwmIsCompositionEnabled on those platforms. Fixes #1452. Closes #1453.
This commit is contained in:
parent
297999c9e1
commit
87458617e0
@ -321,10 +321,12 @@ static void swapBuffersWGL(_GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
if (IsWindowsVistaOrGreater())
|
if (IsWindowsVistaOrGreater())
|
||||||
{
|
{
|
||||||
BOOL enabled;
|
// DWM Composition is always enabled on Win8+
|
||||||
|
BOOL enabled = IsWindows8OrGreater();
|
||||||
|
|
||||||
// HACK: Use DwmFlush when desktop composition is enabled
|
// HACK: Use DwmFlush when desktop composition is enabled
|
||||||
if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
if (enabled ||
|
||||||
|
(SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled))
|
||||||
{
|
{
|
||||||
int count = abs(window->context.wgl.interval);
|
int count = abs(window->context.wgl.interval);
|
||||||
while (count--)
|
while (count--)
|
||||||
@ -346,11 +348,13 @@ static void swapIntervalWGL(int interval)
|
|||||||
{
|
{
|
||||||
if (IsWindowsVistaOrGreater())
|
if (IsWindowsVistaOrGreater())
|
||||||
{
|
{
|
||||||
BOOL enabled;
|
// DWM Composition is always enabled on Win8+
|
||||||
|
BOOL enabled = IsWindows8OrGreater();
|
||||||
|
|
||||||
// HACK: Disable WGL swap interval when desktop composition is enabled to
|
// HACK: Disable WGL swap interval when desktop composition is enabled to
|
||||||
// avoid interfering with DWM vsync
|
// avoid interfering with DWM vsync
|
||||||
if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
if (enabled ||
|
||||||
|
(SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled))
|
||||||
interval = 0;
|
interval = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user