Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/render/wiiu/SDL_rpresent_wiiu.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ static SDL_bool tvDrcEnabled = SDL_FALSE;

int WIIU_SDL_SetVSync(SDL_Renderer * renderer, const int vsync)
{
GX2SetSwapInterval(vsync ? 1 : 0);
WIIU_VideoData *videodata = (WIIU_VideoData *) SDL_GetVideoDevice()->driverdata;
uint32_t swapInterval = vsync ? 1 : 0;

if (GX2GetSwapInterval() > 0) {
// Don't attempt to update swap interval if in background
if (!videodata->hasForeground) {
return 0;
}

if (GX2GetSwapInterval() == swapInterval) {
return 0;
}

GX2SetSwapInterval(swapInterval);

if (swapInterval > 0) {
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
} else {
renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;
Expand Down
Loading