From b1dd0a5107a21b0ac2f3e9d2f30f39fc729c7d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Thu, 29 Oct 2026 16:18:40 +0300 Subject: [PATCH] reset sur --- components/raybri/ios/raybriEGL.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/components/raybri/ios/raybriEGL.h b/components/raybri/ios/raybriEGL.h index 3949779..5beada6 100644 --- a/components/raybri/ios/raybriEGL.h +++ b/components/raybri/ios/raybriEGL.h @@ -9,6 +9,12 @@ // Header bool raybriEGLInit(void); +bool raybriEGLResetSurface( + void *caLayer, + EGLConfig *cfg, + EGLDisplay *display, + EGLSurface *surface +); // Source @@ -48,6 +54,28 @@ bool raybriEGLInit(void) { return true; } +bool raybriEGLResetSurface( + void *caLayer, + EGLConfig *cfg, + EGLDisplay *display, + EGLSurface *surface +) { + // Destroy previous surface + if (surface != EGL_NO_SURFACE) { + eglDestroySurface(display, surface); + surface = EGL_NO_SURFACE; + } + + // Create new surface + // ANGLE on iOS takes a CALayer as the native window + surface = eglCreateWindowSurface(display, cfg, (EGLNativeWindowType)caLayer, NULL); + if (surface == EGL_NO_SURFACE) { + return false; + } + + return true; +} + #endif // RAYBRI_EGL_IMPLEMENTATION #endif // RAYBRI_EGL_H