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
|
@ -22,6 +22,7 @@
|
|||
|
||||
#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
|
||||
#include "SDL_hints.h"
|
||||
#include "../../video/SDL_sysvideo.h" /* For SDL_GL_SwapWindowWithResult */
|
||||
#include "SDL_opengl.h"
|
||||
#include "../SDL_sysrender.h"
|
||||
#include "SDL_shaders_gl.h"
|
||||
|
@ -1502,12 +1503,12 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
GL_RenderPresent(SDL_Renderer * renderer)
|
||||
{
|
||||
GL_ActivateRenderer(renderer);
|
||||
|
||||
SDL_GL_SwapWindow(renderer->window);
|
||||
return SDL_GL_SwapWindowWithResult(renderer->window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue