1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/egl/eglinterface/include/1.2/egl.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,308 @@
1.4 +/*
1.5 +** Copyright (c) 2007-2009 The Khronos Group Inc.
1.6 +**
1.7 +** Permission is hereby granted, free of charge, to any person obtaining a
1.8 +** copy of this software and/or associated documentation files (the
1.9 +** "Materials"), to deal in the Materials without restriction, including
1.10 +** without limitation the rights to use, copy, modify, merge, publish,
1.11 +** distribute, sublicense, and/or sell copies of the Materials, and to
1.12 +** permit persons to whom the Materials are furnished to do so, subject to
1.13 +** the following conditions:
1.14 +**
1.15 +** The above copyright notice and this permission notice shall be included
1.16 +** in all copies or substantial portions of the Materials.
1.17 +**
1.18 +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1.19 +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1.20 +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1.21 +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1.22 +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1.23 +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1.24 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
1.25 +*/
1.26 +
1.27 +#ifndef __egl_h_
1.28 +#define __egl_h_
1.29 +
1.30 +/**
1.31 +@publishedAll
1.32 +@released
1.33 +*/
1.34 +
1.35 +
1.36 +#include <egl/egltypes.h>
1.37 +
1.38 +/*
1.39 +** egltypes.h is platform dependent. It defines:
1.40 +**
1.41 +** - EGL types and resources
1.42 +** - Native types
1.43 +** - EGL and native handle values
1.44 +**
1.45 +** EGL types and resources are to be typedef'ed with appropriate platform
1.46 +** dependent resource handle types. EGLint must be an integer of at least
1.47 +** 32-bit.
1.48 +**
1.49 +** NativeDisplayType, NativeWindowType and NativePixmapType are to be
1.50 +** replaced with corresponding types of the native window system in egl.h.
1.51 +**
1.52 +** EGL and native handle values must match their types.
1.53 +**
1.54 +** Example egltypes.h:
1.55 +*/
1.56 +
1.57 +#if 0
1.58 +
1.59 +#include <sys/types.h>
1.60 +#include <native_window_system.h>
1.61 +
1.62 +/*
1.63 +** Types and resources
1.64 +*/
1.65 +typedef int EGLBoolean;
1.66 +typedef int32_t EGLint;
1.67 +typedef int EGLenum;
1.68 +typedef void *EGLDisplay;
1.69 +typedef void *EGLConfig;
1.70 +typedef void *EGLSurface;
1.71 +typedef void *EGLContext;
1.72 +typedef void* EGLClientBuffer;
1.73 +
1.74 +/*
1.75 +** EGL and native handle values
1.76 +*/
1.77 +#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0)
1.78 +#define EGL_NO_CONTEXT ((EGLContext)0)
1.79 +#define EGL_NO_DISPLAY ((EGLDisplay)0)
1.80 +#define EGL_NO_SURFACE ((EGLSurface)0)
1.81 +
1.82 +#endif
1.83 +
1.84 +/*
1.85 +** Versioning and extensions
1.86 +*/
1.87 +#define EGL_VERSION_1_0 1
1.88 +#define EGL_VERSION_1_1 1
1.89 +#define EGL_VERSION_1_2 1
1.90 +
1.91 +/*
1.92 +** Boolean
1.93 +*/
1.94 +#define EGL_FALSE 0
1.95 +#define EGL_TRUE 1
1.96 +
1.97 +/*
1.98 +** Errors
1.99 +*/
1.100 +#define EGL_SUCCESS 0x3000
1.101 +#define EGL_NOT_INITIALIZED 0x3001
1.102 +#define EGL_BAD_ACCESS 0x3002
1.103 +#define EGL_BAD_ALLOC 0x3003
1.104 +#define EGL_BAD_ATTRIBUTE 0x3004
1.105 +#define EGL_BAD_CONFIG 0x3005
1.106 +#define EGL_BAD_CONTEXT 0x3006
1.107 +#define EGL_BAD_CURRENT_SURFACE 0x3007
1.108 +#define EGL_BAD_DISPLAY 0x3008
1.109 +#define EGL_BAD_MATCH 0x3009
1.110 +#define EGL_BAD_NATIVE_PIXMAP 0x300A
1.111 +#define EGL_BAD_NATIVE_WINDOW 0x300B
1.112 +#define EGL_BAD_PARAMETER 0x300C
1.113 +#define EGL_BAD_SURFACE 0x300D
1.114 +#define EGL_CONTEXT_LOST 0x300E
1.115 +/* 0x300F - 0x301F reserved for additional errors. */
1.116 +
1.117 +/*
1.118 +** Config attributes
1.119 +*/
1.120 +#define EGL_BUFFER_SIZE 0x3020
1.121 +#define EGL_ALPHA_SIZE 0x3021
1.122 +#define EGL_BLUE_SIZE 0x3022
1.123 +#define EGL_GREEN_SIZE 0x3023
1.124 +#define EGL_RED_SIZE 0x3024
1.125 +#define EGL_DEPTH_SIZE 0x3025
1.126 +#define EGL_STENCIL_SIZE 0x3026
1.127 +#define EGL_CONFIG_CAVEAT 0x3027
1.128 +#define EGL_CONFIG_ID 0x3028
1.129 +#define EGL_LEVEL 0x3029
1.130 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A
1.131 +#define EGL_MAX_PBUFFER_PIXELS 0x302B
1.132 +#define EGL_MAX_PBUFFER_WIDTH 0x302C
1.133 +#define EGL_NATIVE_RENDERABLE 0x302D
1.134 +#define EGL_NATIVE_VISUAL_ID 0x302E
1.135 +#define EGL_NATIVE_VISUAL_TYPE 0x302F
1.136 +#define EGL_PRESERVED_RESOURCES 0x3030
1.137 +#define EGL_SAMPLES 0x3031
1.138 +#define EGL_SAMPLE_BUFFERS 0x3032
1.139 +#define EGL_SURFACE_TYPE 0x3033
1.140 +#define EGL_TRANSPARENT_TYPE 0x3034
1.141 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
1.142 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
1.143 +#define EGL_TRANSPARENT_RED_VALUE 0x3037
1.144 +#define EGL_NONE 0x3038 /* Also a config value */
1.145 +#define EGL_BIND_TO_TEXTURE_RGB 0x3039
1.146 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
1.147 +#define EGL_MIN_SWAP_INTERVAL 0x303B
1.148 +#define EGL_MAX_SWAP_INTERVAL 0x303C
1.149 +#define EGL_LUMINANCE_SIZE 0x303D
1.150 +#define EGL_ALPHA_MASK_SIZE 0x303E
1.151 +#define EGL_COLOR_BUFFER_TYPE 0x303F
1.152 +#define EGL_RENDERABLE_TYPE 0x3040
1.153 +
1.154 +/*
1.155 +** Config values
1.156 +*/
1.157 +#define EGL_DONT_CARE ((EGLint) -1)
1.158 +
1.159 +#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
1.160 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */
1.161 +#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
1.162 +#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
1.163 +#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
1.164 +#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */
1.165 +#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */
1.166 +#define EGL_TEXTURE_RGBA 0x305E /* " */
1.167 +#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */
1.168 +
1.169 +/*
1.170 +** Config attribute mask bits
1.171 +*/
1.172 +#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bits */
1.173 +#define EGL_PIXMAP_BIT 0x02 /* EGL_SURFACE_TYPE mask bits */
1.174 +#define EGL_WINDOW_BIT 0x04 /* EGL_SURFACE_TYPE mask bits */
1.175 +#define EGL_OPENGL_ES_BIT 0x01 /* EGL_RENDERABLE_TYPE mask bits */
1.176 +#define EGL_OPENVG_BIT 0x02 /* EGL_RENDERABLE_TYPE mask bits */
1.177 +
1.178 +/*
1.179 +** String names
1.180 +*/
1.181 +#define EGL_VENDOR 0x3053
1.182 +#define EGL_VERSION 0x3054
1.183 +#define EGL_EXTENSIONS 0x3055
1.184 +#define EGL_CLIENT_APIS 0x308D
1.185 +
1.186 +/*
1.187 +** Surface attributes
1.188 +*/
1.189 +#define EGL_HEIGHT 0x3056
1.190 +#define EGL_WIDTH 0x3057
1.191 +#define EGL_LARGEST_PBUFFER 0x3058
1.192 +#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */
1.193 +#define EGL_TEXTURE_TARGET 0x3081 /* " */
1.194 +#define EGL_MIPMAP_TEXTURE 0x3082 /* " */
1.195 +#define EGL_MIPMAP_LEVEL 0x3083 /* " */
1.196 +#define EGL_RENDER_BUFFER 0x3086
1.197 +#define EGL_COLORSPACE 0x3087
1.198 +#define EGL_ALPHA_FORMAT 0x3088
1.199 +#define EGL_HORIZONTAL_RESOLUTION 0x3090
1.200 +#define EGL_VERTICAL_RESOLUTION 0x3091
1.201 +#define EGL_PIXEL_ASPECT_RATIO 0x3092
1.202 +#define EGL_SWAP_BEHAVIOR 0x3093
1.203 +
1.204 +/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
1.205 +#define EGL_BACK_BUFFER 0x3084
1.206 +#define EGL_SINGLE_BUFFER 0x3085
1.207 +
1.208 +/* OpenVG color spaces */
1.209 +#define EGL_COLORSPACE_sRGB 0x3089 /* EGL_COLORSPACE value */
1.210 +#define EGL_COLORSPACE_LINEAR 0x308A /* EGL_COLORSPACE value */
1.211 +
1.212 +/* OpenVG alpha formats */
1.213 +#define EGL_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
1.214 +#define EGL_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
1.215 +
1.216 +/* Constant scale factor by which fractional display resolutions &
1.217 + * aspect ratio are scaled when queried as integer values.
1.218 + */
1.219 +#define EGL_DISPLAY_SCALING 10000
1.220 +
1.221 +/* Unknown display resolution/aspect ratio */
1.222 +#define EGL_UNKNOWN ((EGLint)-1)
1.223 +
1.224 +/* Back buffer swap behaviors */
1.225 +#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
1.226 +#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
1.227 +
1.228 +/* CreatePbufferFromClientBuffer buffer types */
1.229 +#define EGL_OPENVG_IMAGE 0x3096
1.230 +
1.231 +/* QueryContext targets */
1.232 +#define EGL_CONTEXT_CLIENT_TYPE 0x3097
1.233 +
1.234 +/* BindAPI/QueryAPI targets */
1.235 +#define EGL_OPENGL_ES_API 0x30A0
1.236 +#define EGL_OPENVG_API 0x30A1
1.237 +
1.238 +/*
1.239 +** Current surfaces
1.240 +*/
1.241 +#define EGL_DRAW 0x3059
1.242 +#define EGL_READ 0x305A
1.243 +
1.244 +/*
1.245 +** Engines
1.246 +*/
1.247 +#define EGL_CORE_NATIVE_ENGINE 0x305B
1.248 +
1.249 +/* 0x305C-0x3FFFF reserved for future use */
1.250 +
1.251 +/*
1.252 +** Functions
1.253 +*/
1.254 +#ifdef __cplusplus
1.255 +extern "C" {
1.256 +#endif
1.257 +
1.258 +EGLAPI EGLint EGL_APIENTRY eglGetError (void);
1.259 +
1.260 +EGLAPI EGLDisplay EGL_APIENTRY eglGetDisplay (NativeDisplayType display_id);
1.261 +EGLAPI EGLBoolean EGL_APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
1.262 +EGLAPI EGLBoolean EGL_APIENTRY eglTerminate (EGLDisplay dpy);
1.263 +EGLAPI const char * EGL_APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
1.264 +#ifdef __cplusplus
1.265 +EGLAPI void (* EGL_APIENTRY eglGetProcAddress (const char *procname))(...);
1.266 +#else
1.267 +EGLAPI void (* EGL_APIENTRY eglGetProcAddress (const char *procname))();
1.268 +#endif
1.269 +
1.270 +EGLAPI EGLBoolean EGL_APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
1.271 +EGLAPI EGLBoolean EGL_APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
1.272 +EGLAPI EGLBoolean EGL_APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
1.273 +
1.274 +EGLAPI EGLSurface EGL_APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType win, const EGLint *attrib_list);
1.275 +EGLAPI EGLSurface EGL_APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
1.276 +EGLAPI EGLSurface EGL_APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
1.277 +EGLAPI EGLBoolean EGL_APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
1.278 +EGLAPI EGLBoolean EGL_APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
1.279 +
1.280 +/* EGL 1.1 render-to-texture APIs */
1.281 +EGLAPI EGLBoolean EGL_APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
1.282 +EGLAPI EGLBoolean EGL_APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
1.283 +EGLAPI EGLBoolean EGL_APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
1.284 +
1.285 +/* EGL 1.1 swap control API */
1.286 +EGLAPI EGLBoolean EGL_APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
1.287 +
1.288 +EGLAPI EGLContext EGL_APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
1.289 +EGLAPI EGLBoolean EGL_APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
1.290 +EGLAPI EGLBoolean EGL_APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
1.291 +EGLAPI EGLContext EGL_APIENTRY eglGetCurrentContext (void);
1.292 +EGLAPI EGLSurface EGL_APIENTRY eglGetCurrentSurface (EGLint readdraw);
1.293 +EGLAPI EGLDisplay EGL_APIENTRY eglGetCurrentDisplay (void);
1.294 +EGLAPI EGLBoolean EGL_APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
1.295 +
1.296 +EGLAPI EGLBoolean EGL_APIENTRY eglWaitGL (void);
1.297 +EGLAPI EGLBoolean EGL_APIENTRY eglWaitNative (EGLint engine);
1.298 +EGLAPI EGLBoolean EGL_APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
1.299 +EGLAPI EGLBoolean EGL_APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
1.300 +
1.301 +EGLAPI EGLSurface EGL_APIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
1.302 +EGLAPI EGLBoolean EGL_APIENTRY eglWaitClient (void);
1.303 +EGLAPI EGLBoolean EGL_APIENTRY eglBindAPI (EGLenum api);
1.304 +EGLAPI EGLenum EGL_APIENTRY eglQueryAPI (void);
1.305 +EGLAPI EGLBoolean EGL_APIENTRY eglReleaseThread (void);
1.306 +
1.307 +#ifdef __cplusplus
1.308 +}
1.309 +#endif
1.310 +
1.311 +#endif /* ___egl_h_ */