mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-02 16:08:30 +00:00
Simplify flags testing (#7220)
This commit is contained in:
@@ -868,10 +868,10 @@ SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name, Uint32 fl
|
||||
goto error;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@@ -294,7 +294,7 @@ static int D3D_ActivateRenderer(SDL_Renderer *renderer)
|
||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||
data->pparams.BackBufferWidth = w;
|
||||
data->pparams.BackBufferHeight = h;
|
||||
if ((SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) != 0) {
|
||||
if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) {
|
||||
fullscreen_mode = SDL_GetWindowFullscreenMode(window);
|
||||
}
|
||||
if (fullscreen_mode) {
|
||||
@@ -1606,7 +1606,7 @@ D3D_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
renderer->driverdata = data;
|
||||
|
||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||
if ((SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) != 0) {
|
||||
if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) {
|
||||
fullscreen_mode = SDL_GetWindowFullscreenMode(window);
|
||||
}
|
||||
|
||||
|
@@ -2355,7 +2355,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;
|
||||
|
@@ -2991,7 +2991,7 @@ D3D12_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
renderer->info.flags = SDL_RENDERER_ACCELERATED;
|
||||
renderer->driverdata = data;
|
||||
|
||||
if ((flags & SDL_RENDERER_PRESENTVSYNC)) {
|
||||
if (flags & SDL_RENDERER_PRESENTVSYNC) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
renderer->SetVSync = D3D12_SetVSync;
|
||||
|
Reference in New Issue
Block a user