Wrap the SDL render batch hint with SDL version conditional.

This commit is contained in:
Wedge009 2019-09-24 16:59:16 +10:00
parent 8035c99b15
commit f9ad6073ea

View file

@ -36,9 +36,11 @@ window::window(const std::string& title,
throw exception("Failed to create a SDL_Window object.", true);
}
#if SDL_VERSION_ATLEAST(2, 0, 10)
// 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");
#endif
if(!SDL_CreateRenderer(window_, -1, render_flags)) {
throw exception("Failed to create a SDL_Renderer object.", true);