Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 1 | ########################################################################## |
| 2 | # |
| 3 | # Copyright 2011 LunarG, Inc. |
| 4 | # All Rights Reserved. |
| 5 | # |
| 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | # of this software and associated documentation files (the "Software"), to deal |
| 8 | # in the Software without restriction, including without limitation the rights |
| 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | # copies of the Software, and to permit persons to whom the Software is |
| 11 | # furnished to do so, subject to the following conditions: |
| 12 | # |
| 13 | # The above copyright notice and this permission notice shall be included in |
| 14 | # all copies or substantial portions of the Software. |
| 15 | # |
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | # THE SOFTWARE. |
| 23 | # |
| 24 | ##########################################################################/ |
| 25 | |
| 26 | """EGL API description.""" |
| 27 | |
| 28 | |
| 29 | from stdapi import * |
Arnaud Vrac | fe93afd | 2011-12-19 02:42:15 +0100 | [diff] [blame] | 30 | from gltypes import * |
José Fonseca | 0765c82 | 2013-05-29 08:52:01 +0100 | [diff] [blame] | 31 | from eglenum import * |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 32 | |
| 33 | EGLNativeDisplayType = Opaque("EGLNativeDisplayType") |
| 34 | EGLNativeWindowType = Opaque("EGLNativeWindowType") |
| 35 | EGLNativePixmapType = Opaque("EGLNativePixmapType") |
| 36 | |
| 37 | EGLDisplay = Opaque("EGLDisplay") |
| 38 | EGLConfig = Opaque("EGLConfig") |
| 39 | EGLContext = Opaque("EGLContext") |
| 40 | EGLSurface = Opaque("EGLSurface") |
| 41 | |
| 42 | EGLClientBuffer = Opaque("EGLClientBuffer") |
| 43 | |
Chia-I Wu | 9b4e6d3 | 2011-12-07 17:03:23 +0800 | [diff] [blame] | 44 | EGLBoolean = Enum("EGLBoolean", [ |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 45 | "EGL_FALSE", |
| 46 | "EGL_TRUE", |
| 47 | ]) |
| 48 | |
| 49 | EGLint = Alias("EGLint", Int32) |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 50 | |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 51 | # an alias of EGLenum |
José Fonseca | 22ef2a5 | 2013-05-29 08:13:18 +0100 | [diff] [blame] | 52 | EGLint_enum = Alias("EGLint", EGLenum) |
| 53 | EGLattrib = EGLint_enum |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 54 | |
| 55 | # EGL_KHR_image_base |
| 56 | EGLImageKHR = Opaque("EGLImageKHR") |
| 57 | |
Chia-I Wu | d674932 | 2011-11-30 18:21:45 +0800 | [diff] [blame] | 58 | # EGL_KHR_reusable_sync |
| 59 | EGLSyncKHR = Opaque("EGLSyncKHR") |
| 60 | EGLTimeKHR = Alias("EGLTimeKHR", UInt64) |
| 61 | |
Chia-I Wu | 4b1c825 | 2011-11-30 18:43:23 +0800 | [diff] [blame] | 62 | # EGL_NV_sync |
| 63 | EGLSyncNV = Alias("EGLSyncNV", EGLSyncKHR) |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 64 | EGLTimeNV = Alias("EGLTimeNV", EGLTimeKHR) |
Chia-I Wu | 4b1c825 | 2011-11-30 18:43:23 +0800 | [diff] [blame] | 65 | |
Chia-I Wu | cba1890 | 2011-12-01 14:14:36 +0800 | [diff] [blame] | 66 | # EGL_HI_clientpixmap |
| 67 | EGLClientPixmapHI = Struct("struct EGLClientPixmapHI", [ |
| 68 | (OpaquePointer(Void), "pData"), |
| 69 | (EGLint, "iWidth"), |
| 70 | (EGLint, "iHeight"), |
| 71 | (EGLint, "iStride"), |
| 72 | ]) |
| 73 | |
Chia-I Wu | eb7f1bd | 2011-12-01 14:57:24 +0800 | [diff] [blame] | 74 | # EGL_NV_system_time |
| 75 | EGLuint64NV = Alias("EGLuint64NV", UInt64) |
| 76 | |
José Fonseca | 8130193 | 2012-11-11 00:10:20 +0000 | [diff] [blame] | 77 | eglapi = Module("EGL") |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 78 | |
José Fonseca | 632a78d | 2012-04-19 07:18:59 +0100 | [diff] [blame] | 79 | EGLAttribList = Array(Const(EGLattrib), "_AttribPairList_size(attrib_list, EGL_NONE)") |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 80 | |
José Fonseca | d93791e | 2012-04-20 07:15:38 +0100 | [diff] [blame] | 81 | EGLProc = Opaque("__eglMustCastToProperFunctionPointerType") |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 82 | |
Arnaud Vrac | fe93afd | 2011-12-19 02:42:15 +0100 | [diff] [blame] | 83 | def GlFunction(*args, **kwargs): |
| 84 | kwargs.setdefault('call', 'GL_APIENTRY') |
| 85 | return Function(*args, **kwargs) |
| 86 | |
José Fonseca | 54f304a | 2012-01-14 19:33:08 +0000 | [diff] [blame] | 87 | eglapi.addFunctions([ |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 88 | # EGL 1.4 |
José Fonseca | 22ef2a5 | 2013-05-29 08:13:18 +0100 | [diff] [blame] | 89 | Function(EGLint_enum, "eglGetError", [], sideeffects=False), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 90 | |
| 91 | Function(EGLDisplay, "eglGetDisplay", [(EGLNativeDisplayType, "display_id")]), |
| 92 | Function(EGLBoolean, "eglInitialize", [(EGLDisplay, "dpy"), Out(Pointer(EGLint), "major"), Out(Pointer(EGLint), "minor")]), |
| 93 | Function(EGLBoolean, "eglTerminate", [(EGLDisplay, "dpy")]), |
| 94 | |
José Fonseca | 22ef2a5 | 2013-05-29 08:13:18 +0100 | [diff] [blame] | 95 | Function(ConstCString, "eglQueryString", [(EGLDisplay, "dpy"), (EGLint_enum, "name")], sideeffects=False), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 96 | |
| 97 | Function(EGLBoolean, "eglGetConfigs", [(EGLDisplay, "dpy"), (Array(EGLConfig, "config_size"), "configs"), (EGLint, "config_size"), Out(Pointer(EGLint), "num_config")]), |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 98 | Function(EGLBoolean, "eglChooseConfig", [(EGLDisplay, "dpy"), (EGLAttribList, "attrib_list"), (Array(EGLConfig, "config_size"), "configs"), (EGLint, "config_size"), Out(Pointer(EGLint), "num_config")]), |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 99 | Function(EGLBoolean, "eglGetConfigAttrib", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLattrib, "attribute"), Out(Pointer(EGLint), "value")], sideeffects=False), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 100 | |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 101 | Function(EGLSurface, "eglCreateWindowSurface", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLNativeWindowType, "win"), (EGLAttribList, "attrib_list")]), |
| 102 | Function(EGLSurface, "eglCreatePbufferSurface", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLAttribList, "attrib_list")]), |
| 103 | Function(EGLSurface, "eglCreatePixmapSurface", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLNativePixmapType, "pixmap"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 104 | Function(EGLBoolean, "eglDestroySurface", [(EGLDisplay, "dpy"), (EGLSurface, "surface")]), |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 105 | Function(EGLBoolean, "eglQuerySurface", [(EGLDisplay, "dpy"), (EGLSurface, "surface"), (EGLattrib, "attribute"), Out(Pointer(EGLint), "value")], sideeffects=False), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 106 | |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 107 | Function(EGLBoolean, "eglBindAPI", [(EGLenum, "api")]), |
| 108 | Function(EGLenum, "eglQueryAPI", [], sideeffects=False), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 109 | |
| 110 | Function(EGLBoolean, "eglWaitClient", []), |
| 111 | |
| 112 | Function(EGLBoolean, "eglReleaseThread", []), |
| 113 | |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 114 | Function(EGLSurface, "eglCreatePbufferFromClientBuffer", [(EGLDisplay, "dpy"), (EGLenum, "buftype"), (EGLClientBuffer, "buffer"), (EGLConfig, "config"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 115 | |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 116 | Function(EGLBoolean, "eglSurfaceAttrib", [(EGLDisplay, "dpy"), (EGLSurface, "surface"), (EGLattrib, "attribute"), (EGLint, "value")]), |
| 117 | Function(EGLBoolean, "eglBindTexImage", [(EGLDisplay, "dpy"), (EGLSurface, "surface"), (EGLattrib, "buffer")]), |
| 118 | Function(EGLBoolean, "eglReleaseTexImage", [(EGLDisplay, "dpy"), (EGLSurface, "surface"), (EGLattrib, "buffer")]), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 119 | |
| 120 | Function(EGLBoolean, "eglSwapInterval", [(EGLDisplay, "dpy"), (EGLint, "interval")]), |
| 121 | |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 122 | Function(EGLContext, "eglCreateContext", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLContext, "share_context"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 123 | Function(EGLBoolean, "eglDestroyContext", [(EGLDisplay, "dpy"), (EGLContext, "ctx")]), |
| 124 | Function(EGLBoolean, "eglMakeCurrent", [(EGLDisplay, "dpy"), (EGLSurface, "draw"), (EGLSurface, "read"), (EGLContext, "ctx")]), |
| 125 | |
| 126 | Function(EGLContext, "eglGetCurrentContext", [], sideeffects=False), |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 127 | Function(EGLSurface, "eglGetCurrentSurface", [(EGLattrib, "readdraw")], sideeffects=False), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 128 | Function(EGLDisplay, "eglGetCurrentDisplay", [], sideeffects=False), |
| 129 | |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 130 | Function(EGLBoolean, "eglQueryContext", [(EGLDisplay, "dpy"), (EGLContext, "ctx"), (EGLattrib, "attribute"), Out(Pointer(EGLint), "value")], sideeffects=False), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 131 | |
| 132 | Function(EGLBoolean, "eglWaitGL", []), |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 133 | Function(EGLBoolean, "eglWaitNative", [(EGLattrib, "engine")]), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 134 | Function(EGLBoolean, "eglSwapBuffers", [(EGLDisplay, "dpy"), (EGLSurface, "surface")]), |
| 135 | Function(EGLBoolean, "eglCopyBuffers", [(EGLDisplay, "dpy"), (EGLSurface, "surface"), (EGLNativePixmapType, "target")]), |
| 136 | |
José Fonseca | bcfc81b | 2012-08-07 21:07:22 +0100 | [diff] [blame] | 137 | Function(EGLProc, "eglGetProcAddress", [(ConstCString, "procname")]), |
Chia-I Wu | 7fbacb7 | 2011-11-30 17:52:40 +0800 | [diff] [blame] | 138 | |
| 139 | # EGL_KHR_lock_surface |
José Fonseca | 74ccf6e | 2013-05-30 10:26:04 +0100 | [diff] [blame] | 140 | # EGL_KHR_lock_surface2 |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 141 | Function(EGLBoolean, "eglLockSurfaceKHR", [(EGLDisplay, "display"), (EGLSurface, "surface"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | 7fbacb7 | 2011-11-30 17:52:40 +0800 | [diff] [blame] | 142 | Function(EGLBoolean, "eglUnlockSurfaceKHR", [(EGLDisplay, "display"), (EGLSurface, "surface")]), |
Chia-I Wu | bc61ec3 | 2011-11-30 17:58:03 +0800 | [diff] [blame] | 143 | |
| 144 | # EGL_KHR_image_base |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 145 | Function(EGLImageKHR, "eglCreateImageKHR", [(EGLDisplay, "dpy"), (EGLContext, "ctx"), (EGLenum, "target"), (EGLClientBuffer, "buffer"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | bc61ec3 | 2011-11-30 17:58:03 +0800 | [diff] [blame] | 146 | Function(EGLBoolean, "eglDestroyImageKHR", [(EGLDisplay, "dpy"), (EGLImageKHR, "image")]), |
Chia-I Wu | d674932 | 2011-11-30 18:21:45 +0800 | [diff] [blame] | 147 | |
José Fonseca | 74ccf6e | 2013-05-30 10:26:04 +0100 | [diff] [blame] | 148 | # EGL_KHR_fence_sync |
Chia-I Wu | d674932 | 2011-11-30 18:21:45 +0800 | [diff] [blame] | 149 | # EGL_KHR_reusable_sync |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 150 | Function(EGLSyncKHR, "eglCreateSyncKHR", [(EGLDisplay, "dpy"), (EGLenum, "type"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | d674932 | 2011-11-30 18:21:45 +0800 | [diff] [blame] | 151 | Function(EGLBoolean, "eglDestroySyncKHR", [(EGLDisplay, "dpy"), (EGLSyncKHR, "sync")]), |
| 152 | Function(EGLint, "eglClientWaitSyncKHR", [(EGLDisplay, "dpy"), (EGLSyncKHR, "sync"), (EGLint, "flags"), (EGLTimeKHR, "timeout")]), |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 153 | Function(EGLBoolean, "eglSignalSyncKHR", [(EGLDisplay, "dpy"), (EGLSyncKHR, "sync"), (EGLenum, "mode")]), |
| 154 | Function(EGLBoolean, "eglGetSyncAttribKHR", [(EGLDisplay, "dpy"), (EGLSyncKHR, "sync"), (EGLattrib, "attribute"), Out(Pointer(EGLint), "value")], sideeffects=False), |
Chia-I Wu | 4b1c825 | 2011-11-30 18:43:23 +0800 | [diff] [blame] | 155 | |
| 156 | # EGL_NV_sync |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 157 | Function(EGLSyncNV, "eglCreateFenceSyncNV", [(EGLDisplay, "dpy"), (EGLenum, "condition"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | 4b1c825 | 2011-11-30 18:43:23 +0800 | [diff] [blame] | 158 | Function(EGLBoolean, "eglDestroySyncNV", [(EGLSyncNV, "sync")]), |
| 159 | Function(EGLBoolean, "eglFenceNV", [(EGLSyncNV, "sync")]), |
| 160 | Function(EGLint, "eglClientWaitSyncNV", [(EGLSyncNV, "sync"), (EGLint, "flags"), (EGLTimeNV, "timeout")]), |
| 161 | Function(EGLBoolean, "eglSignalSyncNV", [(EGLSyncNV, "sync"), (EGLenum, "mode")]), |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 162 | Function(EGLBoolean, "eglGetSyncAttribNV", [(EGLSyncNV, "sync"), (EGLattrib, "attribute"), Out(Pointer(EGLint), "value")], sideeffects=False), |
Chia-I Wu | cba1890 | 2011-12-01 14:14:36 +0800 | [diff] [blame] | 163 | |
| 164 | # EGL_HI_clientpixmap |
| 165 | Function(EGLSurface, "eglCreatePixmapSurfaceHI", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (Pointer(EGLClientPixmapHI), "pixmap")]), |
Chia-I Wu | f45b647 | 2011-12-01 14:43:54 +0800 | [diff] [blame] | 166 | |
| 167 | # EGL_MESA_drm_image |
Chia-I Wu | daa4313 | 2011-12-07 17:23:41 +0800 | [diff] [blame] | 168 | Function(EGLImageKHR, "eglCreateDRMImageMESA", [(EGLDisplay, "dpy"), (EGLAttribList, "attrib_list")]), |
Chia-I Wu | f45b647 | 2011-12-01 14:43:54 +0800 | [diff] [blame] | 169 | Function(EGLBoolean, "eglExportDRMImageMESA", [(EGLDisplay, "dpy"), (EGLImageKHR, "image"), Out(Pointer(EGLint), "name"), Out(Pointer(EGLint), "handle"), Out(Pointer(EGLint), "stride")]), |
Chia-I Wu | 67be6f1 | 2011-12-01 14:47:02 +0800 | [diff] [blame] | 170 | |
| 171 | # EGL_NV_post_sub_buffer |
| 172 | Function(EGLBoolean, "eglPostSubBufferNV", [(EGLDisplay, "dpy"), (EGLSurface, "surface"), (EGLint, "x"), (EGLint, "y"), (EGLint, "width"), (EGLint, "height")]), |
Chia-I Wu | 991b5f5 | 2011-12-01 14:49:53 +0800 | [diff] [blame] | 173 | |
| 174 | # EGL_ANGLE_query_surface_pointer |
Chia-I Wu | 76fe527 | 2011-12-07 17:03:50 +0800 | [diff] [blame] | 175 | Function(EGLBoolean, "eglQuerySurfacePointerANGLE", [(EGLDisplay, "dpy"), (EGLSurface, "surface"), (EGLattrib, "attribute"), Out(Pointer(OpaquePointer(Void)), "value")], sideeffects=False), |
Chia-I Wu | eb7f1bd | 2011-12-01 14:57:24 +0800 | [diff] [blame] | 176 | |
| 177 | # EGL_NV_system_time |
| 178 | Function(EGLuint64NV, "eglGetSystemTimeFrequencyNV", [], sideeffects=False), |
| 179 | Function(EGLuint64NV, "eglGetSystemTimeNV", [], sideeffects=False), |
Arnaud Vrac | fe93afd | 2011-12-19 02:42:15 +0100 | [diff] [blame] | 180 | |
| 181 | # GL_OES_EGL_image |
| 182 | GlFunction(Void, "glEGLImageTargetTexture2DOES", [(GLenum, "target"), (EGLImageKHR, "image")]), |
| 183 | GlFunction(Void, "glEGLImageTargetRenderbufferStorageOES", [(GLenum, "target"), (EGLImageKHR, "image")]), |
Chia-I Wu | c1d4c4d | 2011-11-03 12:23:21 +0800 | [diff] [blame] | 184 | ]) |