fixed screen rotation for newer SDL versions on Android
authorHolger Schemel <info@artsoft.org>
Tue, 14 Jul 2020 21:18:56 +0000 (23:18 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 14 Jul 2020 21:32:58 +0000 (23:32 +0200)
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
src/libgame/sdl.h

index d271951eb5dc84cdab120c47ce9d30510012f7c9..add67e5b06afe4f6575cf1668d8eb213885deb8e 100644 (file)
@@ -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
index c49894f6836deb17a4ad7f0a883cfbc3da74a3fb..acdafd5b8eb2f8327bef9b82658524ff361fcedf 100644 (file)
@@ -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)