ptr
This commit is contained in:
1 parent
1f92c8e41c
commit
f76932fd91
1 file changed
+11
-11
@@ -29,12 +29,12 @@ bool raybriEGLInit(
|
||||
EGLContext *ctx,
|
||||
EGLDisplay *display
|
||||
){
|
||||
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
*display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
if (*display == EGL_NO_DISPLAY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (eglInitialize(display, NULL, NULL) == EGL_FALSE) {
|
||||
if (eglInitialize(*display, NULL, NULL) == EGL_FALSE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -44,14 +44,14 @@ bool raybriEGLInit(
|
||||
|
||||
EGLint cfgCount = 0;
|
||||
if (
|
||||
eglChooseConfig(display, RAYBRI_EGL_CFG, &cfg, 1, &cfgCount) == EGL_FALSE ||
|
||||
eglChooseConfig(*display, RAYBRI_EGL_CFG, cfg, 1, &cfgCount) == EGL_FALSE ||
|
||||
cfgCount < 1
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx = eglCreateContext(display, cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX);
|
||||
if (ctx == EGL_NO_CONTEXT) {
|
||||
*ctx = eglCreateContext(*display, *cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX);
|
||||
if (*ctx == EGL_NO_CONTEXT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -65,15 +65,15 @@ bool raybriEGLResetSurface(
|
||||
EGLSurface *surface
|
||||
) {
|
||||
// Destroy previous surface
|
||||
if (surface != EGL_NO_SURFACE) {
|
||||
eglDestroySurface(display, surface);
|
||||
surface = EGL_NO_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) {
|
||||
*surface = eglCreateWindowSurface(*display, *cfg, (EGLNativeWindowType)caLayer, NULL);
|
||||
if (*surface == EGL_NO_SURFACE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user