1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

WindowsWGL: use adaptive vsync when supported

This commit is contained in:
Rosalie Wanders 2021-09-24 18:26:12 +02:00 committed by Sergey Lipskiy
parent 82365ec389
commit bfe3c36e73

View File

@ -102,7 +102,15 @@ bool WindowsWGL::start()
if (strstr(wglextensions, "WGL_EXT_swap_control") != nullptr) {
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
wglSwapIntervalEXT(config.video.verticalSync);
// use adaptive vsync when supported and
// when vsync is enabled
if (strstr(wglextensions, "WGL_EXT_swap_control_tear") != nullptr &&
config.video.verticalSync > 0) {
wglSwapIntervalEXT(-1);
} else {
wglSwapIntervalEXT(config.video.verticalSync);
}
}
}