Backport simplify flags PR #7220

This commit is contained in:
Sylvain
2023-02-04 15:51:37 +01:00
committed by Sam Lantinga
parent f71178a16f
commit 17515f4aef
40 changed files with 176 additions and 175 deletions

View File

@@ -1015,10 +1015,10 @@ SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags)
}
}
if ((flags & SDL_RENDERER_PRESENTVSYNC) != 0) {
if (flags & SDL_RENDERER_PRESENTVSYNC) {
renderer->wanted_vsync = SDL_TRUE;
if ((renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) == 0) {
if (!(renderer->info.flags & SDL_RENDERER_PRESENTVSYNC)) {
renderer->simulate_vsync = SDL_TRUE;
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
}

View File

@@ -2364,7 +2364,7 @@ D3D11_CreateRenderer(SDL_Window *window, Uint32 flags)
*/
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
#else
if ((flags & SDL_RENDERER_PRESENTVSYNC)) {
if (flags & SDL_RENDERER_PRESENTVSYNC) {
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
}
renderer->SetVSync = D3D11_SetVSync;

View File

@@ -2997,7 +2997,7 @@ D3D12_CreateRenderer(SDL_Window *window, Uint32 flags)
renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
renderer->driverdata = data;
if ((flags & SDL_RENDERER_PRESENTVSYNC)) {
if (flags & SDL_RENDERER_PRESENTVSYNC) {
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
}
renderer->SetVSync = D3D12_SetVSync;