[client] egl: use standard-compliant way of EGL detection

According to the documentation for eglQueryString:

> EGL_BAD_DISPLAY is generated if display is not an EGL display connection,
> unless display is EGL_NO_DISPLAY and name is EGL_EXTENSIONS.

Therefore, we should check EGL by doing:

    eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS)

Indeed, the old way of eglQueryString(EGL_NO_DISPLAY, EGL_VERSION) works on
libglvnd but not using mesa's libEGL.so directly.

Also added a warning to make it more obvious that EGL is not available.
This commit is contained in:
Quantum 2021-08-15 18:16:09 -04:00 committed by Geoffrey McRae
parent 8a5efef622
commit b7d3bbbd82

View File

@ -201,8 +201,11 @@ static bool egl_create(LG_Renderer ** renderer, const LG_RendererParams params,
bool * needsOpenGL) bool * needsOpenGL)
{ {
// check if EGL is even available // check if EGL is even available
if (!eglQueryString(EGL_NO_DISPLAY, EGL_VERSION)) if (!eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS))
{
DEBUG_WARN("EGL is not available");
return false; return false;
}
// create our local storage // create our local storage
struct Inst * this = calloc(1, sizeof(*this)); struct Inst * this = calloc(1, sizeof(*this));