mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Enable VSync to prevent screen tearing while scrolling across map
Fixes #2935
This commit is contained in:
committed by
Alexander Wilms
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
|
//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)
|
if(mainRenderer == nullptr)
|
||||||
throw std::runtime_error("Unable to create renderer\n");
|
throw std::runtime_error("Unable to create renderer\n");
|
||||||
@@ -570,4 +570,4 @@ bool ScreenHandler::hasFocus()
|
|||||||
{
|
{
|
||||||
ui32 flags = SDL_GetWindowFlags(mainWindow);
|
ui32 flags = SDL_GetWindowFlags(mainWindow);
|
||||||
return flags & SDL_WINDOW_INPUT_FOCUS;
|
return flags & SDL_WINDOW_INPUT_FOCUS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user