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 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. #ifndef _EGL_H
  2. #define _EGL_H
  3. /*
  4. ** License Applicability. Except to the extent portions of this file are
  5. ** made subject to an alternative license as permitted in the SGI Free
  6. ** Software License B, Version 1.0 (the "License"), the contents of this
  7. ** file are subject only to the provisions of the License. You may not use
  8. ** this file except in compliance with the License. You may obtain a copy
  9. ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
  10. ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
  11. **
  12. ** http://oss.sgi.com/projects/FreeB
  13. **
  14. ** Note that, as provided in the License, the Software is distributed on an
  15. ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
  16. ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
  17. ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
  18. ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
  19. **
  20. ** Original Code. The Original Code is: OpenGL Sample Implementation,
  21. ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
  22. ** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
  23. ** Copyright in any portions created by third parties is as indicated
  24. ** elsewhere herein. All Rights Reserved.
  25. **
  26. ** Additional Notice Provisions: The application programming interfaces
  27. ** established by SGI in conjunction with the Original Code are The
  28. ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
  29. ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
  30. ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
  31. ** Window System(R) (Version 1.3), released October 19, 1998. This software
  32. ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
  33. ** published by SGI, but has not been independently verified as being
  34. ** compliant with the OpenGL(R) version 1.2.1 Specification.
  35. */
  36. #if 0/*XXX TEMPORARY HACK*/
  37. #include <GLES/gl.h>
  38. #else
  39. #include <GL/gl.h>
  40. #endif
  41. #include <GLES/egltypes.h>
  42. /* XXX should go in eglext.h */
  43. #define GL_OES_VERSION_1_0 1
  44. #define GL_OES_read_format 1
  45. #define GL_OES_compressed_paletted_texture 1
  46. #define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
  47. #define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
  48. #define GL_PALETTE4_RGB8_OES 0x8B90
  49. #define GL_PALETTE4_RGBA8_OES 0x8B91
  50. #define GL_PALETTE4_R5_G6_B5_OES 0x8B92
  51. #define GL_PALETTE4_RGBA4_OES 0x8B93
  52. #define GL_PALETTE4_RGB5_A1_OES 0x8B94
  53. #define GL_PALETTE8_RGB8_OES 0x8B95
  54. #define GL_PALETTE8_RGBA8_OES 0x8B96
  55. #define GL_PALETTE8_R5_G6_B5_OES 0x8B97
  56. #define GL_PALETTE8_RGBA4_OES 0x8B98
  57. #define GL_PALETTE8_RGB5_A1_OES 0x8B99
  58. /* XXX */
  59. /*
  60. ** Versioning and extensions
  61. */
  62. #define EGL_VERSION_1_0 1
  63. #define EGL_VERSION_1_1 1
  64. /*
  65. ** Boolean
  66. */
  67. #define EGL_FALSE 0
  68. #define EGL_TRUE 1
  69. /*
  70. ** Errors
  71. */
  72. #define EGL_SUCCESS 0x3000
  73. #define EGL_NOT_INITIALIZED 0x3001
  74. #define EGL_BAD_ACCESS 0x3002
  75. #define EGL_BAD_ALLOC 0x3003
  76. #define EGL_BAD_ATTRIBUTE 0x3004
  77. #define EGL_BAD_CONFIG 0x3005
  78. #define EGL_BAD_CONTEXT 0x3006
  79. #define EGL_BAD_CURRENT_SURFACE 0x3007
  80. #define EGL_BAD_DISPLAY 0x3008
  81. #define EGL_BAD_MATCH 0x3009
  82. #define EGL_BAD_NATIVE_PIXMAP 0x300A
  83. #define EGL_BAD_NATIVE_WINDOW 0x300B
  84. #define EGL_BAD_PARAMETER 0x300C
  85. #define EGL_BAD_SURFACE 0x300D
  86. #define EGL_CONTEXT_LOST 0x300E
  87. /* 0x300F - 0x301F reserved for additional errors. */
  88. /*
  89. ** Config attributes
  90. */
  91. #define EGL_BUFFER_SIZE 0x3020
  92. #define EGL_ALPHA_SIZE 0x3021
  93. #define EGL_BLUE_SIZE 0x3022
  94. #define EGL_GREEN_SIZE 0x3023
  95. #define EGL_RED_SIZE 0x3024
  96. #define EGL_DEPTH_SIZE 0x3025
  97. #define EGL_STENCIL_SIZE 0x3026
  98. #define EGL_CONFIG_CAVEAT 0x3027
  99. #define EGL_CONFIG_ID 0x3028
  100. #define EGL_LEVEL 0x3029
  101. #define EGL_MAX_PBUFFER_HEIGHT 0x302A
  102. #define EGL_MAX_PBUFFER_PIXELS 0x302B
  103. #define EGL_MAX_PBUFFER_WIDTH 0x302C
  104. #define EGL_NATIVE_RENDERABLE 0x302D
  105. #define EGL_NATIVE_VISUAL_ID 0x302E
  106. #define EGL_NATIVE_VISUAL_TYPE 0x302F
  107. /*#define EGL_PRESERVED_RESOURCES 0x3030*/
  108. #define EGL_SAMPLES 0x3031
  109. #define EGL_SAMPLE_BUFFERS 0x3032
  110. #define EGL_SURFACE_TYPE 0x3033
  111. #define EGL_TRANSPARENT_TYPE 0x3034
  112. #define EGL_TRANSPARENT_BLUE_VALUE 0x3035
  113. #define EGL_TRANSPARENT_GREEN_VALUE 0x3036
  114. #define EGL_TRANSPARENT_RED_VALUE 0x3037
  115. #define EGL_NONE 0x3038 /* Also a config value */
  116. #define EGL_BIND_TO_TEXTURE_RGB 0x3039
  117. #define EGL_BIND_TO_TEXTURE_RGBA 0x303A
  118. #define EGL_MIN_SWAP_INTERVAL 0x303B
  119. #define EGL_MAX_SWAP_INTERVAL 0x303C
  120. /*
  121. ** Config values
  122. */
  123. #define EGL_DONT_CARE ((EGLint) -1)
  124. #define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
  125. #define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */
  126. #define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
  127. #define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */
  128. #define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */
  129. #define EGL_TEXTURE_RGBA 0x305E /* " */
  130. #define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */
  131. /*
  132. ** Config attribute mask bits
  133. */
  134. #define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */
  135. #define EGL_PIXMAP_BIT 0x02 /* " */
  136. #define EGL_WINDOW_BIT 0x04 /* " */
  137. /*
  138. ** String names
  139. */
  140. #define EGL_VENDOR 0x3053 /* eglQueryString target */
  141. #define EGL_VERSION 0x3054 /* " */
  142. #define EGL_EXTENSIONS 0x3055 /* " */
  143. /*
  144. ** Surface attributes
  145. */
  146. #define EGL_HEIGHT 0x3056
  147. #define EGL_WIDTH 0x3057
  148. #define EGL_LARGEST_PBUFFER 0x3058
  149. #define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */
  150. #define EGL_TEXTURE_TARGET 0x3081 /* " */
  151. #define EGL_MIPMAP_TEXTURE 0x3082 /* " */
  152. #define EGL_MIPMAP_LEVEL 0x3083 /* " */
  153. /*
  154. ** BindTexImage / ReleaseTexImage buffer target
  155. */
  156. #define EGL_BACK_BUFFER 0x3084
  157. /*
  158. ** Current surfaces
  159. */
  160. #define EGL_DRAW 0x3059
  161. #define EGL_READ 0x305A
  162. /*
  163. ** Engines
  164. */
  165. #define EGL_CORE_NATIVE_ENGINE 0x305B
  166. /* 0x305C-0x3FFFF reserved for future use */
  167. /*
  168. ** Functions
  169. */
  170. #ifdef __cplusplus
  171. extern "C" {
  172. #endif
  173. GLAPI EGLint APIENTRY eglGetError (void);
  174. GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display);
  175. GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
  176. GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy);
  177. GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
  178. GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(void);
  179. GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
  180. GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
  181. GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
  182. GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
  183. GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
  184. GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
  185. GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
  186. GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
  187. /* EGL 1.1 render-to-texture APIs */
  188. GLAPI EGLBoolean APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
  189. GLAPI EGLBoolean APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
  190. GLAPI EGLBoolean APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
  191. /* EGL 1.1 swap control API */
  192. GLAPI EGLBoolean APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
  193. GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
  194. GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
  195. GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
  196. GLAPI EGLContext APIENTRY eglGetCurrentContext (void);
  197. GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw);
  198. GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void);
  199. GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
  200. GLAPI EGLBoolean APIENTRY eglWaitGL (void);
  201. GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine);
  202. GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
  203. GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
  204. /* EGL_MESA_screen extension >>> PRELIMINARY <<< */
  205. #ifndef EGL_MESA_screen_surface
  206. #define EGL_MESA_screen_surface 1
  207. #define EGL_BAD_SCREEN_MESA 0x4000
  208. #define EGL_BAD_MODE_MESA 0x4001
  209. #define EGL_SCREEN_COUNT_MESA 0x4002
  210. #define EGL_SCREEN_POSITION_MESA 0x4003
  211. #define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004
  212. #define EGL_MODE_ID_MESA 0x4005
  213. #define EGL_REFRESH_RATE_MESA 0x4006
  214. #define EGL_OPTIMAL_MESA 0x4007
  215. #define EGL_INTERLACED_MESA 0x4008
  216. #define EGL_SCREEN_BIT_MESA 0x08
  217. GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
  218. GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
  219. GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
  220. GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
  221. GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
  222. GLAPI EGLBoolean APIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
  223. GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
  224. GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
  225. GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
  226. GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
  227. GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
  228. #endif /* EGL_MESA_screen_surface */
  229. #ifndef EGL_MESA_copy_context
  230. #define EGL_MESA_copy_context 1
  231. GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
  232. #endif /* EGL_MESA_copy_context */
  233. /* XXX this is preliminary! */
  234. #ifndef EGL_VERSION_1_2
  235. #define EGL_VERSION_1_2 1
  236. typedef int EGLenum;
  237. typedef int EGLClientBuffer;
  238. #define EGL_DISPLAY_SCALING 10000
  239. #define EGL_UNKNOWN ((EGLint)-1)
  240. #define EGL_OPENGL_ES_BIT 0x1
  241. #define EGL_OPENVG_BIT 0x2
  242. #define EGL_OPENGL_ES_API 0x30A0
  243. #define EGL_OPENVG_API 0x30A1
  244. #define EGL_LUMINANCE_SIZE 0x303D
  245. #define EGL_ALPHA_MASK_SIZE 0x303E
  246. #define EGL_COLOR_BUFFER_TYPE 0x303F
  247. #define EGL_RENDERABLE_TYPE 0x3040
  248. #define EGL_SINGLE_BUFFER 0x3085
  249. #define EGL_RENDER_BUFFER 0x3086
  250. #define EGL_COLORSPACE 0x3087
  251. #define EGL_ALPHA_FORMAT 0x3088
  252. #define EGL_COLORSPACE_sRGB 0x3089
  253. #define EGL_COLORSPACE_LINEAR 0x308A
  254. #define EGL_ALPHA_FORMAT_NONPRE 0x308B
  255. #define EGL_ALPHA_FORMAT_PRE 0x308C
  256. #define EGL_CLIENT_APIS 0x308D
  257. #define EGL_RGB_BUFFER 0x308E
  258. #define EGL_LUMINANCE_BUFFER 0x308F
  259. #define EGL_HORIZONTAL_RESOLUTION 0x3090
  260. #define EGL_VERTICAL_RESOLUTION 0x3091
  261. #define EGL_PIXEL_ASPECT_RATIO 0x3092
  262. #define EGL_SWAP_BEHAVIOR 0x3093
  263. #define EGL_BUFFER_PRESERVED 0x3094
  264. #define EGL_BUFFER_DESTROYED 0x3095
  265. #define EGL_OPENVG_IMAGE 0x3096
  266. #define EGL_CONTEXT_CLIENT_TYPE 0x3097
  267. GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api);
  268. GLAPI EGLenum APIENTRY eglQueryAPI(void);
  269. GLAPI EGLBoolean APIENTRY eglWaitClient(void);
  270. GLAPI EGLBoolean APIENTRY eglReleaseThread(void);
  271. GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
  272. #endif /* EGL_VERSION_1_2 */
  273. #ifdef __cplusplus
  274. }
  275. #endif
  276. #endif /* _EGL_H */