reset sur

This commit is contained in:
Михаил Капелько committed 2026-10-29 16:18:40 +03:00
1 parent 2fbaba4a51
commit b1dd0a5107
1 file changed
+28
+28
View File
@@ -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