Change scope of sdlayer lastSwapTime variable

git-svn-id: https://svn.eduke32.com/eduke32@7338 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-02-20 21:32:44 +00:00
parent 523121a995
commit a85b9e8259

View file

@ -1752,14 +1752,14 @@ void videoShowFrame(int32_t w)
glsurface_blitBuffer(); glsurface_blitBuffer();
} }
static uint32_t lastSwapTime = 0;
SDL_GL_SwapWindow(sdl_window); SDL_GL_SwapWindow(sdl_window);
if (vsync) if (vsync)
{ {
static uint32_t lastSwapTime = 0;
// busy loop until we're ready to update again // busy loop until we're ready to update again
while (SDL_GetTicks()-lastSwapTime < currentVBlankInterval) {} while (SDL_GetTicks()-lastSwapTime < currentVBlankInterval) {}
lastSwapTime = SDL_GetTicks();
} }
lastSwapTime = SDL_GetTicks();
return; return;
} }
#endif #endif