diff options
Diffstat (limited to 'src/egl/main/eglmisc.c')
-rw-r--r-- | src/egl/main/eglmisc.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c index bbb96a908e4..5a607dc080a 100644 --- a/src/egl/main/eglmisc.c +++ b/src/egl/main/eglmisc.c @@ -36,6 +36,8 @@ #include "eglcurrent.h" #include "eglmisc.h" #include "egldisplay.h" +#include "egldriver.h" +#include "eglstring.h" /** @@ -73,11 +75,11 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy) do { \ if (dpy->Extensions.ext) { \ _eglAppendExtension(&exts, "EGL_" #ext); \ - assert(exts <= dpy->Extensions.String + _EGL_MAX_EXTENSIONS_LEN); \ + assert(exts <= dpy->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \ } \ } while (0) - char *exts = dpy->Extensions.String; + char *exts = dpy->ExtensionsString; if (exts[0]) return; @@ -114,21 +116,21 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy) static void _eglUpdateAPIsString(_EGLDisplay *dpy) { - char *apis = dpy->ClientAPIs; + char *apis = dpy->ClientAPIsString; - if (apis[0] || !dpy->ClientAPIsMask) + if (apis[0] || !dpy->ClientAPIs) return; - if (dpy->ClientAPIsMask & EGL_OPENGL_BIT) + if (dpy->ClientAPIs & EGL_OPENGL_BIT) strcat(apis, "OpenGL "); - if (dpy->ClientAPIsMask & EGL_OPENGL_ES_BIT) + if (dpy->ClientAPIs & EGL_OPENGL_ES_BIT) strcat(apis, "OpenGL_ES "); - if (dpy->ClientAPIsMask & EGL_OPENGL_ES2_BIT) + if (dpy->ClientAPIs & EGL_OPENGL_ES2_BIT) strcat(apis, "OpenGL_ES2 "); - if (dpy->ClientAPIsMask & EGL_OPENVG_BIT) + if (dpy->ClientAPIs & EGL_OPENVG_BIT) strcat(apis, "OpenVG "); assert(strlen(apis) < sizeof(dpy->ClientAPIs)); @@ -139,20 +141,21 @@ const char * _eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name) { (void) drv; - (void) dpy; + switch (name) { case EGL_VENDOR: return _EGL_VENDOR_STRING; case EGL_VERSION: - return dpy->Version; + _eglsnprintf(dpy->VersionString, sizeof(dpy->VersionString), + "%d.%d (%s)", dpy->VersionMajor, dpy->VersionMajor, + dpy->Driver->Name); + return dpy->VersionString; case EGL_EXTENSIONS: _eglUpdateExtensionsString(dpy); - return dpy->Extensions.String; -#ifdef EGL_VERSION_1_2 + return dpy->ExtensionsString; case EGL_CLIENT_APIS: _eglUpdateAPIsString(dpy); - return dpy->ClientAPIs; -#endif + return dpy->ClientAPIsString; default: _eglError(EGL_BAD_PARAMETER, "eglQueryString"); return NULL; |