mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-10 13:28:15 +00:00
render: GL-based renderers should treat adaptive vsync as vsync being enabled.
Fixes #8004.
This commit is contained in:
@@ -1701,7 +1701,7 @@ static int GL_SetVSync(SDL_Renderer *renderer, const int vsync)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interval > 0) {
|
if (interval != 0) {
|
||||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||||
} else {
|
} else {
|
||||||
renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;
|
renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;
|
||||||
@@ -1850,12 +1850,10 @@ static SDL_Renderer *GL_CreateRenderer(SDL_Window *window, SDL_PropertiesID crea
|
|||||||
int interval = 0;
|
int interval = 0;
|
||||||
if (SDL_GL_GetSwapInterval(&interval) < 0) {
|
if (SDL_GL_GetSwapInterval(&interval) < 0) {
|
||||||
/* Error */
|
/* Error */
|
||||||
} else {
|
} else if (interval != 0) {
|
||||||
if (interval > 0) {
|
|
||||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for debug output support */
|
/* Check for debug output support */
|
||||||
if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_FLAGS, &value) == 0 &&
|
if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_FLAGS, &value) == 0 &&
|
||||||
|
@@ -1988,7 +1988,7 @@ static int GLES2_SetVSync(SDL_Renderer *renderer, const int vsync)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interval > 0) {
|
if (interval != 0) {
|
||||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||||
} else {
|
} else {
|
||||||
renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;
|
renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;
|
||||||
@@ -2151,12 +2151,10 @@ static SDL_Renderer *GLES2_CreateRenderer(SDL_Window *window, SDL_PropertiesID c
|
|||||||
int interval = 0;
|
int interval = 0;
|
||||||
if (SDL_GL_GetSwapInterval(&interval) < 0) {
|
if (SDL_GL_GetSwapInterval(&interval) < 0) {
|
||||||
/* Error */
|
/* Error */
|
||||||
} else {
|
} else if (interval != 0) {
|
||||||
if (interval > 0) {
|
|
||||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for debug output support */
|
/* Check for debug output support */
|
||||||
if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_FLAGS, &value) == 0 &&
|
if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_FLAGS, &value) == 0 &&
|
||||||
|
Reference in New Issue
Block a user