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 OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #ifndef __eglmesaext_h_
29 #define __eglmesaext_h_
35 #include <EGL/eglplatform.h>
37 /* EGL_MESA_screen extension >>> PRELIMINARY <<< */
38 #ifndef EGL_MESA_screen_surface
39 #define EGL_MESA_screen_surface 1
41 #define EGL_BAD_SCREEN_MESA 0x4000
42 #define EGL_BAD_MODE_MESA 0x4001
43 #define EGL_SCREEN_COUNT_MESA 0x4002
44 #define EGL_SCREEN_POSITION_MESA 0x4003
45 #define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004
46 #define EGL_MODE_ID_MESA 0x4005
47 #define EGL_REFRESH_RATE_MESA 0x4006
48 #define EGL_OPTIMAL_MESA 0x4007
49 #define EGL_INTERLACED_MESA 0x4008
50 #define EGL_SCREEN_BIT_MESA 0x08
52 typedef khronos_uint32_t EGLScreenMESA;
53 typedef khronos_uint32_t EGLModeMESA;
55 #ifdef EGL_EGLEXT_PROTOTYPES
56 EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
57 EGLAPI EGLBoolean EGLAPIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
58 EGLAPI EGLBoolean EGLAPIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
59 EGLAPI EGLBoolean EGLAPIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
60 EGLAPI EGLSurface EGLAPIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
61 EGLAPI EGLBoolean EGLAPIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
62 EGLAPI EGLBoolean EGLAPIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
63 EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
64 EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
65 EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
66 EGLAPI const char * EGLAPIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
67 #endif /* EGL_EGLEXT_PROTOTYPES */
69 typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSEMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
70 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMODESMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
71 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGetModeATTRIBMESA) (EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
72 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSCRREENSMESA) (EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
73 typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESCREENSURFACEMESA) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
74 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSHOWSCREENSURFACEMESA) (EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
75 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSCREENPOSIITONMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
76 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
77 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENSURFACEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
78 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
79 typedef const char * (EGLAPIENTRYP PFNEGLQUERYMODESTRINGMESA) (EGLDisplay dpy, EGLModeMESA mode);
81 #endif /* EGL_MESA_screen_surface */
83 #ifndef EGL_MESA_copy_context
84 #define EGL_MESA_copy_context 1
86 #ifdef EGL_EGLEXT_PROTOTYPES
87 EGLAPI EGLBoolean EGLAPIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
88 #endif /* EGL_EGLEXT_PROTOTYPES */
90 typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
92 #endif /* EGL_MESA_copy_context */
94 #ifndef EGL_MESA_drm_display
95 #define EGL_MESA_drm_display 1
97 #ifdef EGL_EGLEXT_PROTOTYPES
98 EGLAPI EGLDisplay EGLAPIENTRY eglGetDRMDisplayMESA(int fd);
99 #endif /* EGL_EGLEXT_PROTOTYPES */
101 typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
103 #endif /* EGL_MESA_drm_display */
105 #ifdef EGL_MESA_drm_image
106 /* Mesa's extension to EGL_MESA_drm_image... */
107 #ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA
108 #define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
112 #ifndef EGL_WL_bind_wayland_display
113 #define EGL_WL_bind_wayland_display 1
115 #define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
116 #define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
118 #define EGL_TEXTURE_Y_U_V_WL 0x31D7
119 #define EGL_TEXTURE_Y_UV_WL 0x31D8
120 #define EGL_TEXTURE_Y_XUXV_WL 0x31D9
124 #ifdef EGL_EGLEXT_PROTOTYPES
125 EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
126 EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
127 EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
129 typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
130 typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
131 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
135 #ifndef EGL_NOK_swap_region
136 #define EGL_NOK_swap_region 1
138 #ifdef EGL_EGLEXT_PROTOTYPES
139 EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
142 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
145 #ifndef EGL_NOK_texture_from_pixmap
146 #define EGL_NOK_texture_from_pixmap 1
148 #define EGL_Y_INVERTED_NOK 0x307F
149 #endif /* EGL_NOK_texture_from_pixmap */
151 #ifndef EGL_ANDROID_image_native_buffer
152 #define EGL_ANDROID_image_native_buffer 1
153 #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */