10 ** Copyright (c) 2007-2009 The Khronos Group Inc.
12 ** Permission is hereby granted, free of charge, to any person obtaining a
13 ** copy of this software and/or associated documentation files (the
14 ** "Materials"), to deal in the Materials without restriction, including
15 ** without limitation the rights to use, copy, modify, merge, publish,
16 ** distribute, sublicense, and/or sell copies of the Materials, and to
17 ** permit persons to whom the Materials are furnished to do so, subject to
18 ** the following conditions:
20 ** The above copyright notice and this permission notice shall be included
21 ** in all copies or substantial portions of the Materials.
23 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
27 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
37 /* differences from the actual sample implementation provided by Khronos:
39 - the Doxygen comment with tag 'publishedAll', and tag 'released'
40 - changing platform-dependant header name from <EGL/eglplatform.h> to <EGL/egltypes.h>
41 - EGLImageKHR definition is consistent with other EGL objects, i.e. is defined as integer
42 instead of pointer to void.
43 - macro EGL_IMAGE_PRESERVED_SYMBIAN introduced in this header represents EGL_IMAGE_PRESERVED_KHR
44 macro defined in Khronos spec. Note that it has been retained temporarily for compatibility reasons
45 and it is advised to use Khronos macro instead.
46 - resource profiler and reusable sync object extensions are added
49 #include <EGL/egltypes.h>
50 #include <khronos_types.h>
52 /*************************************************************/
54 #define EGL_EGLEXT_VERSION 3
56 #ifndef EGL_KHR_config_attribs
57 #define EGL_KHR_config_attribs 1
58 #define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
59 #define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
60 #define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
63 #ifndef EGL_KHR_lock_surface
64 #define EGL_KHR_lock_surface 1
65 #define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
66 #define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
67 #define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
68 #define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
69 #define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
70 #define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
71 #define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
72 #define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
73 #define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
74 #define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
75 #define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
76 #define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
77 #define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
78 #define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
79 #define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
80 #define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
81 #define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
82 #define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
83 #define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
84 #define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
85 #define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
86 #ifdef EGL_EGLEXT_PROTOTYPES
87 EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
88 EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
89 #endif /* EGL_EGLEXT_PROTOTYPES */
90 typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
91 typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
95 #define EGL_KHR_image 1
96 #define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
97 typedef int EGLImageKHR;
98 #define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
99 #ifdef EGL_EGLEXT_PROTOTYPES
100 EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
101 EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
102 #endif /* EGL_EGLEXT_PROTOTYPES */
103 typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
104 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
107 #ifndef EGL_KHR_vg_parent_image
108 #define EGL_KHR_vg_parent_image 1
109 #define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
112 #ifndef EGL_KHR_gl_texture_2D_image
113 #define EGL_KHR_gl_texture_2D_image 1
114 #define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
115 #define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
118 #ifndef EGL_KHR_gl_texture_cubemap_image
119 #define EGL_KHR_gl_texture_cubemap_image 1
120 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
121 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
122 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
123 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
124 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
125 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
128 #ifndef EGL_KHR_gl_texture_3D_image
129 #define EGL_KHR_gl_texture_3D_image 1
130 #define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
131 #define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
134 #ifndef EGL_KHR_gl_renderbuffer_image
135 #define EGL_KHR_gl_renderbuffer_image 1
136 #define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
139 #ifndef EGL_KHR_image_base
140 #define EGL_KHR_image_base 1
141 /* Most interfaces defined by EGL_KHR_image_pixmap above */
142 #define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
145 #ifndef EGL_KHR_image_pixmap
146 #define EGL_KHR_image_pixmap 1
147 /* Interfaces defined by EGL_KHR_image above */
150 #ifndef EGL_SYMBIAN_image_preserved
151 #define EGL_SYMBIAN_image_preserved 1
152 /* The following macro was retained for compatibility reasons and will be removed soon.
153 For the new written code it is advised to use EGL_IMAGE_PRESERVED_KHR macro
154 defined in Khronos spec. */
155 #define EGL_IMAGE_PRESERVED_SYMBIAN 0x30D2 /* eglCreateImageKHR attribute */
158 #ifndef EGL_NOK_resource_profiling2
159 #define EGL_NOK_resource_profiling2 1
160 /* Accepted by the <query_bits> parameter of eglQueryProfilingDataNOK */
161 #define EGL_PROF_QUERY_GLOBAL_BIT_NOK 0x0001
162 #define EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK 0x0002
163 /* Returned as attribute identifiers by eglQueryProfilingDataNOK */
164 #define EGL_PROF_TOTAL_MEMORY_NOK 0x3070
165 #define EGL_PROF_USED_MEMORY_NOK 0x3071
166 #define EGL_PROF_PROCESS_ID_NOK 0x3072
167 #define EGL_PROF_PROCESS_USED_PRIVATE_MEMORY_NOK 0x3073
168 #define EGL_PROF_PROCESS_USED_SHARED_MEMORY_NOK 0x3074
169 /* Accepted as the <type> parameter of eglCreateSyncKHR */
170 #define EGL_SYNC_RESOURCE_PROFILING_NOK 0x3078
171 /* Accepted as the value of the EGL_SYNC_CONDITION_KHR attribute passed in */
172 /* <attrib_list> for eglCreateSyncKHR, and returned in <value> when */
173 /* eglGetSyncAttribKHR is called with <attribute> EGL_SYNC_CONDITION_KHR */
174 #define EGL_PROF_TOTAL_MEMORY_USAGE_GT_NOK 0x3075
175 #define EGL_PROF_TOTAL_MEMORY_USAGE_LT_NOK 0x3076
176 /* Accepted as an attribute name in the <attrib_list> parameter of */
177 /* eglCreateSyncKHR and in <attribute> for eglGetSyncAttribKHR */
178 #define EGL_PROF_MEMORY_USAGE_THRESHOLD_NOK 0x3077
179 typedef TUint64 EGLNativeProcessIdTypeNOK;
180 #ifdef EGL_EGLEXT_PROTOTYPES
181 EGLAPI EGLBoolean EGLAPIENTRY eglQueryProfilingDataNOK(EGLDisplay dpy, EGLint query_bits, EGLint *data, EGLint data_size, EGLint *data_count);
182 #endif /* EGL_EGLEXT_PROTOTYPES */
183 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYPROFILINGDATANOKPROC) (EGLDisplay dpy, EGLint query_bits, EGLint *data, EGLint data_size, EGLint *data_count);
186 #ifndef EGL_KHR_reusable_sync
187 #define EGL_KHR_reusable_sync 1
188 /* Accepted by the <type> parameter of eglCreateSyncKHR, and returned
189 in <value> when eglGetSyncAttribKHR is called with <attribute>
191 #define EGL_SYNC_REUSABLE_KHR 0x30FA
192 /* Accepted by the <attribute> parameter of eglGetSyncAttribKHR */
193 #define EGL_SYNC_TYPE_KHR 0x30F7
194 #define EGL_SYNC_STATUS_KHR 0x30F1
195 /* Accepted by the <mode> parameter of eglSignalSyncKHR and returned in
196 <value> when eglGetSyncAttribKHR is called with <attribute>
197 EGL_SYNC_STATUS_KHR */
198 #define EGL_SIGNALED_KHR 0x30F2
199 #define EGL_UNSIGNALED_KHR 0x30F3
200 /* Accepted in the <flags> parameter of eglClientWaitSyncKHR */
201 #define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001
202 /* Accepted in the <timeout> parameter of eglClientWaitSyncKHR */
203 #define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
204 /* Returned by eglClientWaitSyncKHR */
205 #define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
206 #define EGL_CONDITION_SATISFIED_KHR 0x30F6
207 /* EGLSyncKHR is an opaque handle to an EGL sync object */
208 typedef void* EGLSyncKHR;
209 /* EGLTimeKHR is a 64-bit unsigned integer representing intervals in nanoseconds. */
210 typedef khronos_utime_nanoseconds_t EGLTimeKHR;
211 /* Returned by eglCreateSyncKHR in the event of an error */
212 #define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
213 #ifdef EGL_EGLEXT_PROTOTYPES
214 EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
215 EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
216 EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
217 EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
218 EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
219 #endif /* EGL_EGLEXT_PROTOTYPES */
220 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
221 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
222 typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
223 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
224 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
227 #ifndef EGL_NOK_swap_region
228 #define EGL_NOK_swap_region 1
229 #ifdef EGL_EGLEXT_PROTOTYPES
230 EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
231 #endif /* EGL_EGLEXT_PROTOTYPES */
232 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
236 #ifndef EGL_NOK_ENDPOINT
237 #define EGL_NOK_ENDPOINT 1
238 /* Endpoint datatype */
239 typedef void* EGLEndpointNOK;
240 typedef void* EGLTRequestStatusNOK;
241 typedef void* EGLEndpointSourceNOK;
242 /* Endpoint constant */
243 #define EGL_ENDPOINT_TYPE_CONSUMER_NOK 0x30D5
244 #define EGL_TSURFACEID_NOK 0x30D3
245 /* Endpoint invalid parameter */
246 #define EGL_NO_ENDPOINT_NOK ((EGLEndpointNOK)0)
247 /* Endpoint error code */
248 #define EGL_BAD_ENDPOINT_NOK 0x30D4
249 /* Endpoint attribute keys */
250 #define EGL_ENDPOINT_READY_NOK 0x30D6
251 #define EGL_DELAY_NOK 0x30D7
253 #ifdef EGL_EGLEXT_PROTOTYPES
254 EGLAPI EGLEndpointNOK EGLAPIENTRY eglCreateEndpointNOK(EGLDisplay dpy, EGLenum type, EGLenum source_type, EGLEndpointSourceNOK source, const EGLint *attrib_list);
255 EGLAPI EGLBoolean EGLAPIENTRY eglDestroyEndpointNOK(EGLDisplay dpy, EGLEndpointNOK endpoint);
256 EGLAPI EGLint EGLAPIENTRY eglGetEndpointAttribNOK(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib);
257 EGLAPI EGLBoolean EGLAPIENTRY eglSetEndpointAttribNOK(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib, EGLint value);
258 EGLAPI EGLBoolean EGLAPIENTRY eglEndpointBeginStreamingNOK(EGLDisplay dpy, EGLEndpointNOK endpoint);
259 EGLAPI EGLBoolean EGLAPIENTRY eglEndpointEndStreamingNOK(EGLDisplay dpy, EGLEndpointNOK endpoint);
260 EGLAPI EGLImageKHR EGLAPIENTRY eglAcquireImageNOK(EGLDisplay dpy, EGLEndpointNOK endpoint);
261 EGLAPI EGLBoolean EGLAPIENTRY eglReleaseImageNOK(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLImageKHR image, EGLenum api);
262 EGLAPI EGLint EGLAPIENTRY eglGetEndpointDirtyAreaNOK(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint* rects, EGLint start_rect, EGLint max_rects, EGLBoolean collapse);
263 EGLAPI EGLBoolean EGLAPIENTRY eglEndpointRequestNotificationNOK(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLTRequestStatusNOK sync);
264 EGLAPI EGLBoolean EGLAPIENTRY eglEndpointCancelNotificationNOK(EGLDisplay dpy, EGLEndpointNOK endpoint);
267 typedef EGLEndpointNOK ( *PFNEGLCREATEENDPOINTNOKPROC) (EGLDisplay dpy, EGLenum type, EGLenum source_type, EGLEndpointSourceNOK source, const EGLint* attrib_list);
268 typedef EGLBoolean ( *PFNEGLDESTROYENDPOINTNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
269 typedef EGLint ( *PFNEGLGETENDPOINTATTRIBNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib);
270 typedef EGLBoolean ( *PFNEGLSETENDPOINTATTRIBNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib, EGLint value);
271 typedef EGLBoolean ( *PFNEGLENDPOINTBEGINSTREAMINGNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
272 typedef EGLBoolean ( *PFNEGLENDPOINTENDSTREAMINGNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
273 typedef EGLImageKHR ( *PFNEGLACQUIREIMAGENOKPROC)(EGLDisplay dpy, EGLEndpointNOK endpoint);
274 typedef EGLBoolean ( *PFNEGLRELEASEIMAGENOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLImageKHR image, EGLenum api);
275 typedef EGLint ( *PFNEGLGETENDPOINTDIRTYAREANOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint* rects, EGLint start_rect, EGLint max_rects, EGLBoolean collapse);
276 typedef EGLBoolean ( *PFNEGLENDPOINTREQUESTNOTIFICATIONNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLTRequestStatusNOK sync);
277 typedef EGLBoolean ( *PFNEGLENDPOINTCANCELNOTIFICATIONNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);