summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglmisc.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 13:45:40 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 13:45:40 -0600
commitd5078b94323241a6482f54797756116b1c864327 (patch)
tree7d5d96198eb770a9c24b6425d0ec53dc266cafb9 /src/egl/main/eglmisc.c
parent52676207e338b4c2b4953747521921ab79d70f06 (diff)
egl: clean-up re-org of the client API state
Diffstat (limited to 'src/egl/main/eglmisc.c')
-rw-r--r--src/egl/main/eglmisc.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index fb32544b15d..b5bdc3ea4bf 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -54,6 +54,27 @@ _eglUpdateExtensionsString(_EGLDriver *drv)
}
+static void
+_eglUpdateAPIsString(_EGLDriver *drv)
+{
+ _eglGlobal.ClientAPIs[0] = 0;
+
+ if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_BIT)
+ strcat(_eglGlobal.ClientAPIs, "OpenGL ");
+
+ if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_ES_BIT)
+ strcat(_eglGlobal.ClientAPIs, "OpenGL_ES ");
+
+ if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_ES2_BIT)
+ strcat(_eglGlobal.ClientAPIs, "OpenGL_ES2 ");
+
+ if (_eglGlobal.ClientAPIsMask & EGL_OPENVG_BIT)
+ strcat(_eglGlobal.ClientAPIs, "OpenVG ");
+
+ assert(strlen(_eglGlobal.ClientAPIs) < sizeof(_eglGlobal.ClientAPIs));
+}
+
+
const char *
_eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
@@ -70,8 +91,8 @@ _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
return drv->Extensions.String;
#ifdef EGL_VERSION_1_2
case EGL_CLIENT_APIS:
- /* XXX need to initialize somewhere */
- return drv->ClientAPIs;
+ _eglUpdateAPIsString(drv);
+ return _eglGlobal.ClientAPIs;
#endif
default:
_eglError(EGL_BAD_PARAMETER, "eglQueryString");