Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

egl.h 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. /* -*- mode: c; tab-width: 8; -*- */
  2. /* vi: set sw=4 ts=8: */
  3. /* Reference version of egl.h for EGL 1.4.
  4. * Last modified 2008/05/02
  5. */
  6. #ifndef __egl_h_
  7. #define __egl_h_
  8. /* All platform-dependent types and macro boilerplate (such as EGLAPI
  9. * and EGLAPIENTRY) should go in eglplatform.h.
  10. */
  11. #include <EGL/eglplatform.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /* EGL Types */
  16. typedef int32_t EGLint;
  17. typedef unsigned int EGLBoolean;
  18. typedef unsigned int EGLenum;
  19. typedef void *EGLConfig;
  20. typedef void *EGLContext;
  21. typedef void *EGLDisplay;
  22. typedef void *EGLSurface;
  23. typedef void *EGLClientBuffer;
  24. /* EGL Versioning */
  25. #define EGL_VERSION_1_0 1
  26. #define EGL_VERSION_1_1 1
  27. #define EGL_VERSION_1_2 1
  28. #define EGL_VERSION_1_3 1
  29. #define EGL_VERSION_1_4 1
  30. /* EGL Enumerants. Bitmasks and other exceptional cases aside, most
  31. * enums are assigned unique values starting at 0x3000.
  32. */
  33. /* EGL aliases */
  34. #define EGL_FALSE 0
  35. #define EGL_TRUE 1
  36. /* Out-of-band handle values */
  37. #define EGL_DEFAULT_DISPLAY ((void *)0)
  38. #define EGL_NO_CONTEXT ((EGLContext)0)
  39. #define EGL_NO_DISPLAY ((EGLDisplay)0)
  40. #define EGL_NO_SURFACE ((EGLSurface)0)
  41. /* Out-of-band attribute value */
  42. #define EGL_DONT_CARE ((EGLint)-1)
  43. /* Errors / GetError return values */
  44. #define EGL_SUCCESS 0x3000
  45. #define EGL_NOT_INITIALIZED 0x3001
  46. #define EGL_BAD_ACCESS 0x3002
  47. #define EGL_BAD_ALLOC 0x3003
  48. #define EGL_BAD_ATTRIBUTE 0x3004
  49. #define EGL_BAD_CONFIG 0x3005
  50. #define EGL_BAD_CONTEXT 0x3006
  51. #define EGL_BAD_CURRENT_SURFACE 0x3007
  52. #define EGL_BAD_DISPLAY 0x3008
  53. #define EGL_BAD_MATCH 0x3009
  54. #define EGL_BAD_NATIVE_PIXMAP 0x300A
  55. #define EGL_BAD_NATIVE_WINDOW 0x300B
  56. #define EGL_BAD_PARAMETER 0x300C
  57. #define EGL_BAD_SURFACE 0x300D
  58. #define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
  59. /* Reserved 0x300F-0x301F for additional errors */
  60. /* Config attributes */
  61. #define EGL_BUFFER_SIZE 0x3020
  62. #define EGL_ALPHA_SIZE 0x3021
  63. #define EGL_BLUE_SIZE 0x3022
  64. #define EGL_GREEN_SIZE 0x3023
  65. #define EGL_RED_SIZE 0x3024
  66. #define EGL_DEPTH_SIZE 0x3025
  67. #define EGL_STENCIL_SIZE 0x3026
  68. #define EGL_CONFIG_CAVEAT 0x3027
  69. #define EGL_CONFIG_ID 0x3028
  70. #define EGL_LEVEL 0x3029
  71. #define EGL_MAX_PBUFFER_HEIGHT 0x302A
  72. #define EGL_MAX_PBUFFER_PIXELS 0x302B
  73. #define EGL_MAX_PBUFFER_WIDTH 0x302C
  74. #define EGL_NATIVE_RENDERABLE 0x302D
  75. #define EGL_NATIVE_VISUAL_ID 0x302E
  76. #define EGL_NATIVE_VISUAL_TYPE 0x302F
  77. #define EGL_PRESERVED_RESOURCES 0x3030
  78. #define EGL_SAMPLES 0x3031
  79. #define EGL_SAMPLE_BUFFERS 0x3032
  80. #define EGL_SURFACE_TYPE 0x3033
  81. #define EGL_TRANSPARENT_TYPE 0x3034
  82. #define EGL_TRANSPARENT_BLUE_VALUE 0x3035
  83. #define EGL_TRANSPARENT_GREEN_VALUE 0x3036
  84. #define EGL_TRANSPARENT_RED_VALUE 0x3037
  85. #define EGL_NONE 0x3038 /* Attrib list terminator */
  86. #define EGL_BIND_TO_TEXTURE_RGB 0x3039
  87. #define EGL_BIND_TO_TEXTURE_RGBA 0x303A
  88. #define EGL_MIN_SWAP_INTERVAL 0x303B
  89. #define EGL_MAX_SWAP_INTERVAL 0x303C
  90. #define EGL_LUMINANCE_SIZE 0x303D
  91. #define EGL_ALPHA_MASK_SIZE 0x303E
  92. #define EGL_COLOR_BUFFER_TYPE 0x303F
  93. #define EGL_RENDERABLE_TYPE 0x3040
  94. #define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
  95. #define EGL_CONFORMANT 0x3042
  96. /* Reserved 0x3041-0x304F for additional config attributes */
  97. /* Config attribute values */
  98. #define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
  99. #define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
  100. #define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
  101. #define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
  102. #define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
  103. /* More config attribute values, for EGL_TEXTURE_FORMAT */
  104. #define EGL_NO_TEXTURE 0x305C
  105. #define EGL_TEXTURE_RGB 0x305D
  106. #define EGL_TEXTURE_RGBA 0x305E
  107. #define EGL_TEXTURE_2D 0x305F
  108. /* Config attribute mask bits */
  109. #define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
  110. #define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
  111. #define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
  112. #define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
  113. #define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
  114. #define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
  115. #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
  116. #define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
  117. #define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
  118. #define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
  119. #define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
  120. /* QueryString targets */
  121. #define EGL_VENDOR 0x3053
  122. #define EGL_VERSION 0x3054
  123. #define EGL_EXTENSIONS 0x3055
  124. #define EGL_CLIENT_APIS 0x308D
  125. /* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
  126. #define EGL_HEIGHT 0x3056
  127. #define EGL_WIDTH 0x3057
  128. #define EGL_LARGEST_PBUFFER 0x3058
  129. #define EGL_TEXTURE_FORMAT 0x3080
  130. #define EGL_TEXTURE_TARGET 0x3081
  131. #define EGL_MIPMAP_TEXTURE 0x3082
  132. #define EGL_MIPMAP_LEVEL 0x3083
  133. #define EGL_RENDER_BUFFER 0x3086
  134. #define EGL_VG_COLORSPACE 0x3087
  135. #define EGL_VG_ALPHA_FORMAT 0x3088
  136. #define EGL_HORIZONTAL_RESOLUTION 0x3090
  137. #define EGL_VERTICAL_RESOLUTION 0x3091
  138. #define EGL_PIXEL_ASPECT_RATIO 0x3092
  139. #define EGL_SWAP_BEHAVIOR 0x3093
  140. #define EGL_MULTISAMPLE_RESOLVE 0x3099
  141. /* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
  142. #define EGL_BACK_BUFFER 0x3084
  143. #define EGL_SINGLE_BUFFER 0x3085
  144. /* OpenVG color spaces */
  145. #define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
  146. #define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
  147. /* OpenVG alpha formats */
  148. #define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
  149. #define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
  150. /* Constant scale factor by which fractional display resolutions &
  151. * aspect ratio are scaled when queried as integer values.
  152. */
  153. #define EGL_DISPLAY_SCALING 10000
  154. /* Unknown display resolution/aspect ratio */
  155. #define EGL_UNKNOWN ((EGLint)-1)
  156. /* Back buffer swap behaviors */
  157. #define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
  158. #define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
  159. /* CreatePbufferFromClientBuffer buffer types */
  160. #define EGL_OPENVG_IMAGE 0x3096
  161. /* QueryContext targets */
  162. #define EGL_CONTEXT_CLIENT_TYPE 0x3097
  163. /* CreateContext attributes */
  164. #define EGL_CONTEXT_CLIENT_VERSION 0x3098
  165. /* Multisample resolution behaviors */
  166. #define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
  167. #define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
  168. /* BindAPI/QueryAPI targets */
  169. #define EGL_OPENGL_ES_API 0x30A0
  170. #define EGL_OPENVG_API 0x30A1
  171. #define EGL_OPENGL_API 0x30A2
  172. /* GetCurrentSurface targets */
  173. #define EGL_DRAW 0x3059
  174. #define EGL_READ 0x305A
  175. /* WaitNative engines */
  176. #define EGL_CORE_NATIVE_ENGINE 0x305B
  177. /* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
  178. #define EGL_COLORSPACE EGL_VG_COLORSPACE
  179. #define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
  180. #define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
  181. #define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
  182. #define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
  183. #define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
  184. /* EGL extensions must request enum blocks from the Khronos
  185. * API Registrar, who maintains the enumerant registry. Submit
  186. * a bug in Khronos Bugzilla against task "Registry".
  187. */
  188. /* EGL Functions */
  189. EGLAPI EGLint EGLAPIENTRY eglGetError(void);
  190. EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
  191. EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
  192. EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
  193. EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
  194. EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
  195. EGLint config_size, EGLint *num_config);
  196. EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
  197. EGLConfig *configs, EGLint config_size,
  198. EGLint *num_config);
  199. EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
  200. EGLint attribute, EGLint *value);
  201. EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
  202. EGLNativeWindowType win,
  203. const EGLint *attrib_list);
  204. EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
  205. const EGLint *attrib_list);
  206. EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
  207. EGLNativePixmapType pixmap,
  208. const EGLint *attrib_list);
  209. EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
  210. EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
  211. EGLint attribute, EGLint *value);
  212. EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
  213. EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
  214. EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
  215. EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
  216. EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
  217. EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
  218. EGLConfig config, const EGLint *attrib_list);
  219. EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
  220. EGLint attribute, EGLint value);
  221. EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
  222. EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
  223. EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
  224. EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
  225. EGLContext share_context,
  226. const EGLint *attrib_list);
  227. EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
  228. EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
  229. EGLSurface read, EGLContext ctx);
  230. EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
  231. EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
  232. EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
  233. EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
  234. EGLint attribute, EGLint *value);
  235. EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
  236. EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
  237. EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
  238. EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
  239. EGLNativePixmapType target);
  240. EGLAPI void (* EGLAPIENTRY eglGetProcAddress(const char *procname))(void);
  241. #ifdef __cplusplus
  242. }
  243. #endif
  244. #endif /* __egl_h_ */