5 #define LOC QString("EGL: ")
9 #include <EGL/eglext.h>
12 #ifndef EGL_EXT_platform_device
13 #define EGL_PLATFORM_DEVICE_EXT 0x313F
16 #ifndef EGL_EXT_platform_wayland
17 #define EGL_PLATFORM_WAYLAND_EXT 0x31D8
20 #ifndef EGL_EXT_platform_x11
21 #define EGL_PLATFORM_X11_EXT 0x31D5
58 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to resolve EGL functions");
69 QByteArray extensions = QByteArray(eglQueryString(
m_eglDisplay, EGL_EXTENSIONS));
70 return extensions.contains(Extension.data()->toLatin1());
84 auto CheckDisplay = [](EGLDisplay EglDisplay)
86 if (EglDisplay == EGL_NO_DISPLAY)
90 if (!eglInitialize(EglDisplay, &major, &
minor))
92 QString vendor = eglQueryString(EglDisplay, EGL_VENDOR);
93 QString apis = eglQueryString(EglDisplay, EGL_CLIENT_APIS);
94 QString
version = eglQueryString(EglDisplay, EGL_VERSION);
95 eglTerminate(EglDisplay);
96 if (!apis.contains(
"opengl", Qt::CaseInsensitive) || (major < 1 ||
minor < 2))
98 return QString(
"%1, %2").arg(vendor,
version);
101 QString extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
102 if (extensions.contains(
"EGL_EXT_platform_base"))
107 if (getdisp && extensions.contains(
"platform_x11"))
110 if (!vendor.isEmpty())
113 if (getdisp && extensions.contains(
"platform_wayland"))
116 if (!vendor.isEmpty())
119 if (getdisp && extensions.contains(
"platform_device"))
122 if (!vendor.isEmpty())
127 return CheckDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY));
136 return static_cast<qint32
>(eglGetError());
149 void *
Buffer,
const int32_t *Attributes)