mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-05 05:24:42 +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:
@@ -23,6 +23,7 @@
|
||||
#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
|
||||
|
||||
#include "SDL_hints.h"
|
||||
#include "../../video/SDL_sysvideo.h" /* For SDL_GL_SwapWindowWithResult */
|
||||
#include "SDL_opengles2.h"
|
||||
#include "../SDL_sysrender.h"
|
||||
#include "../../video/SDL_blit.h"
|
||||
@@ -1983,11 +1984,11 @@ GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
GLES2_RenderPresent(SDL_Renderer *renderer)
|
||||
{
|
||||
/* Tell the video driver to swap buffers */
|
||||
SDL_GL_SwapWindow(renderer->window);
|
||||
return SDL_GL_SwapWindowWithResult(renderer->window);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user