os/graphics/opengles/openglesinterface/include/legacy_egl_1_1/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.
     1 #ifndef __LEGACY_EGL_1_1_EGL_H_
     2 #define __LEGACY_EGL_1_1_EGL_H_
     3 
     4 /**
     5 @publishedAll
     6 @released
     7 */
     8 
     9 /*
    10 ** License Applicability. Except to the extent portions of this file are
    11 ** made subject to an alternative license as permitted in the SGI Free
    12 ** Software License B, Version 1.0 (the "License"), the contents of this
    13 ** file are subject only to the provisions of the License. You may not use
    14 ** this file except in compliance with the License. You may obtain a copy
    15 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
    16 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
    17 **
    18 ** http://oss.sgi.com/projects/FreeB
    19 **
    20 ** Note that, as provided in the License, the Software is distributed on an
    21 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
    22 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
    23 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
    24 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
    25 **
    26 ** Original Code. The Original Code is: OpenGL Sample Implementation,
    27 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
    28 ** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
    29 ** Copyright in any portions created by third parties is as indicated
    30 ** elsewhere herein. All Rights Reserved.
    31 **
    32 ** Additional Notice Provisions: The application programming interfaces
    33 ** established by SGI in conjunction with the Original Code are The
    34 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
    35 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
    36 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
    37 ** Window System(R) (Version 1.3), released October 19, 1998. This software
    38 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
    39 ** published by SGI, but has not been independently verified as being
    40 ** compliant with the OpenGL(R) version 1.2.1 Specification.
    41 */
    42 
    43 #include <GLES/gl.h>
    44 #include <GLES/egltypes.h>
    45 
    46 /*
    47 ** egltypes.h is platform dependent. It defines:
    48 **
    49 **     - EGL types and resources
    50 **     - Native types
    51 **     - EGL and native handle values
    52 **
    53 ** EGL types and resources are to be typedef'ed with appropriate platform
    54 ** dependent resource handle types. EGLint must be an integer of at least
    55 ** 32-bit.
    56 **
    57 ** NativeDisplayType, NativeWindowType and NativePixmapType are to be
    58 ** replaced with corresponding types of the native window system in egl.h.
    59 **
    60 ** EGL and native handle values must match their types.
    61 **
    62 ** Example egltypes.h:
    63 */
    64 
    65 #if 0
    66 
    67 #include <sys/types.h>
    68 #include <native_window_system.h>
    69 
    70 /*
    71 ** Types and resources
    72 */
    73 typedef int EGLBoolean;
    74 typedef int32_t EGLint;
    75 typedef void *EGLDisplay;
    76 typedef void *EGLConfig;
    77 typedef void *EGLSurface;
    78 typedef void *EGLContext;
    79 
    80 /*
    81 ** EGL and native handle values
    82 */
    83 #define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0)
    84 #define EGL_NO_CONTEXT ((EGLContext)0)
    85 #define EGL_NO_DISPLAY ((EGLDisplay)0)
    86 #define EGL_NO_SURFACE ((EGLSurface)0)
    87 
    88 #endif
    89 
    90 /*
    91 ** Versioning and extensions
    92 */
    93 #define EGL_VERSION_1_0                1
    94 #define EGL_VERSION_1_1		       1
    95 
    96 /*
    97 ** Boolean
    98 */
    99 #define EGL_FALSE                      0
   100 #define EGL_TRUE                       1
   101 
   102 /*
   103 ** Errors
   104 */
   105 #define EGL_SUCCESS                    0x3000
   106 #define EGL_NOT_INITIALIZED            0x3001
   107 #define EGL_BAD_ACCESS                 0x3002
   108 #define EGL_BAD_ALLOC                  0x3003
   109 #define EGL_BAD_ATTRIBUTE              0x3004
   110 #define EGL_BAD_CONFIG                 0x3005
   111 #define EGL_BAD_CONTEXT                0x3006
   112 #define EGL_BAD_CURRENT_SURFACE        0x3007
   113 #define EGL_BAD_DISPLAY                0x3008
   114 #define EGL_BAD_MATCH                  0x3009
   115 #define EGL_BAD_NATIVE_PIXMAP          0x300A
   116 #define EGL_BAD_NATIVE_WINDOW          0x300B
   117 #define EGL_BAD_PARAMETER              0x300C
   118 #define EGL_BAD_SURFACE                0x300D
   119 #define EGL_CONTEXT_LOST	       0x300E
   120 /* 0x300F - 0x301F reserved for additional errors. */
   121 
   122 /*
   123 ** Config attributes
   124 */
   125 #define EGL_BUFFER_SIZE                0x3020
   126 #define EGL_ALPHA_SIZE                 0x3021
   127 #define EGL_BLUE_SIZE                  0x3022
   128 #define EGL_GREEN_SIZE                 0x3023
   129 #define EGL_RED_SIZE                   0x3024
   130 #define EGL_DEPTH_SIZE                 0x3025
   131 #define EGL_STENCIL_SIZE               0x3026
   132 #define EGL_CONFIG_CAVEAT              0x3027
   133 #define EGL_CONFIG_ID                  0x3028
   134 #define EGL_LEVEL                      0x3029
   135 #define EGL_MAX_PBUFFER_HEIGHT         0x302A
   136 #define EGL_MAX_PBUFFER_PIXELS         0x302B
   137 #define EGL_MAX_PBUFFER_WIDTH          0x302C
   138 #define EGL_NATIVE_RENDERABLE          0x302D
   139 #define EGL_NATIVE_VISUAL_ID           0x302E
   140 #define EGL_NATIVE_VISUAL_TYPE         0x302F
   141 /*#define EGL_PRESERVED_RESOURCES        0x3030*/
   142 #define EGL_SAMPLES                    0x3031
   143 #define EGL_SAMPLE_BUFFERS             0x3032
   144 #define EGL_SURFACE_TYPE               0x3033
   145 #define EGL_TRANSPARENT_TYPE           0x3034
   146 #define EGL_TRANSPARENT_BLUE_VALUE     0x3035
   147 #define EGL_TRANSPARENT_GREEN_VALUE    0x3036
   148 #define EGL_TRANSPARENT_RED_VALUE      0x3037
   149 
   150 #define EGL_NONE		       0x3038	/* Also a config value */
   151 #define EGL_BIND_TO_TEXTURE_RGB        0x3039
   152 #define EGL_BIND_TO_TEXTURE_RGBA       0x303A
   153 #define EGL_MIN_SWAP_INTERVAL	       0x303B
   154 #define EGL_MAX_SWAP_INTERVAL	       0x303C
   155 
   156 /*
   157 ** Config values
   158 */
   159 #define EGL_DONT_CARE		       ((EGLint) -1)
   160 
   161 #define EGL_SLOW_CONFIG		       0x3050	/* EGL_CONFIG_CAVEAT value */
   162 #define EGL_NON_CONFORMANT_CONFIG      0x3051	/* " */
   163 #define EGL_TRANSPARENT_RGB	       0x3052	/* EGL_TRANSPARENT_TYPE value */
   164 #define EGL_NO_TEXTURE		       0x305C	/* EGL_TEXTURE_FORMAT/TARGET value */
   165 #define EGL_TEXTURE_RGB		       0x305D	/* EGL_TEXTURE_FORMAT value */
   166 #define EGL_TEXTURE_RGBA	       0x305E	/* " */
   167 #define EGL_TEXTURE_2D		       0x305F	/* EGL_TEXTURE_TARGET value */
   168 
   169 /*
   170 ** Config attribute mask bits
   171 */
   172 #define EGL_PBUFFER_BIT		       0x01	/* EGL_SURFACE_TYPE mask bit */
   173 #define EGL_PIXMAP_BIT		       0x02	/* " */
   174 #define EGL_WINDOW_BIT		       0x04	/* " */
   175 
   176 /*
   177 ** String names
   178 */
   179 #define EGL_VENDOR                     0x3053
   180 #define EGL_VERSION                    0x3054
   181 #define EGL_EXTENSIONS                 0x3055
   182 
   183 /*
   184 ** Surface attributes
   185 */
   186 #define EGL_HEIGHT                     0x3056
   187 #define EGL_WIDTH                      0x3057
   188 #define EGL_LARGEST_PBUFFER            0x3058
   189 #define EGL_TEXTURE_FORMAT	       0x3080	/* For pbuffers bound as textures */
   190 #define EGL_TEXTURE_TARGET	       0x3081	/* " */
   191 #define EGL_MIPMAP_TEXTURE	       0x3082	/* " */
   192 #define EGL_MIPMAP_LEVEL	       0x3083	/* " */
   193 
   194 /*
   195 ** BindTexImage / ReleaseTexImage buffer target
   196 */
   197 #define EGL_BACK_BUFFER		       0x3084
   198 
   199 /*
   200 ** Current surfaces
   201 */
   202 #define EGL_DRAW                       0x3059
   203 #define EGL_READ                       0x305A
   204 
   205 /*
   206 ** Engines
   207 */
   208 #define EGL_CORE_NATIVE_ENGINE         0x305B
   209 
   210 /* 0x305C-0x3FFFF reserved for future use */
   211 
   212 /*
   213 ** Functions
   214 */
   215 #ifdef __cplusplus
   216 extern "C" {
   217 #endif
   218 
   219 GLAPI EGLint GL_APIENTRY eglGetError (void);
   220 
   221 GLAPI EGLDisplay GL_APIENTRY eglGetDisplay (NativeDisplayType display);
   222 GLAPI EGLBoolean GL_APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
   223 GLAPI EGLBoolean GL_APIENTRY eglTerminate (EGLDisplay dpy);
   224 GLAPI const char * GL_APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
   225 #ifdef __cplusplus
   226 GLAPI void (* GL_APIENTRY eglGetProcAddress (const char *procname))(...);
   227 #else
   228 GLAPI void (* GL_APIENTRY eglGetProcAddress (const char *procname))();
   229 #endif
   230 
   231 GLAPI EGLBoolean GL_APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
   232 GLAPI EGLBoolean GL_APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
   233 GLAPI EGLBoolean GL_APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
   234 
   235 GLAPI EGLSurface GL_APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
   236 GLAPI EGLSurface GL_APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
   237 GLAPI EGLSurface GL_APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
   238 GLAPI EGLBoolean GL_APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
   239 GLAPI EGLBoolean GL_APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
   240 /* EGL 1.1 render-to-texture APIs */
   241 GLAPI EGLBoolean GL_APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
   242 GLAPI EGLBoolean GL_APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
   243 GLAPI EGLBoolean GL_APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
   244 
   245 /* EGL 1.1 swap control API */
   246 GLAPI EGLBoolean GL_APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
   247 
   248 GLAPI EGLContext GL_APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
   249 GLAPI EGLBoolean GL_APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
   250 GLAPI EGLBoolean GL_APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
   251 GLAPI EGLContext GL_APIENTRY eglGetCurrentContext (void);
   252 GLAPI EGLSurface GL_APIENTRY eglGetCurrentSurface (EGLint readdraw);
   253 GLAPI EGLDisplay GL_APIENTRY eglGetCurrentDisplay (void);
   254 GLAPI EGLBoolean GL_APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
   255 
   256 GLAPI EGLBoolean GL_APIENTRY eglWaitGL (void);
   257 GLAPI EGLBoolean GL_APIENTRY eglWaitNative (EGLint engine);
   258 GLAPI EGLBoolean GL_APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
   259 GLAPI EGLBoolean GL_APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
   260 
   261 #ifdef __cplusplus
   262 }
   263 #endif
   264 
   265 #endif /* __LEGACY_EGL_1_1_EGL_H_ */
   266