iOS: set up shared gl context correctly (#17565)
This commit is contained in:
parent
a6ea47df15
commit
65e1436a23
|
@ -174,6 +174,7 @@ static void cocoa_gl_gfx_ctx_destroy(void *data)
|
||||||
#else
|
#else
|
||||||
[EAGLContext setCurrentContext:nil];
|
[EAGLContext setCurrentContext:nil];
|
||||||
#endif
|
#endif
|
||||||
|
g_hw_ctx = nil;
|
||||||
g_ctx = nil;
|
g_ctx = nil;
|
||||||
|
|
||||||
free(cocoa_ctx);
|
free(cocoa_ctx);
|
||||||
|
@ -481,12 +482,20 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data,
|
||||||
|
|
||||||
#if defined(HAVE_OPENGLES3)
|
#if defined(HAVE_OPENGLES3)
|
||||||
if (cocoa_ctx->flags & COCOA_CTX_FLAG_USE_HW_CTX)
|
if (cocoa_ctx->flags & COCOA_CTX_FLAG_USE_HW_CTX)
|
||||||
|
{
|
||||||
g_hw_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
g_hw_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
||||||
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 sharegroup:g_hw_ctx.sharegroup];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
||||||
#elif defined(HAVE_OPENGLES2)
|
#elif defined(HAVE_OPENGLES2)
|
||||||
if (cocoa_ctx->flags & COCOA_CTX_FLAG_USE_HW_CTX)
|
if (cocoa_ctx->flags & COCOA_CTX_FLAG_USE_HW_CTX)
|
||||||
|
{
|
||||||
g_hw_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
g_hw_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||||
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:g_hw_ctx.sharegroup];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OSX
|
#ifdef OSX
|
||||||
|
|
Loading…
Reference in New Issue