From aff7fb95675072451fcf25e8c0199923b0687027 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 14 Jul 2020 23:18:56 +0200 Subject: [PATCH] fixed screen rotation for newer SDL versions on Android Using the previous code with newer SDL versions on Android, screen rotation did not work anymore, because the "resizable" flag seems to be needed even when creating fullscreen surfaces to correctly detect device rotation in recent SDL versions. This was fixed by always using the "resizable" flag, regardless of windowed or fullscreen surfaces on all platforms. --- src/libgame/sdl.c | 2 +- src/libgame/sdl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index d271951e..add67e5b 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -497,7 +497,7 @@ static boolean SDLCreateScreen(boolean fullscreen) { SDL_Surface *new_surface = NULL; - int surface_flags_window = SURFACE_FLAGS | SDL_WINDOW_RESIZABLE; + int surface_flags_window = SURFACE_FLAGS; int surface_flags_fullscreen = SURFACE_FLAGS | SDL_WINDOW_FULLSCREEN_DESKTOP; #if 1 diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index c49894f6..acdafd5b 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -23,7 +23,7 @@ // definitions needed for "system.c" -#define SURFACE_FLAGS (0) +#define SURFACE_FLAGS (SDL_WINDOW_RESIZABLE) #define SET_TRANSPARENT_PIXEL (SDL_TRUE) #define UNSET_TRANSPARENT_PIXEL (SDL_FALSE) -- 2.34.1