From b3b2d50d583d43f17b6557f2f8de16edd3a7786f Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 23 Mar 2024 18:53:32 +0800 Subject: [PATCH] Update rcore_ios.c --- src/platforms/rcore_ios.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_ios.c b/src/platforms/rcore_ios.c index 5ba5edebb..45ef07f7b 100644 --- a/src/platforms/rcore_ios.c +++ b/src/platforms/rcore_ios.c @@ -2,8 +2,8 @@ * * rcore_ template - Functions to manage window, graphics device and inputs * -* PLATFORM: -* - TODO: Define the target platform for the core +* PLATFORM: IOS +* - iOS (arm64) * * LIMITATIONS: * - Limitation 01 @@ -357,7 +357,7 @@ void OpenURL(const char *url) if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); else { - // TODO: + TRACELOG(LOG_WARNING, "OpenURL() not implemented on target platform"); } } @@ -585,6 +585,27 @@ int InitPlatform(void) void ClosePlatform(void) { // TODO: De-initialize graphics, inputs and more + + // Close surface, context and display + if (platform.device != EGL_NO_DISPLAY) + { + eglMakeCurrent(platform.device, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + + if (platform.surface != EGL_NO_SURFACE) + { + eglDestroySurface(platform.device, platform.surface); + platform.surface = EGL_NO_SURFACE; + } + + if (platform.context != EGL_NO_CONTEXT) + { + eglDestroyContext(platform.device, platform.context); + platform.context = EGL_NO_CONTEXT; + } + + eglTerminate(platform.device); + platform.device = EGL_NO_DISPLAY; + } } // EOF