File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,21 @@ static SDL_bool tvDrcEnabled = SDL_FALSE;
3838
3939int WIIU_SDL_SetVSync (SDL_Renderer * renderer , const int vsync )
4040{
41- GX2SetSwapInterval (vsync ? 1 : 0 );
41+ WIIU_VideoData * videodata = (WIIU_VideoData * ) SDL_GetVideoDevice ()-> driverdata ;
42+ uint32_t swapInterval = vsync ? 1 : 0 ;
4243
43- if (GX2GetSwapInterval () > 0 ) {
44+ // Don't attempt to update swap interval if in background
45+ if (!videodata -> hasForeground ) {
46+ return 0 ;
47+ }
48+
49+ if (GX2GetSwapInterval () == swapInterval ) {
50+ return 0 ;
51+ }
52+
53+ GX2SetSwapInterval (swapInterval );
54+
55+ if (swapInterval > 0 ) {
4456 renderer -> info .flags |= SDL_RENDERER_PRESENTVSYNC ;
4557 } else {
4658 renderer -> info .flags &= ~SDL_RENDERER_PRESENTVSYNC ;
You can’t perform that action at this time.
0 commit comments