Skip to content

Commit

Permalink
OpenGL (EGL): try GLES 2.0+; then fallback to 1.1 if failed
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Jan 8, 2025
1 parent a93e2aa commit 88917cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/detection/opengl/opengl_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ static const char* eglHandleContext(FFOpenGLResult* result, EGLData* data)
static const char* eglHandleSurface(FFOpenGLResult* result, EGLData* data, bool gles)
{
data->context = data->ffeglCreateContext(data->display, data->config, EGL_NO_CONTEXT, (EGLint[]){
EGL_CONTEXT_CLIENT_VERSION, gles ? 2 : 1,
EGL_CONTEXT_CLIENT_VERSION, gles ? 2 : 1, // Try GLES 2.0+ first
EGL_NONE
});
if(data->context == EGL_NO_CONTEXT && gles) // Some ANGLE builds support GLES 1.1 only
data->context = data->ffeglCreateContext(data->display, data->config, EGL_NO_CONTEXT, (EGLint[]){EGL_NONE});
if(data->context == EGL_NO_CONTEXT)
return "eglCreateContext returned EGL_NO_CONTEXT";

Expand Down

0 comments on commit 88917cb

Please sign in to comment.