os/graphics/egl/eglinterface/include/1.2/egl.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
** Copyright (c) 2007-2009 The Khronos Group Inc.
sl@0
     3
**
sl@0
     4
** Permission is hereby granted, free of charge, to any person obtaining a
sl@0
     5
** copy of this software and/or associated documentation files (the
sl@0
     6
** "Materials"), to deal in the Materials without restriction, including
sl@0
     7
** without limitation the rights to use, copy, modify, merge, publish,
sl@0
     8
** distribute, sublicense, and/or sell copies of the Materials, and to
sl@0
     9
** permit persons to whom the Materials are furnished to do so, subject to
sl@0
    10
** the following conditions:
sl@0
    11
**
sl@0
    12
** The above copyright notice and this permission notice shall be included
sl@0
    13
** in all copies or substantial portions of the Materials.
sl@0
    14
**
sl@0
    15
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
sl@0
    16
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
sl@0
    17
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
sl@0
    18
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
sl@0
    19
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
sl@0
    20
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
sl@0
    21
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef __egl_h_
sl@0
    25
#define __egl_h_
sl@0
    26
sl@0
    27
/**
sl@0
    28
@publishedAll
sl@0
    29
@released
sl@0
    30
*/
sl@0
    31
sl@0
    32
sl@0
    33
#include <egl/egltypes.h>
sl@0
    34
sl@0
    35
/*
sl@0
    36
** egltypes.h is platform dependent. It defines:
sl@0
    37
**
sl@0
    38
**     - EGL types and resources
sl@0
    39
**     - Native types
sl@0
    40
**     - EGL and native handle values
sl@0
    41
**
sl@0
    42
** EGL types and resources are to be typedef'ed with appropriate platform
sl@0
    43
** dependent resource handle types. EGLint must be an integer of at least
sl@0
    44
** 32-bit.
sl@0
    45
**
sl@0
    46
** NativeDisplayType, NativeWindowType and NativePixmapType are to be
sl@0
    47
** replaced with corresponding types of the native window system in egl.h.
sl@0
    48
**
sl@0
    49
** EGL and native handle values must match their types.
sl@0
    50
**
sl@0
    51
** Example egltypes.h:
sl@0
    52
*/
sl@0
    53
sl@0
    54
#if 0
sl@0
    55
sl@0
    56
#include <sys/types.h>
sl@0
    57
#include <native_window_system.h>
sl@0
    58
sl@0
    59
/*
sl@0
    60
** Types and resources
sl@0
    61
*/
sl@0
    62
typedef int EGLBoolean;
sl@0
    63
typedef int32_t EGLint;
sl@0
    64
typedef int EGLenum;
sl@0
    65
typedef void *EGLDisplay;
sl@0
    66
typedef void *EGLConfig;
sl@0
    67
typedef void *EGLSurface;
sl@0
    68
typedef void *EGLContext;
sl@0
    69
typedef void* EGLClientBuffer;
sl@0
    70
sl@0
    71
/*
sl@0
    72
** EGL and native handle values
sl@0
    73
*/
sl@0
    74
#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0)
sl@0
    75
#define EGL_NO_CONTEXT ((EGLContext)0)
sl@0
    76
#define EGL_NO_DISPLAY ((EGLDisplay)0)
sl@0
    77
#define EGL_NO_SURFACE ((EGLSurface)0)
sl@0
    78
sl@0
    79
#endif
sl@0
    80
sl@0
    81
/*
sl@0
    82
** Versioning and extensions
sl@0
    83
*/
sl@0
    84
#define EGL_VERSION_1_0                1
sl@0
    85
#define EGL_VERSION_1_1                1
sl@0
    86
#define EGL_VERSION_1_2                1
sl@0
    87
sl@0
    88
/*
sl@0
    89
** Boolean
sl@0
    90
*/
sl@0
    91
#define EGL_FALSE                      0
sl@0
    92
#define EGL_TRUE                       1
sl@0
    93
sl@0
    94
/*
sl@0
    95
** Errors
sl@0
    96
*/
sl@0
    97
#define EGL_SUCCESS                    0x3000
sl@0
    98
#define EGL_NOT_INITIALIZED            0x3001
sl@0
    99
#define EGL_BAD_ACCESS                 0x3002
sl@0
   100
#define EGL_BAD_ALLOC                  0x3003
sl@0
   101
#define EGL_BAD_ATTRIBUTE              0x3004
sl@0
   102
#define EGL_BAD_CONFIG                 0x3005
sl@0
   103
#define EGL_BAD_CONTEXT                0x3006
sl@0
   104
#define EGL_BAD_CURRENT_SURFACE        0x3007
sl@0
   105
