destroy all textures on window destruction and restore OpenGL objects when Android resumes the app
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user