ios9: Fix using opengles2 context (#17269)

This commit is contained in:
Eric Warmenhoven 2024-12-19 16:30:01 -05:00 committed by GitHub
parent 17fc55c762
commit 8d640fc048
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -479,9 +479,15 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data,
{
cocoa_ctx_data_t *cocoa_ctx = (cocoa_ctx_data_t*)data;
#if defined(HAVE_OPENGLES3)
if (cocoa_ctx->flags & COCOA_CTX_FLAG_USE_HW_CTX)
g_hw_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
#elif defined(HAVE_OPENGLES2)
if (cocoa_ctx->flags & COCOA_CTX_FLAG_USE_HW_CTX)
g_hw_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
g_ctx = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
#endif
#ifdef OSX
[g_ctx makeCurrentContext];