#define EGL_BAD_DISPLAY                0x3008
sl@0
   106
#define EGL_BAD_MATCH                  0x3009
sl@0
   107
#define EGL_BAD_NATIVE_PIXMAP          0x300A
sl@0
   108
#define EGL_BAD_NATIVE_WINDOW          0x300B
sl@0
   109
#define EGL_BAD_PARAMETER              0x300C
sl@0
   110
#define EGL_BAD_SURFACE                0x300D
sl@0
   111
#define EGL_CONTEXT_LOST               0x300E
sl@0
   112
/* 0x300F - 0x301F reserved for additional errors. */
sl@0
   113
sl@0
   114
/*
sl@0
   115
** Config attributes
sl@0
   116
*/
sl@0
   117
#define EGL_BUFFER_SIZE                0x3020
sl@0
   118
#define EGL_ALPHA_SIZE                 0x3021
sl@0
   119
#define EGL_BLUE_SIZE                  0x3022
sl@0
   120
#define EGL_GREEN_SIZE                 0x3023
sl@0
   121
#define EGL_RED_SIZE                   0x3024
sl@0
   122
#define EGL_DEPTH_SIZE                 0x3025
sl@0
   123
#define EGL_STENCIL_SIZE               0x3026
sl@0
   124
#define EGL_CONFIG_CAVEAT              0x3027
sl@0
   125
#define EGL_CONFIG_ID                  0x3028
sl@0
   126
#define EGL_LEVEL                      0x3029
sl@0
   127
#define EGL_MAX_PBUFFER_HEIGHT         0x302A
sl@0
   128
#define EGL_MAX_PBUFFER_PIXELS         0x302B
sl@0
   129
#define EGL_MAX_PBUFFER_WIDTH          0x302C
sl@0
   130
#define EGL_NATIVE_RENDERABLE          0x302D
sl@0
   131
#define EGL_NATIVE_VISUAL_ID           0x302E
sl@0
   132
#define EGL_NATIVE_VISUAL_TYPE         0x302F
sl@0
   133
#define EGL_PRESERVED_RESOURCES        0x3030
sl@0
   134
#define EGL_SAMPLES                    0x3031
sl@0
   135
#define EGL_SAMPLE_BUFFERS             0x3032
sl@0
   136
#define EGL_SURFACE_TYPE               0x3033
sl@0
   137
#define EGL_TRANSPARENT_TYPE           0x3034
sl@0
   138
#define EGL_TRANSPARENT_BLUE_VALUE     0x3035
sl@0
   139
#define EGL_TRANSPARENT_GREEN_VALUE    0x3036
sl@0
   140
#define EGL_TRANSPARENT_RED_VALUE      0x3037
sl@0
   141
#define EGL_NONE                       0x3038   /* Also a config value */
sl@0
   142
#define EGL_BIND_TO_TEXTURE_RGB        0x3039
sl@0
   143
#define EGL_BIND_TO_TEXTURE_RGBA       0x303A
sl@0
   144
#define EGL_MIN_SWAP_INTERVAL          0x303B
sl@0
   145
#define EGL_MAX_SWAP_INTERVAL          0x303C
sl@0
   146
#define EGL_LUMINANCE_SIZE             0x303D
sl@0
   147
#define EGL_ALPHA_MASK_SIZE            0x303E
sl@0
   148
#define EGL_COLOR_BUFFER_TYPE          0x303F
sl@0
   149
#define EGL_RENDERABLE_TYPE            0x3040
sl@0
   150
sl@0
   151
/*
sl@0
   152
** Config values
sl@0
   153
*/
sl@0
   154
#define EGL_DONT_CARE                  ((EGLint) -1)
sl@0
   155
sl@0
   156
#define EGL_SLOW_CONFIG                0x3050   /* EGL_CONFIG_CAVEAT value */
sl@0
   157
#define EGL_NON_CONFORMANT_CONFIG      0x3051   /* " */
sl@0
   158
#define EGL_TRANSPARENT_RGB	           0x3052   /* EGL_TRANSPARENT_TYPE value */
sl@0
   159
#define EGL_RGB_BUFFER                 0x308E   /* EGL_COLOR_BUFFER_TYPE value */
sl@0
   160
#define EGL_LUMINANCE_BUFFER           0x308F   /* EGL_COLOR_BUFFER_TYPE value */
sl@0
   161
#define EGL_NO_TEXTURE                 0x305C   /* EGL_TEXTURE_FORMAT/TARGET value */
sl@0
   162
#define EGL_TEXTURE_RGB                0x305D   /* EGL_TEXTURE_FORMAT value */
sl@0
   163
#define EGL_TEXTURE_RGBA               0x305E   /* " */
sl@0
   164
