diff --git a/android/native/jni/android_general.h b/android/native/jni/android_general.h index 0d34d098c8..3a48c3b8ab 100644 --- a/android/native/jni/android_general.h +++ b/android/native/jni/android_general.h @@ -34,6 +34,7 @@ struct droid unsigned width; unsigned height; struct saved_state state; + int32_t last_orient; }; extern struct droid g_android; diff --git a/android/native/jni/main.c b/android/native/jni/main.c index 7154cea0ee..c902e23f63 100644 --- a/android/native/jni/main.c +++ b/android/native/jni/main.c @@ -385,7 +385,17 @@ static void* android_app_entry(void* param) RARCH_LOG("Initializing succeeded.\n"); RARCH_LOG("RetroArch started.\n"); rarch_init_msg_queue(); - while (rarch_main_iterate()); + g_android.last_orient = AConfiguration_getOrientation(android_app->config); + while (rarch_main_iterate()) + { + if (AConfiguration_getOrientation(android_app->config) != g_android.last_orient) + { + // reinit video driver for new window dimensions + driver.video->free(driver.video_data); + init_video_input(); + g_android.last_orient = AConfiguration_getOrientation(android_app->config); + } + } RARCH_LOG("RetroArch stopped.\n"); } diff --git a/android/phoenix/AndroidManifest.xml b/android/phoenix/AndroidManifest.xml index 076e71a440..cbb8bace7d 100644 --- a/android/phoenix/AndroidManifest.xml +++ b/android/phoenix/AndroidManifest.xml @@ -19,7 +19,7 @@ - +