mirror of
https://github.com/encounter/SDL.git
synced 2025-12-20 10:25:28 +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:
@@ -519,6 +519,8 @@ extern void SDL_ToggleDragAndDropSupport(void);
|
||||
|
||||
extern int SDL_GetPointDisplayIndex(const SDL_Point * point);
|
||||
|
||||
extern int SDL_GL_SwapWindowWithResult(SDL_Window * window);
|
||||
|
||||
#endif /* SDL_sysvideo_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -4152,22 +4152,26 @@ SDL_GL_GetSwapInterval(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SDL_GL_SwapWindow(SDL_Window * window)
|
||||
int
|
||||
SDL_GL_SwapWindowWithResult(SDL_Window * window)
|
||||
{
|
||||
CHECK_WINDOW_MAGIC(window,);
|
||||
CHECK_WINDOW_MAGIC(window, -1);
|
||||
|
||||
if (!(window->flags & SDL_WINDOW_OPENGL)) {
|
||||
SDL_SetError("The specified window isn't an OpenGL window");
|
||||
return;
|
||||
return SDL_SetError("The specified window isn't an OpenGL window");
|
||||
}
|
||||
|
||||
if (SDL_GL_GetCurrentWindow() != window) {
|
||||
SDL_SetError("The specified window has not been made current");
|
||||
return;
|
||||
return SDL_SetError("The specified window has not been made current");
|
||||
}
|
||||
|
||||
_this->GL_SwapWindow(_this, window);
|
||||
return _this->GL_SwapWindow(_this, window);
|
||||
}
|
||||
|
||||
void
|
||||
SDL_GL_SwapWindow(SDL_Window * window)
|
||||
{
|
||||
SDL_GL_SwapWindowWithResult(window);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user