#define EGL_TEXTURE_2D                 0x305F   /* EGL_TEXTURE_TARGET value */
sl@0
   165
sl@0
   166
/*
sl@0
   167
** Config attribute mask bits
sl@0
   168
*/
sl@0
   169
#define EGL_PBUFFER_BIT                0x01   /* EGL_SURFACE_TYPE mask bits */
sl@0
   170
#define EGL_PIXMAP_BIT                 0x02   /* EGL_SURFACE_TYPE mask bits */
sl@0
   171
#define EGL_WINDOW_BIT                 0x04   /* EGL_SURFACE_TYPE mask bits */
sl@0
   172
#define EGL_OPENGL_ES_BIT              0x01   /* EGL_RENDERABLE_TYPE mask bits */
sl@0
   173
#define EGL_OPENVG_BIT                 0x02   /* EGL_RENDERABLE_TYPE mask bits */
sl@0
   174
sl@0
   175
/*
sl@0
   176
** String names
sl@0
   177
*/
sl@0
   178
#define EGL_VENDOR                     0x3053
sl@0
   179
#define EGL_VERSION                    0x3054
sl@0
   180
#define EGL_EXTENSIONS                 0x3055
sl@0
   181
#define EGL_CLIENT_APIS                0x308D
sl@0
   182
sl@0
   183
/*
sl@0
   184
** Surface attributes
sl@0
   185
*/
sl@0
   186
#define EGL_HEIGHT                     0x3056
sl@0
   187
#define EGL_WIDTH                      0x3057
sl@0
   188
#define EGL_LARGEST_PBUFFER            0x3058
sl@0
   189
#define EGL_TEXTURE_FORMAT             0x3080   /* For pbuffers bound as textures */
sl@0
   190
#define EGL_TEXTURE_TARGET             0x3081   /* " */
sl@0
   191
#define EGL_MIPMAP_TEXTURE             0x3082   /* " */
sl@0
   192
#define EGL_MIPMAP_LEVEL               0x3083   /* " */
sl@0
   193
#define EGL_RENDER_BUFFER              0x3086
sl@0
   194
#define EGL_COLORSPACE                 0x3087
sl@0
   195
#define EGL_ALPHA_FORMAT               0x3088
sl@0
   196
#define EGL_HORIZONTAL_RESOLUTION      0x3090
sl@0
   197
#define EGL_VERTICAL_RESOLUTION        0x3091
sl@0
   198
#define EGL_PIXEL_ASPECT_RATIO         0x3092
sl@0
   199
#define EGL_SWAP_BEHAVIOR              0x3093
sl@0
   200
sl@0
   201
/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
sl@0
   202
#define EGL_BACK_BUFFER                0x3084
sl@0
   203
#define EGL_SINGLE_BUFFER              0x3085
sl@0
   204
sl@0
   205
/* OpenVG color spaces */
sl@0
   206
#define EGL_COLORSPACE_sRGB            0x3089   /* EGL_COLORSPACE value */
sl@0
   207
#define EGL_COLORSPACE_LINEAR          0x308A   /* EGL_COLORSPACE value */
sl@0
   208
sl@0
   209
/* OpenVG alpha formats */
sl@0
   210
#define EGL_ALPHA_FORMAT_NONPRE        0x308B   /* EGL_ALPHA_FORMAT value */
sl@0
   211
#define EGL_ALPHA_FORMAT_PRE           0x308C   /* EGL_ALPHA_FORMAT value */
sl@0
   212
sl@0
   213
/* Constant scale factor by which fractional display resolutions &
sl@0
   214
 * aspect ratio are scaled when queried as integer values.
sl@0
   215
 */
sl@0
   216
#define EGL_DISPLAY_SCALING            10000
sl@0
   217
sl@0
   218
/* Unknown display resolution/aspect ratio */
sl@0
   219
#define EGL_UNKNOWN                    ((EGLint)-1)
sl@0
   220
sl@0
   221
/* Back buffer swap behaviors */
sl@0
   222
#define EGL_BUFFER_PRESERVED           0x3094   /* EGL_SWAP_BEHAVIOR value */
sl@0
   223
#define EGL_BUFFER_DESTROYED           0x3095   /* EGL_SWAP_BEHAVIOR value */
sl@0
   224
sl@0
   225
/* CreatePbufferFromClientBuffer buffer types */
sl@0
   226
#define EGL_OPENVG_IMAGE               0x3096
sl@0
   227
sl@0
   228
/* QueryContext targets */
sl@0
   229
#define EGL_CONTEXT_CLIENT_TYPE        0x3097
sl@0
   230
sl@0
   231
/* BindAPI/QueryAPI targets */
sl@0
   232
