(Android) Refactor context restore and video orientation change

code  - context restore only needs to restore video and not all
drivers
This commit is contained in:
twinaphex 2012-12-05 06:31:24 +01:00
parent 0dce6a6db6
commit f81ee3be30

View File

@ -207,21 +207,14 @@ static void gfx_ctx_check_window(bool *quit,
*quit = 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)
if (AConfiguration_getOrientation(g_android.app->config) != g_android.last_orient || g_android.reinit_video)
{
*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);
g_android.reinit_video = 0;
}
// Check if we are exiting.