Support iOS for ogs-blue #7
@@ -9,6 +9,12 @@
|
|||||||
// Header
|
// Header
|
||||||
|
|
||||||
bool raybriEGLInit(void);
|
bool raybriEGLInit(void);
|
||||||
|
bool raybriEGLResetSurface(
|
||||||
|
void *caLayer,
|
||||||
|
EGLConfig *cfg,
|
||||||
|
EGLDisplay *display,
|
||||||
|
EGLSurface *surface
|
||||||
|
);
|
||||||
|
|
||||||
// Source
|
// Source
|
||||||
|
|
||||||
@@ -48,6 +54,28 @@ bool raybriEGLInit(void) {
|
|||||||
return true;
|
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_IMPLEMENTATION
|
||||||
|
|
||||||
#endif // RAYBRI_EGL_H
|
#endif // RAYBRI_EGL_H
|
||||||
Reference in new issue
Block a user