mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-01 09:27:39 +00:00
Added support for simulated vsync in the renderer
This kicks in if the platform doesn't support vsync directly, or if the present fails for some reason (e.g. minimized on some platforms) Fixes https://github.com/libsdl-org/SDL/issues/5134
This commit is contained in:
parent
339f7a2f6b
commit
d744aafb05
15 changed files with 115 additions and 37 deletions
|
@ -983,14 +983,15 @@ SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
format, pixels, pitch);
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
SW_RenderPresent(SDL_Renderer * renderer)
|
||||
{
|
||||
SDL_Window *window = renderer->window;
|
||||
|
||||
if (window) {
|
||||
SDL_UpdateWindowSurface(window);
|
||||
if (!window) {
|
||||
return -1;
|
||||
}
|
||||
return SDL_UpdateWindowSurface(window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue