* Tear down the EGL context currently associated with the display. */
| 888 | * Tear down the EGL context currently associated with the display. |
| 889 | */ |
| 890 | static void engine_term_display(struct engine* engine, bool shutdown) { |
| 891 | |
| 892 | if (shutdown == true) { |
| 893 | _AndroidGameWillTerminate(); |
| 894 | } else { |
| 895 | _AndroidGameResignActive(); |
| 896 | } |
| 897 | |
| 898 | activity.finishShutdown(); |
| 899 | |
| 900 | if (engine->display != EGL_NO_DISPLAY) { |
| 901 | eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); |
| 902 | if (engine->context != EGL_NO_CONTEXT) { |
| 903 | eglDestroyContext(engine->display, engine->context); |
| 904 | } |
| 905 | if (engine->surface != EGL_NO_SURFACE) { |
| 906 | eglDestroySurface(engine->display, engine->surface); |
| 907 | } |
| 908 | eglTerminate(engine->display); |
| 909 | } |
| 910 | engine->animating = 0; |
| 911 | engine->display = EGL_NO_DISPLAY; |
| 912 | engine->context = EGL_NO_CONTEXT; |
| 913 | engine->surface = EGL_NO_SURFACE; |
| 914 | } |
| 915 | |
| 916 | void keepScreenOn() { |
| 917 |
no test coverage detected