mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-09 09:48:43 +00:00
Only skip SDL_RENDERER_PRESENTVSYNC on Windows
macOS can still tear when using the Metal renderer backend.
This commit is contained in:
parent
21bba02e6f
commit
aaff04167b
1 changed files with 6 additions and 4 deletions
|
@ -98,10 +98,12 @@ bool SdlRenderer::initialize(PDECODER_PARAMETERS params)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((SDL_GetWindowFlags(params->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN) {
|
#ifdef Q_OS_WIN32
|
||||||
// In full-screen exclusive mode, we enable V-sync if requested. For other modes, Windows and Mac
|
// The Windows DWM has tear-free behavior even with V-Sync off, so we will only set SDL_RENDERER_PRESENTVSYNC
|
||||||
// have compositors that make rendering tear-free. Linux compositor varies by distro and user
|
// when we're in full-screen exclusive mode if we're running on Windows.
|
||||||
// configuration but doesn't seem feasible to detect here.
|
if ((SDL_GetWindowFlags(params->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
if (params->enableVsync) {
|
if (params->enableVsync) {
|
||||||
rendererFlags |= SDL_RENDERER_PRESENTVSYNC;
|
rendererFlags |= SDL_RENDERER_PRESENTVSYNC;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue