1 /**************************************************************************
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
30 * Small/misc EGL functions
36 #include "eglglobals.h"
41 * Examine the individual extension enable/disable flags and recompute
42 * the driver's Extensions string.
45 _eglUpdateExtensionsString(_EGLDriver *drv)
47 drv->Extensions.String[0] = 0;
49 if (drv->Extensions.MESA_screen_surface)
50 strcat(drv->Extensions.String, "EGL_MESA_screen_surface ");
51 if (drv->Extensions.MESA_copy_context)
52 strcat(drv->Extensions.String, "EGL_MESA_copy_context ");
53 assert(strlen(drv->Extensions.String) < _EGL_MAX_EXTENSIONS_LEN);
58 _eglUpdateAPIsString(_EGLDriver *drv)
60 _eglGlobal.ClientAPIs[0] = 0;
62 if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_BIT)
63 strcat(_eglGlobal.ClientAPIs, "OpenGL ");
65 if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_ES_BIT)
66 strcat(_eglGlobal.ClientAPIs, "OpenGL_ES ");
68 if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_ES2_BIT)
69 strcat(_eglGlobal.ClientAPIs, "OpenGL_ES2 ");
71 if (_eglGlobal.ClientAPIsMask & EGL_OPENVG_BIT)
72 strcat(_eglGlobal.ClientAPIs, "OpenVG ");
74 assert(strlen(_eglGlobal.ClientAPIs) < sizeof(_eglGlobal.ClientAPIs));
80 _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
86 return _EGL_VENDOR_STRING;
90 _eglUpdateExtensionsString(drv);
91 return drv->Extensions.String;
92 #ifdef EGL_VERSION_1_2
94 _eglUpdateAPIsString(drv);
95 return _eglGlobal.ClientAPIs;
98 _eglError(EGL_BAD_PARAMETER, "eglQueryString");
105 _eglWaitGL(_EGLDriver *drv, EGLDisplay dpy)
107 /* just a placeholder */
115 _eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine)
117 /* just a placeholder */
121 case EGL_CORE_NATIVE_ENGINE:
124 _eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)");