#define EGL_OPENGL_ES_API              0x30A0
sl@0
   233
#define EGL_OPENVG_API                 0x30A1
sl@0
   234
sl@0
   235
/*
sl@0
   236
** Current surfaces
sl@0
   237
*/
sl@0
   238
#define EGL_DRAW                       0x3059
sl@0
   239
#define EGL_READ                       0x305A
sl@0
   240
sl@0
   241
/*
sl@0
   242
** Engines
sl@0
   243
*/
sl@0
   244
#define EGL_CORE_NATIVE_ENGINE         0x305B
sl@0
   245
sl@0
   246
/* 0x305C-0x3FFFF reserved for future use */
sl@0
   247
sl@0
   248
/*
sl@0
   249
** Functions
sl@0
   250
*/
sl@0
   251
#ifdef __cplusplus
sl@0
   252
extern "C" {
sl@0
   253
#endif
sl@0
   254
sl@0
   255
EGLAPI EGLint EGL_APIENTRY eglGetError (void);
sl@0
   256
sl@0
   257
EGLAPI EGLDisplay EGL_APIENTRY eglGetDisplay (NativeDisplayType display_id);
sl@0
   258
EGLAPI EGLBoolean EGL_APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
sl@0
   259
EGLAPI EGLBoolean EGL_APIENTRY eglTerminate (EGLDisplay dpy);
sl@0
   260
EGLAPI const char * EGL_APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
sl@0
   261
#ifdef __cplusplus
sl@0
   262
EGLAPI void (* EGL_APIENTRY eglGetProcAddress (const char *procname))(...);
sl@0
   263
#else
sl@0
   264
EGLAPI void (* EGL_APIENTRY eglGetProcAddress (const char *procname))();
sl@0
   265
#endif
sl@0
   266
sl@0
   267
EGLAPI EGLBoolean EGL_APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
sl@0
   268
EGLAPI EGLBoolean EGL_APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
sl@0
   269
EGLAPI EGLBoolean EGL_APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
sl@0
   270
sl@0
   271
EGLAPI EGLSurface EGL_APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType win, const EGLint *attrib_list);
sl@0
   272
EGLAPI EGLSurface EGL_APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
sl@0
   273
EGLAPI EGLSurface EGL_APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
sl@0
   274
EGLAPI EGLBoolean EGL_APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
sl@0
   275
EGLAPI EGLBoolean EGL_APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
sl@0
   276
sl@0
   277
/* EGL 1.1 render-to-texture APIs */
sl@0
   278
EGLAPI EGLBoolean EGL_APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
sl@0
   279
EGLAPI EGLBoolean EGL_APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
sl@0
   280
EGLAPI EGLBoolean EGL_APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
sl@0
   281
sl@0
   282
/* EGL 1.1 swap control API */
sl@0
   283
EGLAPI EGLBoolean EGL_APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
sl@0
   284
sl@0
   285
EGLAPI EGLContext EGL_APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
sl@0
   286
EGLAPI EGLBoolean EGL_APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
sl@0
   287
EGLAPI EGLBoolean EGL_APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
sl@0
   288
EGLAPI EGLContext EGL_APIENTRY eglGetCurrentContext (void);
sl@0
   289
EGLAPI EGLSurface EGL_APIENTRY eglGetCurrentSurface (EGLint readdraw);
sl@0
   290
EGLAPI EGLDisplay EGL_APIENTRY eglGetCurrentDisplay (void);
sl@0
   291
EGLAPI EGLBoolean EGL_APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
sl@0
   292
sl@0
   293
EGLAPI EGLBoolean EGL_APIENTRY eglWaitGL (void);
sl@0
   294
EGLAPI EGLBoolean EGL_APIENTRY eglWaitNative (EGLint engine);
sl@0
   295
EGLAPI EGLBoolean EGL_APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
sl@0
   296
EGLAPI EGLBoolean EGL_APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
sl@0
   297
sl@0
   298
EGLAPI EGLSurface EGL_APIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
sl@0
   299
EGLAPI EGLBoolean EGL_APIENTRY eglWaitClient (void);
sl@0
   300
EGLAPI EGLBoolean EGL_APIENTRY eglBindAPI (EGLenum api);
sl@0
   301
EGLAPI EGLenum EGL_APIENTRY eglQueryAPI (void);
sl@0
   302
EGLAPI EGLBoolean EGL_APIENTRY eglReleaseThread (void);
sl@0
   303
sl@0
   304
#ifdef __cplusplus
sl@0
   305
}
sl@0
   306
#endif
sl@0
   307
sl@0
   308
#endif /* ___egl_h_ */