destroy all textures on window destruction and restore OpenGL objects when Android resumes the app

This commit is contained in:
2017-04-28 15:06:23 +01:00
parent 96401a1e5d
commit 2e47ccb0c6
12 changed files with 87 additions and 42 deletions

View File

@@ -357,6 +357,7 @@ static void engine_term_display(struct engine* engine) {
engine->display = EGL_NO_DISPLAY;
engine->context = EGL_NO_CONTEXT;
engine->surface = EGL_NO_SURFACE;
App::I.terminate();
}
/**
@@ -528,7 +529,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
case APP_CMD_TERM_WINDOW:
// The window is being hidden or closed, clean it up.
engine_term_display(engine);
exit(0);
//exit(0);
break;
case APP_CMD_GAINED_FOCUS:
// When our app gains focus, we start monitoring the accelerometer.