1/* Sketchy version of egl.h (really only for reserving 2 * enumerant values to EGL tokens and sanity checking 3 * prototypes). 4 * 5 * Last modified 2006/08/13 6 */ 7 8#ifndef __egl_h_ 9#define __egl_h_ 10 11/* Windows calling convention boilerplate */ 12#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) 13#define WIN32_LEAN_AND_MEAN 1 14#include <windows.h> 15#endif 16 17#ifndef APIENTRY 18#define APIENTRY 19#endif 20#ifndef EGLAPI 21#define EGLAPI extern 22#endif 23 24 25/* EGL Types */ 26#include <sys/types.h> 27 28typedef int32_t EGLint; 29typedef unsigned int EGLBoolean; 30typedef unsigned int EGLenum; 31typedef void *EGLConfig; 32typedef void *EGLContext; 33typedef void *EGLDisplay; 34typedef void *EGLSurface; 35typedef void *EGLClientBuffer; 36/* NativeDisplayType, NativeWindowType, NativePixmapType TBD */ 37 38/* EGL Versioning */ 39#define EGL_VERSION_1_0 1 40#define EGL_VERSION_1_1 1 41#define EGL_VERSION_1_2 1 42#define EGL_VERSION_1_3 1 43 44/* EGL Enumerants. Exceptional cases aside, most 45 * enums are assigned unique values starting at 0x3000. 46 */ 47 48/* EGL aliases */ 49#define EGL_FALSE 0 50#define EGL_TRUE 1 51 52/* Out-of-band handle values */ 53/* These values may vary depending on semantics of native concepts */ 54#define EGL_DEFAULT_DISPLAY ((void *)0) 55#define EGL_NO_CONTEXT ((EGLContext)0) 56#define EGL_NO_DISPLAY ((EGLDisplay)0) 57#define EGL_NO_SURFACE ((EGLSurface)0) 58 59/* Out-of-band attribute value */ 60#define EGL_DONT_CARE ((EGLint)-1) 61 62/* Errors / GetError return values */ 63#define EGL_SUCCESS 0x3000 64#define EGL_NOT_INITIALIZED 0x3001 65#define EGL_BAD_ACCESS 0x3002 66#define EGL_BAD_ALLOC 0x3003 67#define EGL_BAD_ATTRIBUTE 0x3004 68#define EGL_BAD_CONFIG 0x3005 69#define EGL_BAD_CONTEXT 0x3006 70#define EGL_BAD_CURRENT_SURFACE 0x3007 71#define EGL_BAD_DISPLAY 0x3008 72#define EGL_BAD_MATCH 0x3009 73#define EGL_BAD_NATIVE_PIXMAP 0x300A 74#define EGL_BAD_NATIVE_WINDOW 0x300B 75#define EGL_BAD_PARAMETER 0x300C 76#define EGL_BAD_SURFACE 0x300D 77#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ 78 79/* Reserved 0x300F-0x301F for additional errors */ 80 81/* Config attributes */ 82#define EGL_BUFFER_SIZE 0x3020 83#define EGL_ALPHA_SIZE 0x3021 84#define EGL_BLUE_SIZE 0x3022 85#define EGL_GREEN_SIZE 0x3023 86#define EGL_RED_SIZE 0x3024 87#define EGL_DEPTH_SIZE 0x3025 88#define EGL_STENCIL_SIZE 0x3026 89#define EGL_CONFIG_CAVEAT 0x3027 90#define EGL_CONFIG_ID 0x3028 91#define EGL_LEVEL 0x3029 92#define EGL_MAX_PBUFFER_HEIGHT 0x302A 93#define EGL_MAX_PBUFFER_PIXELS 0x302B 94#define EGL_MAX_PBUFFER_WIDTH 0x302C 95#define EGL_NATIVE_RENDERABLE 0x302D 96#define EGL_NATIVE_VISUAL_ID 0x302E 97#define EGL_NATIVE_VISUAL_TYPE 0x302F 98#define EGL_PRESERVED_RESOURCES 0x3030 99#define EGL_SAMPLES 0x3031 100#define EGL_SAMPLE_BUFFERS 0x3032 101#define EGL_SURFACE_TYPE 0x3033 102#define EGL_TRANSPARENT_TYPE 0x3034 103#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 104#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 105#define EGL_TRANSPARENT_RED_VALUE 0x3037 106#define EGL_NONE 0x3038 /* Attrib list terminator */ 107#define EGL_BIND_TO_TEXTURE_RGB 0x3039 108#define EGL_BIND_TO_TEXTURE_RGBA 0x303A 109#define EGL_MIN_SWAP_INTERVAL 0x303B 110#define EGL_MAX_SWAP_INTERVAL 0x303C 111#define EGL_LUMINANCE_SIZE 0x303D 112#define EGL_ALPHA_MASK_SIZE 0x303E 113#define EGL_COLOR_BUFFER_TYPE 0x303F 114#define EGL_RENDERABLE_TYPE 0x3040 115#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ 116 117/* Reserved 0x3041-0x304F for additional config attributes */ 118 119/* Config attribute values */ 120#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ 121#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ 122#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ 123#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ 124#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ 125 126/* More config attribute values, for EGL_TEXTURE_FORMAT */ 127#define EGL_NO_TEXTURE 0x305C 128#define EGL_TEXTURE_RGB 0x305D 129#define EGL_TEXTURE_RGBA 0x305E 130#define EGL_TEXTURE_2D 0x305F 131 132/* Config attribute mask bits */ 133#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bits */ 134#define EGL_PIXMAP_BIT 0x02 /* EGL_SURFACE_TYPE mask bits */ 135#define EGL_WINDOW_BIT 0x04 /* EGL_SURFACE_TYPE mask bits */ 136#define EGL_OPENGL_ES_BIT 0x01 /* EGL_RENDERABLE_TYPE mask bits */ 137#define EGL_OPENVG_BIT 0x02 /* EGL_RENDERABLE_TYPE mask bits */ 138#define EGL_OPENGL_ES2_BIT 0x04 /* EGL_RENDERABLE_TYPE mask bits */ 139 140/* QueryString targets */ 141#define EGL_VENDOR 0x3053 142#define EGL_VERSION 0x3054 143#define EGL_EXTENSIONS 0x3055 144#define EGL_CLIENT_APIS 0x308D 145 146/* QuerySurface / CreatePbufferSurface targets */ 147#define EGL_HEIGHT 0x3056 148#define EGL_WIDTH 0x3057 149#define EGL_LARGEST_PBUFFER 0x3058 150#define EGL_TEXTURE_FORMAT 0x3080 151#define EGL_TEXTURE_TARGET 0x3081 152#define EGL_MIPMAP_TEXTURE 0x3082 153#define EGL_MIPMAP_LEVEL 0x3083 154#define EGL_RENDER_BUFFER 0x3086 155#define EGL_COLORSPACE 0x3087 156#define EGL_ALPHA_FORMAT 0x3088 157#define EGL_HORIZONTAL_RESOLUTION 0x3090 158#define EGL_VERTICAL_RESOLUTION 0x3091 159#define EGL_PIXEL_ASPECT_RATIO 0x3092 160#define EGL_SWAP_BEHAVIOR 0x3093 161 162/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ 163#define EGL_BACK_BUFFER 0x3084 164#define EGL_SINGLE_BUFFER 0x3085 165 166/* OpenVG color spaces */ 167#define EGL_COLORSPACE_sRGB 0x3089 /* EGL_COLORSPACE value */ 168#define EGL_COLORSPACE_LINEAR 0x308A /* EGL_COLORSPACE value */ 169 170/* OpenVG alpha formats */ 171#define EGL_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ 172#define EGL_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ 173 174/* Constant scale factor by which fractional display resolutions & 175 * aspect ratio are scaled when queried as integer values. 176 */ 177#define EGL_DISPLAY_SCALING 10000 178 179/* Unknown display resolution/aspect ratio */ 180#define EGL_UNKNOWN ((EGLint)-1) 181 182/* Back buffer swap behaviors */ 183#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ 184#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ 185 186/* CreatePbufferFromClientBuffer buffer types */ 187#define EGL_OPENVG_IMAGE 0x3096 188 189/* QueryContext targets */ 190#define EGL_CONTEXT_CLIENT_TYPE 0x3097 191 192/* CreateContext attributes */ 193#define EGL_CONTEXT_CLIENT_VERSION 0x3098 194 195/* BindAPI/QueryAPI targets */ 196#define EGL_OPENGL_ES_API 0x30A0 197#define EGL_OPENVG_API 0x30A1 198 199/* GetCurrentSurface targets */ 200#define EGL_DRAW 0x3059 201#define EGL_READ 0x305A 202 203/* WaitNative engines */ 204#define EGL_CORE_NATIVE_ENGINE 0x305B 205 206/* EGL extensions must request enum blocks from the OpenGL ARB 207 * Secretary, who maintains the EGL enumerant registry. 208 */ 209 210 211 212/* EGL Functions */ 213 214EGLAPI EGLint APIENTRY eglGetError(); 215 216EGLAPI EGLDisplay APIENTRY eglGetDisplay(const char *display_id); 217EGLAPI EGLBoolean APIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); 218EGLAPI EGLBoolean APIENTRY eglTerminate(EGLDisplay dpy); 219 220EGLAPI const char * APIENTRY eglQueryString(EGLDisplay dpy, EGLint name); 221 222EGLAPI EGLBoolean APIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, 223 EGLint config_size, EGLint *num_config); 224EGLAPI EGLBoolean APIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, 225 EGLConfig *configs, EGLint config_size, 226 EGLint *num_config); 227EGLAPI EGLBoolean APIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, 228 EGLint attribute, EGLint *value); 229 230EGLAPI EGLSurface APIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, 231 NativeWindowType win, 232 const EGLint *attrib_list); 233EGLAPI EGLSurface APIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, 234 const EGLint *attrib_list); 235EGLAPI EGLSurface APIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, 236 NativePixmapType pixmap, 237 const EGLint *attrib_list); 238EGLAPI EGLBoolean APIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); 239EGLAPI EGLBoolean APIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, 240 EGLint attribute, EGLint *value); 241 242EGLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api); 243EGLAPI EGLenum APIENTRY eglQueryAPI(void); 244 245EGLAPI EGLBoolean APIENTRY eglWaitClient(void); 246 247EGLAPI EGLBoolean APIENTRY eglReleaseThread(void); 248 249EGLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer( 250 EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, 251 EGLConfig config, const EGLint *attrib_list); 252 253EGLAPI EGLBoolean APIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, 254 EGLint attribute, EGLint value); 255EGLAPI EGLBoolean APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 256EGLAPI EGLBoolean APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 257 258 259EGLAPI EGLBoolean APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); 260 261 262EGLAPI EGLContext APIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, 263 EGLContext share_context, 264 const EGLint *attrib_list); 265EGLAPI EGLBoolean APIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); 266EGLAPI EGLBoolean APIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, 267 EGLSurface read, EGLContext ctx); 268 269EGLAPI EGLContext APIENTRY eglGetCurrentContext(void); 270EGLAPI EGLSurface APIENTRY eglGetCurrentSurface(EGLint readdraw); 271EGLAPI EGLDisplay APIENTRY eglGetCurrentDisplay(void); 272EGLAPI EGLBoolean APIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, 273 EGLint attribute, EGLint *value); 274 275EGLAPI EGLBoolean APIENTRY eglWaitGL(void); 276EGLAPI EGLBoolean APIENTRY eglWaitNative(EGLint engine); 277EGLAPI EGLBoolean APIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); 278EGLAPI EGLBoolean APIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, 279 NativePixmapType target); 280 281EGLAPI void (* APIENTRY eglGetProcAddress(const char *procname))(); 282 283#endif /* __egl_h_ */ 284