From 82666a1875d3c2072e721a9aa08026ed83e28797 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 8 Jul 2020 21:42:57 -0400 Subject: [PATCH] Set both filter and vsync hints with override priority --- desktop_version/src/Screen.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index 8ed3fa59..a62e60ef 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -38,7 +38,17 @@ void Screen::init( filterSubrect.y = 1; filterSubrect.w = 318; filterSubrect.h = 238; - SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, isFiltered ? "linear" : "nearest"); + + SDL_SetHintWithPriority( + SDL_HINT_RENDER_SCALE_QUALITY, + isFiltered ? "linear" : "nearest", + SDL_HINT_OVERRIDE + ); + SDL_SetHintWithPriority( + SDL_HINT_RENDER_VSYNC, + vsync ? "1" : "0", + SDL_HINT_OVERRIDE + ); // Uncomment this next line when you need to debug -flibit // SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, "software", SDL_HINT_OVERRIDE); @@ -287,7 +297,11 @@ void Screen::toggleStretchMode() void Screen::toggleLinearFilter() { isFiltered = !isFiltered; - SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, isFiltered ? "linear" : "nearest"); + SDL_SetHintWithPriority( + SDL_HINT_RENDER_SCALE_QUALITY, + isFiltered ? "linear" : "nearest", + SDL_HINT_OVERRIDE + ); SDL_DestroyTexture(m_screenTexture); m_screenTexture = SDL_CreateTexture( m_renderer,