mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 13:35:40 +00:00
Fixed SDL_RenderSetVSync does not update flags if simulated vsync is on
This lets the user to correctly detect current vsync state by reading SDL_RendererInfo. Also fixes SetVSync's return value check (it may be positive for error too).
This commit is contained in:
parent
446e0943da
commit
d78072fcd4
|
@ -4510,8 +4510,13 @@ int SDL_RenderSetVSync(SDL_Renderer *renderer, int vsync)
|
|||
renderer->wanted_vsync = vsync ? SDL_TRUE : SDL_FALSE;
|
||||
|
||||
if (!renderer->SetVSync ||
|
||||
renderer->SetVSync(renderer, vsync) < 0) {
|
||||
renderer->SetVSync(renderer, vsync) != 0) {
|
||||
renderer->simulate_vsync = vsync ? SDL_TRUE : SDL_FALSE;
|
||||
if (renderer->simulate_vsync) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
} else {
|
||||
renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
} else {
|
||||
renderer->simulate_vsync = SDL_FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue