From 85748cf477582b35fff40c82ce0932d859155bbe Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Mon, 5 Feb 2018 22:56:10 +0300 Subject: [PATCH] disabled VSYNC --- src/main.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/main.c b/src/main.c index e33a7b2..83b2f50 100644 --- a/src/main.c +++ b/src/main.c @@ -839,7 +839,7 @@ s32 main(s32 argc, char **argv) #elif defined(__EMSCRIPTEN__) SDL_RENDERER_ACCELERATED #else - SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC//(getConfig()->useVsync ? SDL_RENDERER_PRESENTVSYNC : 0) + SDL_RENDERER_ACCELERATED// | (getConfig()->useVsync ? SDL_RENDERER_PRESENTVSYNC : 0) #endif ); @@ -853,18 +853,6 @@ s32 main(s32 argc, char **argv) emscripten_set_main_loop(emstick, TIC_FRAMERATE, 1); #else { - - bool useDelay = false; - { - SDL_RendererInfo info; - SDL_DisplayMode mode; - - SDL_GetRendererInfo(platform.renderer, &info); - SDL_GetCurrentDisplayMode(SDL_GetWindowDisplayIndex(platform.window), &mode); - - useDelay = !(info.flags & SDL_RENDERER_PRESENTVSYNC) || mode.refresh_rate > TIC_FRAMERATE; - } - u64 nextTick = SDL_GetPerformanceCounter(); const u64 Delta = SDL_GetPerformanceFrequency() / TIC_FRAMERATE; @@ -886,12 +874,9 @@ s32 main(s32 argc, char **argv) } else { - if(useDelay || SDL_GetWindowFlags(platform.window) & SDL_WINDOW_MINIMIZED) - { - u32 time = (u32)(delay * 1000 / SDL_GetPerformanceFrequency()); - if(time >= 10) - SDL_Delay(time); - } + u32 time = (u32)(delay * 1000 / SDL_GetPerformanceFrequency()); + if(time >= 10) + SDL_Delay(time); } } }