disabled VSYNC

This commit is contained in:
BADIM-PC\Vadim 2018-02-05 22:56:10 +03:00
parent eb4a66072a
commit 85748cf477
1 changed files with 4 additions and 19 deletions

View File

@ -839,7 +839,7 @@ s32 main(s32 argc, char **argv)
#elif defined(__EMSCRIPTEN__) #elif defined(__EMSCRIPTEN__)
SDL_RENDERER_ACCELERATED SDL_RENDERER_ACCELERATED
#else #else
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC//(getConfig()->useVsync ? SDL_RENDERER_PRESENTVSYNC : 0) SDL_RENDERER_ACCELERATED// | (getConfig()->useVsync ? SDL_RENDERER_PRESENTVSYNC : 0)
#endif #endif
); );
@ -853,18 +853,6 @@ s32 main(s32 argc, char **argv)
emscripten_set_main_loop(emstick, TIC_FRAMERATE, 1); emscripten_set_main_loop(emstick, TIC_FRAMERATE, 1);
#else #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(); u64 nextTick = SDL_GetPerformanceCounter();
const u64 Delta = SDL_GetPerformanceFrequency() / TIC_FRAMERATE; const u64 Delta = SDL_GetPerformanceFrequency() / TIC_FRAMERATE;
@ -885,8 +873,6 @@ s32 main(s32 argc, char **argv)
platform.missedFrame = true; platform.missedFrame = true;
} }
else else
{
if(useDelay || SDL_GetWindowFlags(platform.window) & SDL_WINDOW_MINIMIZED)
{ {
u32 time = (u32)(delay * 1000 / SDL_GetPerformanceFrequency()); u32 time = (u32)(delay * 1000 / SDL_GetPerformanceFrequency());
if(time >= 10) if(time >= 10)
@ -895,7 +881,6 @@ s32 main(s32 argc, char **argv)
} }
} }
} }
}
#endif #endif