From 2bbb57704f069103ae1b5ec63a77f34a736f5a18 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Sun, 3 Jan 2021 14:42:32 +0700 Subject: [PATCH] Compile fix --- Natives/egl_bridge_ios.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Natives/egl_bridge_ios.m b/Natives/egl_bridge_ios.m index 0bdda56e..208a8feb 100644 --- a/Natives/egl_bridge_ios.m +++ b/Natives/egl_bridge_ios.m @@ -63,7 +63,7 @@ void *initCurrentContext() { if (!obtainGLKView) { NSLog(@"Unable to locate obtainGLKView"); } - GLKView* view = obtainGLKView(); + GLKView* glkView = obtainGLKView(); EAGLContext *ctx = [EAGLContext currentContext]; @@ -74,8 +74,7 @@ void *initCurrentContext() { glBindFramebuffer(GL_FRAMEBUFFER, FrameBuffer); glBindRenderbuffer(GL_RENDERBUFFER, RenderBuffer); - if (![ctx renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer*)View.layer]) - { + if (![ctx renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer*)glkView.layer]) { NSLog(@"error calling MainContext renderbufferStorage"); return; } @@ -102,13 +101,11 @@ void *initCurrentContext() { jboolean makeCurrentContextShared(void *context) { EAGLSharegroup *group = ((__bridge EAGLContext *) context).sharegroup; - EAGLContext sharedContext = nil; - if (!group) { NSLog(@"Could not get sharegroup from the main context"); } - sharedContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 sharegroup:group]; + EAGLContext sharedContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 sharegroup:group]; if (!sharedContext) { sharedContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:group]; if (!sharedContext) {