907a057b4420fdef3bd46d1acdf90f5bec1b096a
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 "eglcurrent.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 ");
58 if (dpy
->Extensions
.KHR_image_base
)
59 strcat(exts
, "EGL_KHR_image_base ");
60 if (dpy
->Extensions
.KHR_image_pixmap
)
61 strcat(exts
, "EGL_KHR_image_pixmap ");
62 if (dpy
->Extensions
.KHR_image_base
&& dpy
->Extensions
.KHR_image_pixmap
)
63 strcat(exts
, "EGL_KHR_image ");
65 assert(strlen(exts
) < _EGL_MAX_EXTENSIONS_LEN
);
70 _eglUpdateAPIsString(_EGLDisplay
*dpy
)
72 char *apis
= dpy
->ClientAPIs
;
74 if (apis
[0] || !dpy
->ClientAPIsMask
)
77 if (dpy
->ClientAPIsMask
& EGL_OPENGL_BIT
)
78 strcat(apis
, "OpenGL ");
80 if (dpy
->ClientAPIsMask
& EGL_OPENGL_ES_BIT
)
81 strcat(apis
, "OpenGL_ES ");
83 if (dpy
->ClientAPIsMask
& EGL_OPENGL_ES2_BIT
)
84 strcat(apis
, "OpenGL_ES2 ");
86 if (dpy
->ClientAPIsMask
& EGL_OPENVG_BIT
)
87 strcat(apis
, "OpenVG ");
89 assert(strlen(apis
) < sizeof(dpy
->ClientAPIs
));
94 _eglQueryString(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLint name
)
100 return _EGL_VENDOR_STRING
;
104 _eglUpdateExtensionsString(dpy
);
105 return dpy
->Extensions
.String
;
106 #ifdef EGL_VERSION_1_2
107 case EGL_CLIENT_APIS
:
108 _eglUpdateAPIsString(dpy
);
109 return dpy
->ClientAPIs
;
112 _eglError(EGL_BAD_PARAMETER
, "eglQueryString");
119 _eglWaitClient(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLContext
*ctx
)
121 /* just a placeholder */
130 _eglWaitNative(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLint engine
)
132 /* just a placeholder */
136 case EGL_CORE_NATIVE_ENGINE
:
139 _eglError(EGL_BAD_PARAMETER
, "eglWaitNative(engine)");