mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Enable VSync to prevent screen tearing while scrolling across map
Fixes #2935
This commit is contained in:
parent
952c740c73
commit
73ea52c615
@ -275,7 +275,7 @@ void ScreenHandler::initializeWindow()
|
||||
}
|
||||
|
||||
//create first available renderer if preferred not set. Use no flags, so HW accelerated will be preferred but SW renderer also will possible
|
||||
mainRenderer = SDL_CreateRenderer(mainWindow, getPreferredRenderingDriver(), 0);
|
||||
mainRenderer = SDL_CreateRenderer(mainWindow, getPreferredRenderingDriver(), SDL_RENDERER_PRESENTVSYNC);
|
||||
|
||||
if(mainRenderer == nullptr)
|
||||
throw std::runtime_error("Unable to create renderer\n");
|
||||
@ -570,4 +570,4 @@ bool ScreenHandler::hasFocus()
|
||||
{
|
||||
ui32 flags = SDL_GetWindowFlags(mainWindow);
|
||||
return flags & SDL_WINDOW_INPUT_FOCUS;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user