We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GX2SetSwapInterval
1 parent 114280c commit 01e8ceeCopy full SHA for 01e8cee
1 file changed
src/render/wiiu/SDL_rpresent_wiiu.c
@@ -38,9 +38,21 @@ static SDL_bool tvDrcEnabled = SDL_FALSE;
38
39
int WIIU_SDL_SetVSync(SDL_Renderer * renderer, const int vsync)
40
{
41
- GX2SetSwapInterval(vsync ? 1 : 0);
+ WIIU_VideoData *videodata = (WIIU_VideoData *) SDL_GetVideoDevice()->driverdata;
42
+ uint32_t swapInterval = vsync ? 1 : 0;
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
51
52
53
+ GX2SetSwapInterval(swapInterval);
54
55
+ if (swapInterval > 0) {
56
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
57
} else {
58
renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;
0 commit comments