Force SDL2's render-batching
SDL2 will implicitly disable batching if we force a specific rendering driver (apparently the user setting SDL_RENDER_DRIVER counts too) for backwards-compatibility with older programs that use their own rendering side-by-side with SDL2's. We don't do that, though, so this commit forces SDL2 to use batching if it's available (2.0.10 and onwards).
This commit is contained in:
parent
2fec50ff4e
commit
88c30442c5
1 changed files with 4 additions and 0 deletions
|
@ -72,6 +72,10 @@ Backend_Surface* Backend_Init(SDL_Window *window)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if SDL_VERSION_ATLEAST(2,0,10)
|
||||||
|
SDL_SetHint(SDL_HINT_RENDER_BATCHING, "1"); // We never interfere with the renderer, so don't let SDL implicitly disable batching
|
||||||
|
#endif
|
||||||
|
|
||||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
|
||||||
|
|
||||||
if (renderer == NULL)
|
if (renderer == NULL)
|
||||||
|
|
Loading…
Add table
Reference in a new issue