mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(Android) Move video reinit code to EGL check_window function -
now properly resizes video after orientation change and restores video context after minimizing and restoring
This commit is contained in:
parent
b2cd86c047
commit
0dce6a6db6
@ -395,10 +395,11 @@ static void* android_app_entry(void* param)
|
|||||||
g_android.input_state |= (1ULL << RARCH_QUIT_KEY);
|
g_android.input_state |= (1ULL << RARCH_QUIT_KEY);
|
||||||
g_android.input_state |= (1ULL << RARCH_KILL);
|
g_android.input_state |= (1ULL << RARCH_KILL);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
RARCH_LOG("Initializing succeeded.\n");
|
||||||
|
|
||||||
if (init_ret == 0)
|
if (init_ret == 0)
|
||||||
{
|
{
|
||||||
RARCH_LOG("Initializing succeeded.\n");
|
|
||||||
RARCH_LOG("RetroArch started.\n");
|
RARCH_LOG("RetroArch started.\n");
|
||||||
rarch_init_msg_queue();
|
rarch_init_msg_queue();
|
||||||
g_android.last_orient = AConfiguration_getOrientation(android_app->config);
|
g_android.last_orient = AConfiguration_getOrientation(android_app->config);
|
||||||
@ -407,24 +408,7 @@ static void* android_app_entry(void* param)
|
|||||||
while(g_android.activity_paused)
|
while(g_android.activity_paused)
|
||||||
{
|
{
|
||||||
if(!android_run_events(android_app))
|
if(!android_run_events(android_app))
|
||||||
{
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_android.reinit_video)
|
|
||||||
{
|
|
||||||
uninit_drivers();
|
|
||||||
init_drivers();
|
|
||||||
g_android.reinit_video = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
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");
|
RARCH_LOG("RetroArch stopped.\n");
|
||||||
|
@ -207,6 +207,23 @@ static void gfx_ctx_check_window(bool *quit,
|
|||||||
*quit = false;
|
*quit = false;
|
||||||
*resize = false;
|
*resize = false;
|
||||||
|
|
||||||
|
if (g_android.reinit_video)
|
||||||
|
{
|
||||||
|
uninit_drivers();
|
||||||
|
init_drivers();
|
||||||
|
g_android.reinit_video = 0;
|
||||||
|
*resize = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AConfiguration_getOrientation(g_android.app->config) != g_android.last_orient)
|
||||||
|
{
|
||||||
|
*resize = true;
|
||||||
|
// reinit video driver for new window dimensions
|
||||||
|
driver.video->free(driver.video_data);
|
||||||
|
init_video_input();
|
||||||
|
g_android.last_orient = AConfiguration_getOrientation(g_android.app->config);
|
||||||
|
}
|
||||||
|
|
||||||
// Check if we are exiting.
|
// Check if we are exiting.
|
||||||
if (g_android.app->destroyRequested != 0 || (g_android.input_state & (1ULL << RARCH_KILL)))
|
if (g_android.app->destroyRequested != 0 || (g_android.input_state & (1ULL << RARCH_KILL)))
|
||||||
*quit = true;
|
*quit = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user