Disable SDL default render batches behaviour.

* Rendering in batches is default behaviour as of SDL 2.0.10 but causes rendering issues in Wesnoth.
* Fixes #4237
* Fixes #4245
* Not sure if #4309 may benefit as well
This commit is contained in:
Wedge009 2019-09-24 16:14:47 +10:00
parent 425802413b
commit 6436f90249

View file

@ -36,6 +36,10 @@ window::window(const std::string& title,
throw exception("Failed to create a SDL_Window object.", true);
}
// Rendering in batches (for efficiency) is enabled by default from SDL 2.0.10
// The way Wesnoth uses SDL as of September 2019 does not work well with this rendering mode (eg story-only scenarios)
SDL_SetHint(SDL_HINT_RENDER_BATCHING, "0");
if(!SDL_CreateRenderer(window_, -1, render_flags)) {
throw exception("Failed to create a SDL_Renderer object.", true);
}