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"
38 #include "egldisplay.h"
42 * Examine the individual extension enable/disable flags and recompute
43 * the driver's Extensions string.
46 _eglUpdateExtensionsString(_EGLDisplay
*dpy
)
48 char *exts
= dpy
->Extensions
.String
;
53 if (dpy
->Extensions
.MESA_screen_surface
)
54 strcat(exts
, "EGL_MESA_screen_surface ");
55 if (dpy
->Extensions
.MESA_copy_context
)
56 strcat(exts
, "EGL_MESA_copy_context ");
57 assert(strlen(exts
) < _EGL_MAX_EXTENSIONS_LEN
);
62 _eglUpdateAPIsString(_EGLDisplay
*dpy
)
64 char *apis
= dpy
->ClientAPIs
;
66 if (apis
[0] || !dpy
->ClientAPIsMask
)
69 if (dpy
->ClientAPIsMask
& EGL_OPENGL_BIT
)
70 strcat(apis
, "OpenGL ");
72 if (dpy
->ClientAPIsMask
& EGL_OPENGL_ES_BIT
)
73 strcat(apis
, "OpenGL_ES ");
75 if (dpy
->ClientAPIsMask
& EGL_OPENGL_ES2_BIT
)
76 strcat(apis
, "OpenGL_ES2 ");
78 if (dpy
->ClientAPIsMask
& EGL_OPENVG_BIT
)
79 strcat(apis
, "OpenVG ");
81 assert(strlen(apis
) < sizeof(dpy
->ClientAPIs
));
86 _eglQueryString(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLint name
)
92 return _EGL_VENDOR_STRING
;
96 _eglUpdateExtensionsString(dpy
);
97 return dpy
->Extensions
.String
;
98 #ifdef EGL_VERSION_1_2
100 _eglUpdateAPIsString(dpy
);
101 return dpy
->ClientAPIs
;
104 _eglError(EGL_BAD_PARAMETER
, "eglQueryString");
111 _eglWaitGL(_EGLDriver
*drv
, _EGLDisplay
*dpy
)
113 /* just a placeholder */
121 _eglWaitNative(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLint engine
)
123 /* just a placeholder */
127 case EGL_CORE_NATIVE_ENGINE
:
130 _eglError(EGL_BAD_PARAMETER
, "eglWaitNative(engine)");