├── EGL ├── egl.h ├── eglext.h └── eglplatform.h ├── GLES ├── gl.h ├── glext.h └── glplatform.h ├── GLES2 ├── gl2.h ├── gl2ext.h └── gl2platform.h ├── README ├── cone.py ├── egl.py ├── gl.py ├── gl2.py ├── gl2ext.py ├── glext.py ├── license.txt ├── prepare_constants.py ├── pymouse.py └── pyopengles.py /EGL/egl.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; tab-width: 8; -*- */ 2 | /* vi: set sw=4 ts=8: */ 3 | /* Reference version of egl.h for EGL 1.4. 4 | * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ 5 | */ 6 | 7 | /* 8 | ** Copyright (c) 2007-2009 The Khronos Group Inc. 9 | ** 10 | ** Permission is hereby granted, free of charge, to any person obtaining a 11 | ** copy of this software and/or associated documentation files (the 12 | ** "Materials"), to deal in the Materials without restriction, including 13 | ** without limitation the rights to use, copy, modify, merge, publish, 14 | ** distribute, sublicense, and/or sell copies of the Materials, and to 15 | ** permit persons to whom the Materials are furnished to do so, subject to 16 | ** the following conditions: 17 | ** 18 | ** The above copyright notice and this permission notice shall be included 19 | ** in all copies or substantial portions of the Materials. 20 | ** 21 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 25 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 28 | */ 29 | 30 | #ifndef __egl_h_ 31 | #define __egl_h_ 32 | 33 | /* All platform-dependent types and macro boilerplate (such as EGLAPI 34 | * and EGLAPIENTRY) should go in eglplatform.h. 35 | */ 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* EGL Types */ 43 | /* EGLint is defined in eglplatform.h */ 44 | typedef unsigned int EGLBoolean; 45 | typedef unsigned int EGLenum; 46 | typedef void *EGLConfig; 47 | typedef void *EGLContext; 48 | typedef void *EGLDisplay; 49 | typedef void *EGLSurface; 50 | typedef void *EGLClientBuffer; 51 | 52 | /* EGL Versioning */ 53 | #define EGL_VERSION_1_0 1 54 | #define EGL_VERSION_1_1 1 55 | #define EGL_VERSION_1_2 1 56 | #define EGL_VERSION_1_3 1 57 | #define EGL_VERSION_1_4 1 58 | 59 | /* EGL Enumerants. Bitmasks and other exceptional cases aside, most 60 | * enums are assigned unique values starting at 0x3000. 61 | */ 62 | 63 | /* EGL aliases */ 64 | #define EGL_FALSE 0 65 | #define EGL_TRUE 1 66 | 67 | /* Out-of-band handle values */ 68 | #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) 69 | #define EGL_NO_CONTEXT ((EGLContext)0) 70 | #define EGL_NO_DISPLAY ((EGLDisplay)0) 71 | #define EGL_NO_SURFACE ((EGLSurface)0) 72 | 73 | /* Out-of-band attribute value */ 74 | #define EGL_DONT_CARE ((EGLint)-1) 75 | 76 | /* Errors / GetError return values */ 77 | #define EGL_SUCCESS 0x3000 78 | #define EGL_NOT_INITIALIZED 0x3001 79 | #define EGL_BAD_ACCESS 0x3002 80 | #define EGL_BAD_ALLOC 0x3003 81 | #define EGL_BAD_ATTRIBUTE 0x3004 82 | #define EGL_BAD_CONFIG 0x3005 83 | #define EGL_BAD_CONTEXT 0x3006 84 | #define EGL_BAD_CURRENT_SURFACE 0x3007 85 | #define EGL_BAD_DISPLAY 0x3008 86 | #define EGL_BAD_MATCH 0x3009 87 | #define EGL_BAD_NATIVE_PIXMAP 0x300A 88 | #define EGL_BAD_NATIVE_WINDOW 0x300B 89 | #define EGL_BAD_PARAMETER 0x300C 90 | #define EGL_BAD_SURFACE 0x300D 91 | #define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ 92 | 93 | /* Reserved 0x300F-0x301F for additional errors */ 94 | 95 | /* Config attributes */ 96 | #define EGL_BUFFER_SIZE 0x3020 97 | #define EGL_ALPHA_SIZE 0x3021 98 | #define EGL_BLUE_SIZE 0x3022 99 | #define EGL_GREEN_SIZE 0x3023 100 | #define EGL_RED_SIZE 0x3024 101 | #define EGL_DEPTH_SIZE 0x3025 102 | #define EGL_STENCIL_SIZE 0x3026 103 | #define EGL_CONFIG_CAVEAT 0x3027 104 | #define EGL_CONFIG_ID 0x3028 105 | #define EGL_LEVEL 0x3029 106 | #define EGL_MAX_PBUFFER_HEIGHT 0x302A 107 | #define EGL_MAX_PBUFFER_PIXELS 0x302B 108 | #define EGL_MAX_PBUFFER_WIDTH 0x302C 109 | #define EGL_NATIVE_RENDERABLE 0x302D 110 | #define EGL_NATIVE_VISUAL_ID 0x302E 111 | #define EGL_NATIVE_VISUAL_TYPE 0x302F 112 | #define EGL_SAMPLES 0x3031 113 | #define EGL_SAMPLE_BUFFERS 0x3032 114 | #define EGL_SURFACE_TYPE 0x3033 115 | #define EGL_TRANSPARENT_TYPE 0x3034 116 | #define EGL_TRANSPARENT_BLUE_VALUE 0x3035 117 | #define EGL_TRANSPARENT_GREEN_VALUE 0x3036 118 | #define EGL_TRANSPARENT_RED_VALUE 0x3037 119 | #define EGL_NONE 0x3038 /* Attrib list terminator */ 120 | #define EGL_BIND_TO_TEXTURE_RGB 0x3039 121 | #define EGL_BIND_TO_TEXTURE_RGBA 0x303A 122 | #define EGL_MIN_SWAP_INTERVAL 0x303B 123 | #define EGL_MAX_SWAP_INTERVAL 0x303C 124 | #define EGL_LUMINANCE_SIZE 0x303D 125 | #define EGL_ALPHA_MASK_SIZE 0x303E 126 | #define EGL_COLOR_BUFFER_TYPE 0x303F 127 | #define EGL_RENDERABLE_TYPE 0x3040 128 | #define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ 129 | #define EGL_CONFORMANT 0x3042 130 | 131 | /* Reserved 0x3041-0x304F for additional config attributes */ 132 | 133 | /* Config attribute values */ 134 | #define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ 135 | #define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ 136 | #define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ 137 | #define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ 138 | #define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ 139 | 140 | /* More config attribute values, for EGL_TEXTURE_FORMAT */ 141 | #define EGL_NO_TEXTURE 0x305C 142 | #define EGL_TEXTURE_RGB 0x305D 143 | #define EGL_TEXTURE_RGBA 0x305E 144 | #define EGL_TEXTURE_2D 0x305F 145 | 146 | /* Config attribute mask bits */ 147 | #define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ 148 | #define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ 149 | #define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ 150 | #define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ 151 | #define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ 152 | #define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ 153 | #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ 154 | 155 | #define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ 156 | #define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ 157 | #define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ 158 | #define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ 159 | 160 | /* QueryString targets */ 161 | #define EGL_VENDOR 0x3053 162 | #define EGL_VERSION 0x3054 163 | #define EGL_EXTENSIONS 0x3055 164 | #define EGL_CLIENT_APIS 0x308D 165 | 166 | /* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ 167 | #define EGL_HEIGHT 0x3056 168 | #define EGL_WIDTH 0x3057 169 | #define EGL_LARGEST_PBUFFER 0x3058 170 | #define EGL_TEXTURE_FORMAT 0x3080 171 | #define EGL_TEXTURE_TARGET 0x3081 172 | #define EGL_MIPMAP_TEXTURE 0x3082 173 | #define EGL_MIPMAP_LEVEL 0x3083 174 | #define EGL_RENDER_BUFFER 0x3086 175 | #define EGL_VG_COLORSPACE 0x3087 176 | #define EGL_VG_ALPHA_FORMAT 0x3088 177 | #define EGL_HORIZONTAL_RESOLUTION 0x3090 178 | #define EGL_VERTICAL_RESOLUTION 0x3091 179 | #define EGL_PIXEL_ASPECT_RATIO 0x3092 180 | #define EGL_SWAP_BEHAVIOR 0x3093 181 | #define EGL_MULTISAMPLE_RESOLVE 0x3099 182 | 183 | /* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ 184 | #define EGL_BACK_BUFFER 0x3084 185 | #define EGL_SINGLE_BUFFER 0x3085 186 | 187 | /* OpenVG color spaces */ 188 | #define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ 189 | #define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ 190 | 191 | /* OpenVG alpha formats */ 192 | #define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ 193 | #define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ 194 | 195 | /* Constant scale factor by which fractional display resolutions & 196 | * aspect ratio are scaled when queried as integer values. 197 | */ 198 | #define EGL_DISPLAY_SCALING 10000 199 | 200 | /* Unknown display resolution/aspect ratio */ 201 | #define EGL_UNKNOWN ((EGLint)-1) 202 | 203 | /* Back buffer swap behaviors */ 204 | #define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ 205 | #define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ 206 | 207 | /* CreatePbufferFromClientBuffer buffer types */ 208 | #define EGL_OPENVG_IMAGE 0x3096 209 | 210 | /* QueryContext targets */ 211 | #define EGL_CONTEXT_CLIENT_TYPE 0x3097 212 | 213 | /* CreateContext attributes */ 214 | #define EGL_CONTEXT_CLIENT_VERSION 0x3098 215 | 216 | /* Multisample resolution behaviors */ 217 | #define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ 218 | #define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ 219 | 220 | /* BindAPI/QueryAPI targets */ 221 | #define EGL_OPENGL_ES_API 0x30A0 222 | #define EGL_OPENVG_API 0x30A1 223 | #define EGL_OPENGL_API 0x30A2 224 | 225 | /* GetCurrentSurface targets */ 226 | #define EGL_DRAW 0x3059 227 | #define EGL_READ 0x305A 228 | 229 | /* WaitNative engines */ 230 | #define EGL_CORE_NATIVE_ENGINE 0x305B 231 | 232 | /* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ 233 | #define EGL_COLORSPACE EGL_VG_COLORSPACE 234 | #define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT 235 | #define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB 236 | #define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR 237 | #define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE 238 | #define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE 239 | 240 | /* EGL extensions must request enum blocks from the Khronos 241 | * API Registrar, who maintains the enumerant registry. Submit 242 | * a bug in Khronos Bugzilla against task "Registry". 243 | */ 244 | 245 | 246 | 247 | /* EGL Functions */ 248 | 249 | EGLAPI EGLint EGLAPIENTRY eglGetError(void); 250 | 251 | EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); 252 | EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); 253 | EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); 254 | 255 | EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); 256 | 257 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, 258 | EGLint config_size, EGLint *num_config); 259 | EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, 260 | EGLConfig *configs, EGLint config_size, 261 | EGLint *num_config); 262 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, 263 | EGLint attribute, EGLint *value); 264 | 265 | EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, 266 | EGLNativeWindowType win, 267 | const EGLint *attrib_list); 268 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, 269 | const EGLint *attrib_list); 270 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, 271 | EGLNativePixmapType pixmap, 272 | const EGLint *attrib_list); 273 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); 274 | EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, 275 | EGLint attribute, EGLint *value); 276 | 277 | EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); 278 | EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); 279 | 280 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); 281 | 282 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); 283 | 284 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( 285 | EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, 286 | EGLConfig config, const EGLint *attrib_list); 287 | 288 | EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, 289 | EGLint attribute, EGLint value); 290 | EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 291 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 292 | 293 | 294 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); 295 | 296 | 297 | EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, 298 | EGLContext share_context, 299 | const EGLint *attrib_list); 300 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); 301 | EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, 302 | EGLSurface read, EGLContext ctx); 303 | 304 | EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); 305 | EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); 306 | EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); 307 | EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, 308 | EGLint attribute, EGLint *value); 309 | 310 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); 311 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); 312 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); 313 | EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, 314 | EGLNativePixmapType target); 315 | 316 | /* This is a generic function pointer type, whose name indicates it must 317 | * be cast to the proper type *and calling convention* before use. 318 | */ 319 | typedef void (*__eglMustCastToProperFunctionPointerType)(void); 320 | 321 | /* Now, define eglGetProcAddress using the generic function ptr. type */ 322 | EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY 323 | eglGetProcAddress(const char *procname); 324 | 325 | #ifdef __cplusplus 326 | } 327 | #endif 328 | 329 | #endif /* __egl_h_ */ 330 | -------------------------------------------------------------------------------- /EGL/eglext.h: -------------------------------------------------------------------------------- 1 | #ifndef __eglext_h_ 2 | #define __eglext_h_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2007-2010 The Khronos Group Inc. 10 | ** 11 | ** Permission is hereby granted, free of charge, to any person obtaining a 12 | ** copy of this software and/or associated documentation files (the 13 | ** "Materials"), to deal in the Materials without restriction, including 14 | ** without limitation the rights to use, copy, modify, merge, publish, 15 | ** distribute, sublicense, and/or sell copies of the Materials, and to 16 | ** permit persons to whom the Materials are furnished to do so, subject to 17 | ** the following conditions: 18 | ** 19 | ** The above copyright notice and this permission notice shall be included 20 | ** in all copies or substantial portions of the Materials. 21 | ** 22 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 24 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 25 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 26 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 27 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 28 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 29 | */ 30 | 31 | #include 32 | 33 | /*************************************************************/ 34 | 35 | /* Header file version number */ 36 | /* Current version at http://www.khronos.org/registry/egl/ */ 37 | /* $Revision: 15052 $ on $Date: 2011-07-06 17:43:46 -0700 (Wed, 06 Jul 2011) $ */ 38 | #define EGL_EGLEXT_VERSION 10 39 | 40 | #ifndef EGL_KHR_config_attribs 41 | #define EGL_KHR_config_attribs 1 42 | #define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */ 43 | #define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */ 44 | #define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */ 45 | #endif 46 | 47 | #ifndef EGL_KHR_lock_surface 48 | #define EGL_KHR_lock_surface 1 49 | #define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ 50 | #define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ 51 | #define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */ 52 | #define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */ 53 | #define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */ 54 | #define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */ 55 | #define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */ 56 | #define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */ 57 | #define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */ 58 | #define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */ 59 | #define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */ 60 | #define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */ 61 | #define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */ 62 | #define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */ 63 | #define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */ 64 | #define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */ 65 | #define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */ 66 | #define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */ 67 | #define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */ 68 | #define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */ 69 | #define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */ 70 | #ifdef EGL_EGLEXT_PROTOTYPES 71 | EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); 72 | EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface); 73 | #endif /* EGL_EGLEXT_PROTOTYPES */ 74 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); 75 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface); 76 | #endif 77 | 78 | #ifndef EGL_KHR_image 79 | #define EGL_KHR_image 1 80 | #define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */ 81 | typedef void *EGLImageKHR; 82 | #define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) 83 | #ifdef EGL_EGLEXT_PROTOTYPES 84 | EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); 85 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); 86 | #endif /* EGL_EGLEXT_PROTOTYPES */ 87 | typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); 88 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); 89 | #endif 90 | 91 | #ifndef EGL_KHR_vg_parent_image 92 | #define EGL_KHR_vg_parent_image 1 93 | #define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */ 94 | #endif 95 | 96 | #ifndef EGL_KHR_gl_texture_2D_image 97 | #define EGL_KHR_gl_texture_2D_image 1 98 | #define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */ 99 | #define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */ 100 | #endif 101 | 102 | #ifndef EGL_KHR_gl_texture_cubemap_image 103 | #define EGL_KHR_gl_texture_cubemap_image 1 104 | #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */ 105 | #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */ 106 | #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */ 107 | #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */ 108 | #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */ 109 | #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */ 110 | #endif 111 | 112 | #ifndef EGL_KHR_gl_texture_3D_image 113 | #define EGL_KHR_gl_texture_3D_image 1 114 | #define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */ 115 | #define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */ 116 | #endif 117 | 118 | #ifndef EGL_KHR_gl_renderbuffer_image 119 | #define EGL_KHR_gl_renderbuffer_image 1 120 | #define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */ 121 | #endif 122 | 123 | #if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */ 124 | #ifndef EGL_KHR_reusable_sync 125 | #define EGL_KHR_reusable_sync 1 126 | 127 | typedef void* EGLSyncKHR; 128 | typedef khronos_utime_nanoseconds_t EGLTimeKHR; 129 | 130 | #define EGL_SYNC_STATUS_KHR 0x30F1 131 | #define EGL_SIGNALED_KHR 0x30F2 132 | #define EGL_UNSIGNALED_KHR 0x30F3 133 | #define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 134 | #define EGL_CONDITION_SATISFIED_KHR 0x30F6 135 | #define EGL_SYNC_TYPE_KHR 0x30F7 136 | #define EGL_SYNC_REUSABLE_KHR 0x30FA 137 | #define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR bitfield */ 138 | #define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull 139 | #define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) 140 | #ifdef EGL_EGLEXT_PROTOTYPES 141 | EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); 142 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); 143 | EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); 144 | EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); 145 | EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); 146 | #endif /* EGL_EGLEXT_PROTOTYPES */ 147 | typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); 148 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); 149 | typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); 150 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); 151 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); 152 | #endif 153 | #endif 154 | 155 | #ifndef EGL_KHR_image_base 156 | #define EGL_KHR_image_base 1 157 | /* Most interfaces defined by EGL_KHR_image_pixmap above */ 158 | #define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */ 159 | #endif 160 | 161 | #ifndef EGL_KHR_image_pixmap 162 | #define EGL_KHR_image_pixmap 1 163 | /* Interfaces defined by EGL_KHR_image above */ 164 | #endif 165 | 166 | #ifndef EGL_IMG_context_priority 167 | #define EGL_IMG_context_priority 1 168 | #define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 169 | #define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 170 | #define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 171 | #define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 172 | #endif 173 | 174 | #ifndef EGL_KHR_lock_surface2 175 | #define EGL_KHR_lock_surface2 1 176 | #define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 177 | #endif 178 | 179 | #ifndef EGL_NV_coverage_sample 180 | #define EGL_NV_coverage_sample 1 181 | #define EGL_COVERAGE_BUFFERS_NV 0x30E0 182 | #define EGL_COVERAGE_SAMPLES_NV 0x30E1 183 | #endif 184 | 185 | #ifndef EGL_NV_depth_nonlinear 186 | #define EGL_NV_depth_nonlinear 1 187 | #define EGL_DEPTH_ENCODING_NV 0x30E2 188 | #define EGL_DEPTH_ENCODING_NONE_NV 0 189 | #define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 190 | #endif 191 | 192 | #if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */ 193 | #ifndef EGL_NV_sync 194 | #define EGL_NV_sync 1 195 | #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 196 | #define EGL_SYNC_STATUS_NV 0x30E7 197 | #define EGL_SIGNALED_NV 0x30E8 198 | #define EGL_UNSIGNALED_NV 0x30E9 199 | #define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 200 | #define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull 201 | #define EGL_ALREADY_SIGNALED_NV 0x30EA 202 | #define EGL_TIMEOUT_EXPIRED_NV 0x30EB 203 | #define EGL_CONDITION_SATISFIED_NV 0x30EC 204 | #define EGL_SYNC_TYPE_NV 0x30ED 205 | #define EGL_SYNC_CONDITION_NV 0x30EE 206 | #define EGL_SYNC_FENCE_NV 0x30EF 207 | #define EGL_NO_SYNC_NV ((EGLSyncNV)0) 208 | typedef void* EGLSyncNV; 209 | typedef khronos_utime_nanoseconds_t EGLTimeNV; 210 | #ifdef EGL_EGLEXT_PROTOTYPES 211 | EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); 212 | EGLBoolean eglDestroySyncNV (EGLSyncNV sync); 213 | EGLBoolean eglFenceNV (EGLSyncNV sync); 214 | EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); 215 | EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); 216 | EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); 217 | #endif /* EGL_EGLEXT_PROTOTYPES */ 218 | typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); 219 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); 220 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); 221 | typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); 222 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); 223 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); 224 | #endif 225 | #endif 226 | 227 | #if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */ 228 | #ifndef EGL_KHR_fence_sync 229 | #define EGL_KHR_fence_sync 1 230 | /* Reuses most tokens and entry points from EGL_KHR_reusable_sync */ 231 | #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 232 | #define EGL_SYNC_CONDITION_KHR 0x30F8 233 | #define EGL_SYNC_FENCE_KHR 0x30F9 234 | #endif 235 | #endif 236 | 237 | #ifndef EGL_HI_clientpixmap 238 | #define EGL_HI_clientpixmap 1 239 | 240 | /* Surface Attribute */ 241 | #define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 242 | /* 243 | * Structure representing a client pixmap 244 | * (pixmap's data is in client-space memory). 245 | */ 246 | struct EGLClientPixmapHI 247 | { 248 | void* pData; 249 | EGLint iWidth; 250 | EGLint iHeight; 251 | EGLint iStride; 252 | }; 253 | 254 | #ifdef EGL_EGLEXT_PROTOTYPES 255 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); 256 | #endif /* EGL_EGLEXT_PROTOTYPES */ 257 | typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); 258 | #endif /* EGL_HI_clientpixmap */ 259 | 260 | #ifndef EGL_HI_colorformats 261 | #define EGL_HI_colorformats 1 262 | /* Config Attribute */ 263 | #define EGL_COLOR_FORMAT_HI 0x8F70 264 | /* Color Formats */ 265 | #define EGL_COLOR_RGB_HI 0x8F71 266 | #define EGL_COLOR_RGBA_HI 0x8F72 267 | #define EGL_COLOR_ARGB_HI 0x8F73 268 | #endif /* EGL_HI_colorformats */ 269 | 270 | #ifndef EGL_MESA_drm_image 271 | #define EGL_MESA_drm_image 1 272 | #define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* CreateDRMImageMESA attribute */ 273 | #define EGL_DRM_BUFFER_USE_MESA 0x31D1 /* CreateDRMImageMESA attribute */ 274 | #define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 /* EGL_IMAGE_FORMAT_MESA attribute value */ 275 | #define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */ 276 | #define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 277 | #define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 /* EGL_DRM_BUFFER_USE_MESA bits */ 278 | #define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 /* EGL_DRM_BUFFER_USE_MESA bits */ 279 | #ifdef EGL_EGLEXT_PROTOTYPES 280 | EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); 281 | EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); 282 | #endif /* EGL_EGLEXT_PROTOTYPES */ 283 | typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); 284 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); 285 | #endif 286 | 287 | #ifndef EGL_NV_post_sub_buffer 288 | #define EGL_NV_post_sub_buffer 1 289 | #define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE 290 | #ifdef EGL_EGLEXT_PROTOTYPES 291 | EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); 292 | #endif /* EGL_EGLEXT_PROTOTYPES */ 293 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); 294 | #endif 295 | 296 | #ifndef EGL_ANGLE_query_surface_pointer 297 | #define EGL_ANGLE_query_surface_pointer 1 298 | #ifdef EGL_EGLEXT_PROTOTYPES 299 | EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); 300 | #endif 301 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); 302 | #endif 303 | 304 | #ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle 305 | #define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 306 | #define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 307 | #endif 308 | 309 | #ifndef EGL_NV_coverage_sample_resolve 310 | #define EGL_NV_coverage_sample_resolve 1 311 | #define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 312 | #define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 313 | #define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 314 | #endif 315 | 316 | #if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */ 317 | #ifndef EGL_NV_system_time 318 | #define EGL_NV_system_time 1 319 | 320 | typedef khronos_utime_nanoseconds_t EGLuint64NV; 321 | 322 | #ifdef EGL_EGLEXT_PROTOTYPES 323 | EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void); 324 | EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void); 325 | #endif /* EGL_EGLEXT_PROTOTYPES */ 326 | typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); 327 | typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); 328 | #endif 329 | #endif 330 | 331 | #ifdef __cplusplus 332 | } 333 | #endif 334 | 335 | #endif 336 | -------------------------------------------------------------------------------- /EGL/eglplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __eglplatform_h_ 2 | #define __eglplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2007-2009 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Platform-specific types and definitions for egl.h 28 | * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ 29 | * 30 | * Adopters may modify khrplatform.h and this file to suit their platform. 31 | * You are encouraged to submit all modifications to the Khronos group so that 32 | * they can be included in future versions of this file. Please submit changes 33 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 34 | * by filing a bug against product "EGL" component "Registry". 35 | */ 36 | 37 | #include "../KHR/khrplatform.h" 38 | 39 | /* Macros used in EGL function prototype declarations. 40 | * 41 | * EGL functions should be prototyped as: 42 | * 43 | * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); 44 | * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); 45 | * 46 | * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h 47 | */ 48 | 49 | #ifndef EGLAPI 50 | #define EGLAPI KHRONOS_APICALL 51 | #endif 52 | 53 | #ifndef EGLAPIENTRY 54 | #define EGLAPIENTRY KHRONOS_APIENTRY 55 | #endif 56 | #ifndef EGLAPIENTRYP 57 | #define EGLAPIENTRYP EGLAPIENTRY * 58 | #endif 59 | #ifndef EGLAPI 60 | #ifdef KHAPI 61 | #define EGLAPI KHAPI 62 | #else 63 | #define EGLAPI extern 64 | #endif 65 | #endif 66 | 67 | /* The types NativeDisplayType, NativeWindowType, and NativePixmapType 68 | * are aliases of window-system-dependent types, such as X Display * or 69 | * Windows Device Context. They must be defined in platform-specific 70 | * code below. The EGL-prefixed versions of Native*Type are the same 71 | * types, renamed in EGL 1.3 so all types in the API start with "EGL". 72 | * 73 | * Khronos STRONGLY RECOMMENDS that you use the default definitions 74 | * provided below, since these changes affect both binary and source 75 | * portability of applications using EGL running on different EGL 76 | * implementations. 77 | */ 78 | 79 | /* Unix (tentative) 80 | #include 81 | typedef Display *NativeDisplayType; 82 | - or maybe, if encoding "hostname:display.head" 83 | typedef const char *NativeWindowType; 84 | etc. 85 | */ 86 | typedef void *EGLNativeDisplayType; 87 | typedef void *EGLNativePixmapType; 88 | typedef void *EGLNativeWindowType; 89 | #if defined ( WIN32 ) 90 | #define EGL_SERVER_SMALLINT //win32 platform currently only supports this 91 | #endif 92 | 93 | #ifndef EGL_SERVER_SMALLINT 94 | 95 | #include "bcm_host.h" 96 | /* TODO: EGLNativeWindowType is really one of these but I'm leaving it 97 | * as void* for now, in case changing it would cause problems 98 | */ 99 | typedef struct { 100 | DISPMANX_ELEMENT_HANDLE_T element; 101 | int width; /* This is necessary because dispmanx elements are not queriable. */ 102 | int height; 103 | } EGL_DISPMANX_WINDOW_T; 104 | 105 | #else 106 | 107 | /* window I of a horizontal strip of N WxH windows */ 108 | #define PACK_NATIVE_WINDOW(W, H, I, N) ((NativeWindowType)((W) | ((H) << 12) | ((I) << 24) | ((N) << 28))) 109 | #define UNPACK_NATIVE_WINDOW_W(WIN) ((unsigned int)(WIN) & 0xfff) 110 | #define UNPACK_NATIVE_WINDOW_H(WIN) (((unsigned int)(WIN) >> 12) & 0xfff) 111 | #define UNPACK_NATIVE_WINDOW_I(WIN) (((unsigned int)(WIN) >> 24) & 0xf) 112 | #define UNPACK_NATIVE_WINDOW_N(WIN) ((unsigned int)(WIN) >> 28) 113 | 114 | /* todo: can we change these to use PACK_NATIVE_WINDOW and get rid of platform_canonical_win from platform.h? */ 115 | #define NATIVE_WINDOW_800_480 ((NativeWindowType)0) 116 | #define NATIVE_WINDOW_640_480 ((NativeWindowType)1) 117 | #define NATIVE_WINDOW_320_240 ((NativeWindowType)2) 118 | #define NATIVE_WINDOW_240_320 ((NativeWindowType)3) 119 | #define NATIVE_WINDOW_64_64 ((NativeWindowType)4) 120 | #define NATIVE_WINDOW_400_480_A ((NativeWindowType)5) 121 | #define NATIVE_WINDOW_400_480_B ((NativeWindowType)6) 122 | #define NATIVE_WINDOW_512_512 ((NativeWindowType)7) 123 | #define NATIVE_WINDOW_360_640 ((NativeWindowType)8) 124 | #define NATIVE_WINDOW_640_360 ((NativeWindowType)9) 125 | #define NATIVE_WINDOW_1280_720 ((NativeWindowType)10) 126 | #define NATIVE_WINDOW_1920_1080 ((NativeWindowType)11) 127 | #define NATIVE_WINDOW_480_320 ((NativeWindowType)12) 128 | #define NATIVE_WINDOW_1680_1050 ((NativeWindowType)13) 129 | #endif 130 | 131 | /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ 132 | typedef EGLNativeDisplayType NativeDisplayType; 133 | typedef EGLNativePixmapType NativePixmapType; 134 | typedef EGLNativeWindowType NativeWindowType; 135 | 136 | 137 | /* Define EGLint. This must be a signed integral type large enough to contain 138 | * all legal attribute names and values passed into and out of EGL, whether 139 | * their type is boolean, bitmask, enumerant (symbolic constant), integer, 140 | * handle, or other. While in general a 32-bit integer will suffice, if 141 | * handles are 64 bit types, then EGLint should be defined as a signed 64-bit 142 | * integer type. 143 | */ 144 | typedef khronos_int32_t EGLint; 145 | 146 | #ifdef KHRONOS_NAME_MANGLING 147 | #include "interface/khronos/common/khrn_client_mangle.h" 148 | #endif 149 | 150 | #endif /* __eglplatform_h */ 151 | -------------------------------------------------------------------------------- /GLES/gl.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl_h_ 2 | #define __gl_h_ 3 | 4 | /* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */ 5 | 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* 13 | * This document is licensed under the SGI Free Software B License Version 14 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 15 | */ 16 | 17 | typedef void GLvoid; 18 | typedef char GLchar; 19 | typedef unsigned int GLenum; 20 | typedef unsigned char GLboolean; 21 | typedef unsigned int GLbitfield; 22 | typedef khronos_int8_t GLbyte; 23 | typedef short GLshort; 24 | typedef int GLint; 25 | typedef int GLsizei; 26 | typedef khronos_uint8_t GLubyte; 27 | typedef unsigned short GLushort; 28 | typedef unsigned int GLuint; 29 | typedef khronos_float_t GLfloat; 30 | typedef khronos_float_t GLclampf; 31 | typedef khronos_int32_t GLfixed; 32 | typedef khronos_int32_t GLclampx; 33 | 34 | typedef khronos_intptr_t GLintptr; 35 | typedef khronos_ssize_t GLsizeiptr; 36 | 37 | 38 | /*************************************************************/ 39 | 40 | /* OpenGL ES core versions */ 41 | #define GL_VERSION_ES_CM_1_0 1 42 | #define GL_VERSION_ES_CL_1_0 1 43 | #define GL_VERSION_ES_CM_1_1 1 44 | #define GL_VERSION_ES_CL_1_1 1 45 | 46 | /* ClearBufferMask */ 47 | #define GL_DEPTH_BUFFER_BIT 0x00000100 48 | #define GL_STENCIL_BUFFER_BIT 0x00000400 49 | #define GL_COLOR_BUFFER_BIT 0x00004000 50 | 51 | /* Boolean */ 52 | #define GL_FALSE 0 53 | #define GL_TRUE 1 54 | 55 | /* BeginMode */ 56 | #define GL_POINTS 0x0000 57 | #define GL_LINES 0x0001 58 | #define GL_LINE_LOOP 0x0002 59 | #define GL_LINE_STRIP 0x0003 60 | #define GL_TRIANGLES 0x0004 61 | #define GL_TRIANGLE_STRIP 0x0005 62 | #define GL_TRIANGLE_FAN 0x0006 63 | 64 | /* AlphaFunction */ 65 | #define GL_NEVER 0x0200 66 | #define GL_LESS 0x0201 67 | #define GL_EQUAL 0x0202 68 | #define GL_LEQUAL 0x0203 69 | #define GL_GREATER 0x0204 70 | #define GL_NOTEQUAL 0x0205 71 | #define GL_GEQUAL 0x0206 72 | #define GL_ALWAYS 0x0207 73 | 74 | /* BlendingFactorDest */ 75 | #define GL_ZERO 0 76 | #define GL_ONE 1 77 | #define GL_SRC_COLOR 0x0300 78 | #define GL_ONE_MINUS_SRC_COLOR 0x0301 79 | #define GL_SRC_ALPHA 0x0302 80 | #define GL_ONE_MINUS_SRC_ALPHA 0x0303 81 | #define GL_DST_ALPHA 0x0304 82 | #define GL_ONE_MINUS_DST_ALPHA 0x0305 83 | 84 | /* BlendingFactorSrc */ 85 | /* GL_ZERO */ 86 | /* GL_ONE */ 87 | #define GL_DST_COLOR 0x0306 88 | #define GL_ONE_MINUS_DST_COLOR 0x0307 89 | #define GL_SRC_ALPHA_SATURATE 0x0308 90 | /* GL_SRC_ALPHA */ 91 | /* GL_ONE_MINUS_SRC_ALPHA */ 92 | /* GL_DST_ALPHA */ 93 | /* GL_ONE_MINUS_DST_ALPHA */ 94 | 95 | /* ClipPlaneName */ 96 | #define GL_CLIP_PLANE0 0x3000 97 | #define GL_CLIP_PLANE1 0x3001 98 | #define GL_CLIP_PLANE2 0x3002 99 | #define GL_CLIP_PLANE3 0x3003 100 | #define GL_CLIP_PLANE4 0x3004 101 | #define GL_CLIP_PLANE5 0x3005 102 | 103 | /* ColorMaterialFace */ 104 | /* GL_FRONT_AND_BACK */ 105 | 106 | /* ColorMaterialParameter */ 107 | /* GL_AMBIENT_AND_DIFFUSE */ 108 | 109 | /* ColorPointerType */ 110 | /* GL_UNSIGNED_BYTE */ 111 | /* GL_FLOAT */ 112 | /* GL_FIXED */ 113 | 114 | /* CullFaceMode */ 115 | #define GL_FRONT 0x0404 116 | #define GL_BACK 0x0405 117 | #define GL_FRONT_AND_BACK 0x0408 118 | 119 | /* DepthFunction */ 120 | /* GL_NEVER */ 121 | /* GL_LESS */ 122 | /* GL_EQUAL */ 123 | /* GL_LEQUAL */ 124 | /* GL_GREATER */ 125 | /* GL_NOTEQUAL */ 126 | /* GL_GEQUAL */ 127 | /* GL_ALWAYS */ 128 | 129 | /* EnableCap */ 130 | #define GL_FOG 0x0B60 131 | #define GL_LIGHTING 0x0B50 132 | #define GL_TEXTURE_2D 0x0DE1 133 | #define GL_CULL_FACE 0x0B44 134 | #define GL_ALPHA_TEST 0x0BC0 135 | #define GL_BLEND 0x0BE2 136 | #define GL_COLOR_LOGIC_OP 0x0BF2 137 | #define GL_DITHER 0x0BD0 138 | #define GL_STENCIL_TEST 0x0B90 139 | #define GL_DEPTH_TEST 0x0B71 140 | /* GL_LIGHT0 */ 141 | /* GL_LIGHT1 */ 142 | /* GL_LIGHT2 */ 143 | /* GL_LIGHT3 */ 144 | /* GL_LIGHT4 */ 145 | /* GL_LIGHT5 */ 146 | /* GL_LIGHT6 */ 147 | /* GL_LIGHT7 */ 148 | #define GL_POINT_SMOOTH 0x0B10 149 | #define GL_LINE_SMOOTH 0x0B20 150 | #define GL_SCISSOR_TEST 0x0C11 151 | #define GL_COLOR_MATERIAL 0x0B57 152 | #define GL_NORMALIZE 0x0BA1 153 | #define GL_RESCALE_NORMAL 0x803A 154 | #define GL_POLYGON_OFFSET_FILL 0x8037 155 | #define GL_VERTEX_ARRAY 0x8074 156 | #define GL_NORMAL_ARRAY 0x8075 157 | #define GL_COLOR_ARRAY 0x8076 158 | #define GL_TEXTURE_COORD_ARRAY 0x8078 159 | #define GL_MULTISAMPLE 0x809D 160 | #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E 161 | #define GL_SAMPLE_ALPHA_TO_ONE 0x809F 162 | #define GL_SAMPLE_COVERAGE 0x80A0 163 | 164 | /* ErrorCode */ 165 | #define GL_NO_ERROR 0 166 | #define GL_INVALID_ENUM 0x0500 167 | #define GL_INVALID_VALUE 0x0501 168 | #define GL_INVALID_OPERATION 0x0502 169 | #define GL_STACK_OVERFLOW 0x0503 170 | #define GL_STACK_UNDERFLOW 0x0504 171 | #define GL_OUT_OF_MEMORY 0x0505 172 | 173 | /* FogMode */ 174 | /* GL_LINEAR */ 175 | #define GL_EXP 0x0800 176 | #define GL_EXP2 0x0801 177 | 178 | /* FogParameter */ 179 | #define GL_FOG_DENSITY 0x0B62 180 | #define GL_FOG_START 0x0B63 181 | #define GL_FOG_END 0x0B64 182 | #define GL_FOG_MODE 0x0B65 183 | #define GL_FOG_COLOR 0x0B66 184 | 185 | /* FrontFaceDirection */ 186 | #define GL_CW 0x0900 187 | #define GL_CCW 0x0901 188 | 189 | /* GetPName */ 190 | #define GL_CURRENT_COLOR 0x0B00 191 | #define GL_CURRENT_NORMAL 0x0B02 192 | #define GL_CURRENT_TEXTURE_COORDS 0x0B03 193 | #define GL_POINT_SIZE 0x0B11 194 | #define GL_POINT_SIZE_MIN 0x8126 195 | #define GL_POINT_SIZE_MAX 0x8127 196 | #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 197 | #define GL_POINT_DISTANCE_ATTENUATION 0x8129 198 | #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 199 | #define GL_LINE_WIDTH 0x0B21 200 | #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 201 | #define GL_ALIASED_POINT_SIZE_RANGE 0x846D 202 | #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E 203 | #define GL_CULL_FACE_MODE 0x0B45 204 | #define GL_FRONT_FACE 0x0B46 205 | #define GL_SHADE_MODEL 0x0B54 206 | #define GL_DEPTH_RANGE 0x0B70 207 | #define GL_DEPTH_WRITEMASK 0x0B72 208 | #define GL_DEPTH_CLEAR_VALUE 0x0B73 209 | #define GL_DEPTH_FUNC 0x0B74 210 | #define GL_STENCIL_CLEAR_VALUE 0x0B91 211 | #define GL_STENCIL_FUNC 0x0B92 212 | #define GL_STENCIL_VALUE_MASK 0x0B93 213 | #define GL_STENCIL_FAIL 0x0B94 214 | #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 215 | #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 216 | #define GL_STENCIL_REF 0x0B97 217 | #define GL_STENCIL_WRITEMASK 0x0B98 218 | #define GL_MATRIX_MODE 0x0BA0 219 | #define GL_VIEWPORT 0x0BA2 220 | #define GL_MODELVIEW_STACK_DEPTH 0x0BA3 221 | #define GL_PROJECTION_STACK_DEPTH 0x0BA4 222 | #define GL_TEXTURE_STACK_DEPTH 0x0BA5 223 | #define GL_MODELVIEW_MATRIX 0x0BA6 224 | #define GL_PROJECTION_MATRIX 0x0BA7 225 | #define GL_TEXTURE_MATRIX 0x0BA8 226 | #define GL_ALPHA_TEST_FUNC 0x0BC1 227 | #define GL_ALPHA_TEST_REF 0x0BC2 228 | #define GL_BLEND_DST 0x0BE0 229 | #define GL_BLEND_SRC 0x0BE1 230 | #define GL_LOGIC_OP_MODE 0x0BF0 231 | #define GL_SCISSOR_BOX 0x0C10 232 | #define GL_SCISSOR_TEST 0x0C11 233 | #define GL_COLOR_CLEAR_VALUE 0x0C22 234 | #define GL_COLOR_WRITEMASK 0x0C23 235 | #define GL_UNPACK_ALIGNMENT 0x0CF5 236 | #define GL_PACK_ALIGNMENT 0x0D05 237 | #define GL_MAX_LIGHTS 0x0D31 238 | #define GL_MAX_CLIP_PLANES 0x0D32 239 | #define GL_MAX_TEXTURE_SIZE 0x0D33 240 | #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 241 | #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 242 | #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 243 | #define GL_MAX_VIEWPORT_DIMS 0x0D3A 244 | #define GL_MAX_TEXTURE_UNITS 0x84E2 245 | #define GL_SUBPIXEL_BITS 0x0D50 246 | #define GL_RED_BITS 0x0D52 247 | #define GL_GREEN_BITS 0x0D53 248 | #define GL_BLUE_BITS 0x0D54 249 | #define GL_ALPHA_BITS 0x0D55 250 | #define GL_DEPTH_BITS 0x0D56 251 | #define GL_STENCIL_BITS 0x0D57 252 | #define GL_POLYGON_OFFSET_UNITS 0x2A00 253 | #define GL_POLYGON_OFFSET_FILL 0x8037 254 | #define GL_POLYGON_OFFSET_FACTOR 0x8038 255 | #define GL_TEXTURE_BINDING_2D 0x8069 256 | #define GL_VERTEX_ARRAY_SIZE 0x807A 257 | #define GL_VERTEX_ARRAY_TYPE 0x807B 258 | #define GL_VERTEX_ARRAY_STRIDE 0x807C 259 | #define GL_NORMAL_ARRAY_TYPE 0x807E 260 | #define GL_NORMAL_ARRAY_STRIDE 0x807F 261 | #define GL_COLOR_ARRAY_SIZE 0x8081 262 | #define GL_COLOR_ARRAY_TYPE 0x8082 263 | #define GL_COLOR_ARRAY_STRIDE 0x8083 264 | #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 265 | #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 266 | #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A 267 | #define GL_VERTEX_ARRAY_POINTER 0x808E 268 | #define GL_NORMAL_ARRAY_POINTER 0x808F 269 | #define GL_COLOR_ARRAY_POINTER 0x8090 270 | #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 271 | #define GL_SAMPLE_BUFFERS 0x80A8 272 | #define GL_SAMPLES 0x80A9 273 | #define GL_SAMPLE_COVERAGE_VALUE 0x80AA 274 | #define GL_SAMPLE_COVERAGE_INVERT 0x80AB 275 | 276 | /* GetTextureParameter */ 277 | /* GL_TEXTURE_MAG_FILTER */ 278 | /* GL_TEXTURE_MIN_FILTER */ 279 | /* GL_TEXTURE_WRAP_S */ 280 | /* GL_TEXTURE_WRAP_T */ 281 | 282 | #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 283 | #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 284 | 285 | /* HintMode */ 286 | #define GL_DONT_CARE 0x1100 287 | #define GL_FASTEST 0x1101 288 | #define GL_NICEST 0x1102 289 | 290 | /* HintTarget */ 291 | #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 292 | #define GL_POINT_SMOOTH_HINT 0x0C51 293 | #define GL_LINE_SMOOTH_HINT 0x0C52 294 | #define GL_FOG_HINT 0x0C54 295 | #define GL_GENERATE_MIPMAP_HINT 0x8192 296 | 297 | /* LightModelParameter */ 298 | #define GL_LIGHT_MODEL_AMBIENT 0x0B53 299 | #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 300 | 301 | /* LightParameter */ 302 | #define GL_AMBIENT 0x1200 303 | #define GL_DIFFUSE 0x1201 304 | #define GL_SPECULAR 0x1202 305 | #define GL_POSITION 0x1203 306 | #define GL_SPOT_DIRECTION 0x1204 307 | #define GL_SPOT_EXPONENT 0x1205 308 | #define GL_SPOT_CUTOFF 0x1206 309 | #define GL_CONSTANT_ATTENUATION 0x1207 310 | #define GL_LINEAR_ATTENUATION 0x1208 311 | #define GL_QUADRATIC_ATTENUATION 0x1209 312 | 313 | /* DataType */ 314 | #define GL_BYTE 0x1400 315 | #define GL_UNSIGNED_BYTE 0x1401 316 | #define GL_SHORT 0x1402 317 | #define GL_UNSIGNED_SHORT 0x1403 318 | #define GL_FLOAT 0x1406 319 | #define GL_FIXED 0x140C 320 | 321 | /* LogicOp */ 322 | #define GL_CLEAR 0x1500 323 | #define GL_AND 0x1501 324 | #define GL_AND_REVERSE 0x1502 325 | #define GL_COPY 0x1503 326 | #define GL_AND_INVERTED 0x1504 327 | #define GL_NOOP 0x1505 328 | #define GL_XOR 0x1506 329 | #define GL_OR 0x1507 330 | #define GL_NOR 0x1508 331 | #define GL_EQUIV 0x1509 332 | #define GL_INVERT 0x150A 333 | #define GL_OR_REVERSE 0x150B 334 | #define GL_COPY_INVERTED 0x150C 335 | #define GL_OR_INVERTED 0x150D 336 | #define GL_NAND 0x150E 337 | #define GL_SET 0x150F 338 | 339 | /* MaterialFace */ 340 | /* GL_FRONT_AND_BACK */ 341 | 342 | /* MaterialParameter */ 343 | #define GL_EMISSION 0x1600 344 | #define GL_SHININESS 0x1601 345 | #define GL_AMBIENT_AND_DIFFUSE 0x1602 346 | /* GL_AMBIENT */ 347 | /* GL_DIFFUSE */ 348 | /* GL_SPECULAR */ 349 | 350 | /* MatrixMode */ 351 | #define GL_MODELVIEW 0x1700 352 | #define GL_PROJECTION 0x1701 353 | #define GL_TEXTURE 0x1702 354 | 355 | /* NormalPointerType */ 356 | /* GL_BYTE */ 357 | /* GL_SHORT */ 358 | /* GL_FLOAT */ 359 | /* GL_FIXED */ 360 | 361 | /* PixelFormat */ 362 | #define GL_ALPHA 0x1906 363 | #define GL_RGB 0x1907 364 | #define GL_RGBA 0x1908 365 | #define GL_LUMINANCE 0x1909 366 | #define GL_LUMINANCE_ALPHA 0x190A 367 | 368 | /* PixelStoreParameter */ 369 | #define GL_UNPACK_ALIGNMENT 0x0CF5 370 | #define GL_PACK_ALIGNMENT 0x0D05 371 | 372 | /* PixelType */ 373 | /* GL_UNSIGNED_BYTE */ 374 | #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 375 | #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 376 | #define GL_UNSIGNED_SHORT_5_6_5 0x8363 377 | 378 | /* ShadingModel */ 379 | #define GL_FLAT 0x1D00 380 | #define GL_SMOOTH 0x1D01 381 | 382 | /* StencilFunction */ 383 | /* GL_NEVER */ 384 | /* GL_LESS */ 385 | /* GL_EQUAL */ 386 | /* GL_LEQUAL */ 387 | /* GL_GREATER */ 388 | /* GL_NOTEQUAL */ 389 | /* GL_GEQUAL */ 390 | /* GL_ALWAYS */ 391 | 392 | /* StencilOp */ 393 | /* GL_ZERO */ 394 | #define GL_KEEP 0x1E00 395 | #define GL_REPLACE 0x1E01 396 | #define GL_INCR 0x1E02 397 | #define GL_DECR 0x1E03 398 | /* GL_INVERT */ 399 | 400 | /* StringName */ 401 | #define GL_VENDOR 0x1F00 402 | #define GL_RENDERER 0x1F01 403 | #define GL_VERSION 0x1F02 404 | #define GL_EXTENSIONS 0x1F03 405 | 406 | /* TexCoordPointerType */ 407 | /* GL_SHORT */ 408 | /* GL_FLOAT */ 409 | /* GL_FIXED */ 410 | /* GL_BYTE */ 411 | 412 | /* TextureEnvMode */ 413 | #define GL_MODULATE 0x2100 414 | #define GL_DECAL 0x2101 415 | /* GL_BLEND */ 416 | #define GL_ADD 0x0104 417 | /* GL_REPLACE */ 418 | 419 | /* TextureEnvParameter */ 420 | #define GL_TEXTURE_ENV_MODE 0x2200 421 | #define GL_TEXTURE_ENV_COLOR 0x2201 422 | 423 | /* TextureEnvTarget */ 424 | #define GL_TEXTURE_ENV 0x2300 425 | 426 | /* TextureMagFilter */ 427 | #define GL_NEAREST 0x2600 428 | #define GL_LINEAR 0x2601 429 | 430 | /* TextureMinFilter */ 431 | /* GL_NEAREST */ 432 | /* GL_LINEAR */ 433 | #define GL_NEAREST_MIPMAP_NEAREST 0x2700 434 | #define GL_LINEAR_MIPMAP_NEAREST 0x2701 435 | #define GL_NEAREST_MIPMAP_LINEAR 0x2702 436 | #define GL_LINEAR_MIPMAP_LINEAR 0x2703 437 | 438 | /* TextureParameterName */ 439 | #define GL_TEXTURE_MAG_FILTER 0x2800 440 | #define GL_TEXTURE_MIN_FILTER 0x2801 441 | #define GL_TEXTURE_WRAP_S 0x2802 442 | #define GL_TEXTURE_WRAP_T 0x2803 443 | #define GL_GENERATE_MIPMAP 0x8191 444 | 445 | /* TextureTarget */ 446 | /* GL_TEXTURE_2D */ 447 | 448 | /* TextureUnit */ 449 | #define GL_TEXTURE0 0x84C0 450 | #define GL_TEXTURE1 0x84C1 451 | #define GL_TEXTURE2 0x84C2 452 | #define GL_TEXTURE3 0x84C3 453 | #define GL_TEXTURE4 0x84C4 454 | #define GL_TEXTURE5 0x84C5 455 | #define GL_TEXTURE6 0x84C6 456 | #define GL_TEXTURE7 0x84C7 457 | #define GL_TEXTURE8 0x84C8 458 | #define GL_TEXTURE9 0x84C9 459 | #define GL_TEXTURE10 0x84CA 460 | #define GL_TEXTURE11 0x84CB 461 | #define GL_TEXTURE12 0x84CC 462 | #define GL_TEXTURE13 0x84CD 463 | #define GL_TEXTURE14 0x84CE 464 | #define GL_TEXTURE15 0x84CF 465 | #define GL_TEXTURE16 0x84D0 466 | #define GL_TEXTURE17 0x84D1 467 | #define GL_TEXTURE18 0x84D2 468 | #define GL_TEXTURE19 0x84D3 469 | #define GL_TEXTURE20 0x84D4 470 | #define GL_TEXTURE21 0x84D5 471 | #define GL_TEXTURE22 0x84D6 472 | #define GL_TEXTURE23 0x84D7 473 | #define GL_TEXTURE24 0x84D8 474 | #define GL_TEXTURE25 0x84D9 475 | #define GL_TEXTURE26 0x84DA 476 | #define GL_TEXTURE27 0x84DB 477 | #define GL_TEXTURE28 0x84DC 478 | #define GL_TEXTURE29 0x84DD 479 | #define GL_TEXTURE30 0x84DE 480 | #define GL_TEXTURE31 0x84DF 481 | #define GL_ACTIVE_TEXTURE 0x84E0 482 | #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 483 | 484 | /* TextureWrapMode */ 485 | #define GL_REPEAT 0x2901 486 | #define GL_CLAMP_TO_EDGE 0x812F 487 | 488 | /* VertexPointerType */ 489 | /* GL_SHORT */ 490 | /* GL_FLOAT */ 491 | /* GL_FIXED */ 492 | /* GL_BYTE */ 493 | 494 | /* LightName */ 495 | #define GL_LIGHT0 0x4000 496 | #define GL_LIGHT1 0x4001 497 | #define GL_LIGHT2 0x4002 498 | #define GL_LIGHT3 0x4003 499 | #define GL_LIGHT4 0x4004 500 | #define GL_LIGHT5 0x4005 501 | #define GL_LIGHT6 0x4006 502 | #define GL_LIGHT7 0x4007 503 | 504 | /* Buffer Objects */ 505 | #define GL_ARRAY_BUFFER 0x8892 506 | #define GL_ELEMENT_ARRAY_BUFFER 0x8893 507 | 508 | #define GL_ARRAY_BUFFER_BINDING 0x8894 509 | #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 510 | #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 511 | #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 512 | #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 513 | #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A 514 | 515 | #define GL_STATIC_DRAW 0x88E4 516 | #define GL_DYNAMIC_DRAW 0x88E8 517 | 518 | #define GL_BUFFER_SIZE 0x8764 519 | #define GL_BUFFER_USAGE 0x8765 520 | 521 | /* Texture combine + dot3 */ 522 | #define GL_SUBTRACT 0x84E7 523 | #define GL_COMBINE 0x8570 524 | #define GL_COMBINE_RGB 0x8571 525 | #define GL_COMBINE_ALPHA 0x8572 526 | #define GL_RGB_SCALE 0x8573 527 | #define GL_ADD_SIGNED 0x8574 528 | #define GL_INTERPOLATE 0x8575 529 | #define GL_CONSTANT 0x8576 530 | #define GL_PRIMARY_COLOR 0x8577 531 | #define GL_PREVIOUS 0x8578 532 | #define GL_OPERAND0_RGB 0x8590 533 | #define GL_OPERAND1_RGB 0x8591 534 | #define GL_OPERAND2_RGB 0x8592 535 | #define GL_OPERAND0_ALPHA 0x8598 536 | #define GL_OPERAND1_ALPHA 0x8599 537 | #define GL_OPERAND2_ALPHA 0x859A 538 | 539 | #define GL_ALPHA_SCALE 0x0D1C 540 | 541 | #define GL_SRC0_RGB 0x8580 542 | #define GL_SRC1_RGB 0x8581 543 | #define GL_SRC2_RGB 0x8582 544 | #define GL_SRC0_ALPHA 0x8588 545 | #define GL_SRC1_ALPHA 0x8589 546 | #define GL_SRC2_ALPHA 0x858A 547 | 548 | #define GL_DOT3_RGB 0x86AE 549 | #define GL_DOT3_RGBA 0x86AF 550 | 551 | /*------------------------------------------------------------------------* 552 | * required OES extension tokens 553 | *------------------------------------------------------------------------*/ 554 | 555 | /* OES_read_format */ 556 | #ifndef GL_OES_read_format 557 | #define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A 558 | #define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B 559 | #endif 560 | 561 | /* GL_OES_compressed_paletted_texture */ 562 | #ifndef GL_OES_compressed_paletted_texture 563 | #define GL_PALETTE4_RGB8_OES 0x8B90 564 | #define GL_PALETTE4_RGBA8_OES 0x8B91 565 | #define GL_PALETTE4_R5_G6_B5_OES 0x8B92 566 | #define GL_PALETTE4_RGBA4_OES 0x8B93 567 | #define GL_PALETTE4_RGB5_A1_OES 0x8B94 568 | #define GL_PALETTE8_RGB8_OES 0x8B95 569 | #define GL_PALETTE8_RGBA8_OES 0x8B96 570 | #define GL_PALETTE8_R5_G6_B5_OES 0x8B97 571 | #define GL_PALETTE8_RGBA4_OES 0x8B98 572 | #define GL_PALETTE8_RGB5_A1_OES 0x8B99 573 | #endif 574 | 575 | /* OES_point_size_array */ 576 | #ifndef GL_OES_point_size_array 577 | #define GL_POINT_SIZE_ARRAY_OES 0x8B9C 578 | #define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A 579 | #define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B 580 | #define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C 581 | #define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F 582 | #endif 583 | 584 | /* GL_OES_point_sprite */ 585 | #ifndef GL_OES_point_sprite 586 | #define GL_POINT_SPRITE_OES 0x8861 587 | #define GL_COORD_REPLACE_OES 0x8862 588 | #endif 589 | 590 | /*************************************************************/ 591 | 592 | /* Available only in Common profile */ 593 | GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref); 594 | GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 595 | GL_API void GL_APIENTRY glClearDepthf (GLclampf depth); 596 | GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation); 597 | GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); 598 | GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); 599 | GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param); 600 | GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params); 601 | GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); 602 | GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]); 603 | GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params); 604 | GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); 605 | GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); 606 | GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params); 607 | GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); 608 | GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param); 609 | GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params); 610 | GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); 611 | GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); 612 | GL_API void GL_APIENTRY glLineWidth (GLfloat width); 613 | GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m); 614 | GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); 615 | GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); 616 | GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m); 617 | GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); 618 | GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); 619 | GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); 620 | GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param); 621 | GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); 622 | GL_API void GL_APIENTRY glPointSize (GLfloat size); 623 | GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); 624 | GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); 625 | GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); 626 | GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); 627 | GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); 628 | GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); 629 | GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); 630 | GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); 631 | 632 | /* Available in both Common and Common-Lite profiles */ 633 | GL_API void GL_APIENTRY glActiveTexture (GLenum texture); 634 | GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref); 635 | GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); 636 | GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); 637 | GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); 638 | GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); 639 | GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); 640 | GL_API void GL_APIENTRY glClear (GLbitfield mask); 641 | GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); 642 | GL_API void GL_APIENTRY glClearDepthx (GLclampx depth); 643 | GL_API void GL_APIENTRY glClearStencil (GLint s); 644 | GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture); 645 | GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation); 646 | GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); 647 | GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); 648 | GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); 649 | GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); 650 | GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); 651 | GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); 652 | GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); 653 | GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); 654 | GL_API void GL_APIENTRY glCullFace (GLenum mode); 655 | GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); 656 | GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); 657 | GL_API void GL_APIENTRY glDepthFunc (GLenum func); 658 | GL_API void GL_APIENTRY glDepthMask (GLboolean flag); 659 | GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar); 660 | GL_API void GL_APIENTRY glDisable (GLenum cap); 661 | GL_API void GL_APIENTRY glDisableClientState (GLenum array); 662 | GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); 663 | GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); 664 | GL_API void GL_APIENTRY glEnable (GLenum cap); 665 | GL_API void GL_APIENTRY glEnableClientState (GLenum array); 666 | GL_API void GL_APIENTRY glFinish (void); 667 | GL_API void GL_APIENTRY glFlush (void); 668 | GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param); 669 | GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params); 670 | GL_API void GL_APIENTRY glFrontFace (GLenum mode); 671 | GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); 672 | GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); 673 | GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); 674 | GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]); 675 | GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); 676 | GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); 677 | GL_API GLenum GL_APIENTRY glGetError (void); 678 | GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params); 679 | GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); 680 | GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params); 681 | GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params); 682 | GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params); 683 | GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name); 684 | GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params); 685 | GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params); 686 | GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); 687 | GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params); 688 | GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode); 689 | GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); 690 | GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap); 691 | GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture); 692 | GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param); 693 | GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params); 694 | GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param); 695 | GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params); 696 | GL_API void GL_APIENTRY glLineWidthx (GLfixed width); 697 | GL_API void GL_APIENTRY glLoadIdentity (void); 698 | GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m); 699 | GL_API void GL_APIENTRY glLogicOp (GLenum opcode); 700 | GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param); 701 | GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params); 702 | GL_API void GL_APIENTRY glMatrixMode (GLenum mode); 703 | GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m); 704 | GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); 705 | GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz); 706 | GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); 707 | GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); 708 | GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); 709 | GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param); 710 | GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params); 711 | GL_API void GL_APIENTRY glPointSizex (GLfixed size); 712 | GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units); 713 | GL_API void GL_APIENTRY glPopMatrix (void); 714 | GL_API void GL_APIENTRY glPushMatrix (void); 715 | GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); 716 | GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); 717 | GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); 718 | GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert); 719 | GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z); 720 | GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); 721 | GL_API void GL_APIENTRY glShadeModel (GLenum mode); 722 | GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); 723 | GL_API void GL_APIENTRY glStencilMask (GLuint mask); 724 | GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); 725 | GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); 726 | GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); 727 | GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param); 728 | GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); 729 | GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params); 730 | GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); 731 | GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); 732 | GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param); 733 | GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); 734 | GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params); 735 | GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); 736 | GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z); 737 | GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); 738 | GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); 739 | 740 | /*------------------------------------------------------------------------* 741 | * Required OES extension functions 742 | *------------------------------------------------------------------------*/ 743 | 744 | /* GL_OES_read_format */ 745 | #ifndef GL_OES_read_format 746 | #define GL_OES_read_format 1 747 | #endif 748 | 749 | /* GL_OES_compressed_paletted_texture */ 750 | #ifndef GL_OES_compressed_paletted_texture 751 | #define GL_OES_compressed_paletted_texture 1 752 | #endif 753 | 754 | /* GL_OES_point_size_array */ 755 | #ifndef GL_OES_point_size_array 756 | #define GL_OES_point_size_array 1 757 | GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer); 758 | #endif 759 | 760 | /* GL_OES_point_sprite */ 761 | #ifndef GL_OES_point_sprite 762 | #define GL_OES_point_sprite 1 763 | #endif 764 | 765 | #ifdef __cplusplus 766 | } 767 | #endif 768 | 769 | #endif /* __gl_h_ */ 770 | 771 | -------------------------------------------------------------------------------- /GLES/glplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __glplatform_h_ 2 | #define __glplatform_h_ 3 | 4 | /* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 1.X gl.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | #include 21 | 22 | #ifndef GL_API 23 | #define GL_API KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __glplatform_h_ */ 31 | -------------------------------------------------------------------------------- /GLES2/gl2.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2_h_ 2 | #define __gl2_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* 13 | * This document is licensed under the SGI Free Software B License Version 14 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 15 | */ 16 | 17 | /*------------------------------------------------------------------------- 18 | * Data type definitions 19 | *-----------------------------------------------------------------------*/ 20 | 21 | typedef void GLvoid; 22 | typedef char GLchar; 23 | typedef unsigned int GLenum; 24 | typedef unsigned char GLboolean; 25 | typedef unsigned int GLbitfield; 26 | typedef khronos_int8_t GLbyte; 27 | typedef short GLshort; 28 | typedef int GLint; 29 | typedef int GLsizei; 30 | typedef khronos_uint8_t GLubyte; 31 | typedef unsigned short GLushort; 32 | typedef unsigned int GLuint; 33 | typedef khronos_float_t GLfloat; 34 | typedef khronos_float_t GLclampf; 35 | typedef khronos_int32_t GLfixed; 36 | 37 | /* GL types for handling large vertex buffer objects */ 38 | typedef khronos_intptr_t GLintptr; 39 | typedef khronos_ssize_t GLsizeiptr; 40 | 41 | /* OpenGL ES core versions */ 42 | #define GL_ES_VERSION_2_0 1 43 | 44 | /* ClearBufferMask */ 45 | #define GL_DEPTH_BUFFER_BIT 0x00000100 46 | #define GL_STENCIL_BUFFER_BIT 0x00000400 47 | #define GL_COLOR_BUFFER_BIT 0x00004000 48 | 49 | /* Boolean */ 50 | #define GL_FALSE 0 51 | #define GL_TRUE 1 52 | 53 | /* BeginMode */ 54 | #define GL_POINTS 0x0000 55 | #define GL_LINES 0x0001 56 | #define GL_LINE_LOOP 0x0002 57 | #define GL_LINE_STRIP 0x0003 58 | #define GL_TRIANGLES 0x0004 59 | #define GL_TRIANGLE_STRIP 0x0005 60 | #define GL_TRIANGLE_FAN 0x0006 61 | 62 | /* AlphaFunction (not supported in ES20) */ 63 | /* GL_NEVER */ 64 | /* GL_LESS */ 65 | /* GL_EQUAL */ 66 | /* GL_LEQUAL */ 67 | /* GL_GREATER */ 68 | /* GL_NOTEQUAL */ 69 | /* GL_GEQUAL */ 70 | /* GL_ALWAYS */ 71 | 72 | /* BlendingFactorDest */ 73 | #define GL_ZERO 0 74 | #define GL_ONE 1 75 | #define GL_SRC_COLOR 0x0300 76 | #define GL_ONE_MINUS_SRC_COLOR 0x0301 77 | #define GL_SRC_ALPHA 0x0302 78 | #define GL_ONE_MINUS_SRC_ALPHA 0x0303 79 | #define GL_DST_ALPHA 0x0304 80 | #define GL_ONE_MINUS_DST_ALPHA 0x0305 81 | 82 | /* BlendingFactorSrc */ 83 | /* GL_ZERO */ 84 | /* GL_ONE */ 85 | #define GL_DST_COLOR 0x0306 86 | #define GL_ONE_MINUS_DST_COLOR 0x0307 87 | #define GL_SRC_ALPHA_SATURATE 0x0308 88 | /* GL_SRC_ALPHA */ 89 | /* GL_ONE_MINUS_SRC_ALPHA */ 90 | /* GL_DST_ALPHA */ 91 | /* GL_ONE_MINUS_DST_ALPHA */ 92 | 93 | /* BlendEquationSeparate */ 94 | #define GL_FUNC_ADD 0x8006 95 | #define GL_BLEND_EQUATION 0x8009 96 | #define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ 97 | #define GL_BLEND_EQUATION_ALPHA 0x883D 98 | 99 | /* BlendSubtract */ 100 | #define GL_FUNC_SUBTRACT 0x800A 101 | #define GL_FUNC_REVERSE_SUBTRACT 0x800B 102 | 103 | /* Separate Blend Functions */ 104 | #define GL_BLEND_DST_RGB 0x80C8 105 | #define GL_BLEND_SRC_RGB 0x80C9 106 | #define GL_BLEND_DST_ALPHA 0x80CA 107 | #define GL_BLEND_SRC_ALPHA 0x80CB 108 | #define GL_CONSTANT_COLOR 0x8001 109 | #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 110 | #define GL_CONSTANT_ALPHA 0x8003 111 | #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 112 | #define GL_BLEND_COLOR 0x8005 113 | 114 | /* Buffer Objects */ 115 | #define GL_ARRAY_BUFFER 0x8892 116 | #define GL_ELEMENT_ARRAY_BUFFER 0x8893 117 | #define GL_ARRAY_BUFFER_BINDING 0x8894 118 | #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 119 | 120 | #define GL_STREAM_DRAW 0x88E0 121 | #define GL_STATIC_DRAW 0x88E4 122 | #define GL_DYNAMIC_DRAW 0x88E8 123 | 124 | #define GL_BUFFER_SIZE 0x8764 125 | #define GL_BUFFER_USAGE 0x8765 126 | 127 | #define GL_CURRENT_VERTEX_ATTRIB 0x8626 128 | 129 | /* CullFaceMode */ 130 | #define GL_FRONT 0x0404 131 | #define GL_BACK 0x0405 132 | #define GL_FRONT_AND_BACK 0x0408 133 | 134 | /* DepthFunction */ 135 | /* GL_NEVER */ 136 | /* GL_LESS */ 137 | /* GL_EQUAL */ 138 | /* GL_LEQUAL */ 139 | /* GL_GREATER */ 140 | /* GL_NOTEQUAL */ 141 | /* GL_GEQUAL */ 142 | /* GL_ALWAYS */ 143 | 144 | /* EnableCap */ 145 | #define GL_TEXTURE_2D 0x0DE1 146 | #define GL_CULL_FACE 0x0B44 147 | #define GL_BLEND 0x0BE2 148 | #define GL_DITHER 0x0BD0 149 | #define GL_STENCIL_TEST 0x0B90 150 | #define GL_DEPTH_TEST 0x0B71 151 | #define GL_SCISSOR_TEST 0x0C11 152 | #define GL_POLYGON_OFFSET_FILL 0x8037 153 | #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E 154 | #define GL_SAMPLE_COVERAGE 0x80A0 155 | 156 | /* ErrorCode */ 157 | #define GL_NO_ERROR 0 158 | #define GL_INVALID_ENUM 0x0500 159 | #define GL_INVALID_VALUE 0x0501 160 | #define GL_INVALID_OPERATION 0x0502 161 | #define GL_OUT_OF_MEMORY 0x0505 162 | 163 | /* FrontFaceDirection */ 164 | #define GL_CW 0x0900 165 | #define GL_CCW 0x0901 166 | 167 | /* GetPName */ 168 | #define GL_LINE_WIDTH 0x0B21 169 | #define GL_ALIASED_POINT_SIZE_RANGE 0x846D 170 | #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E 171 | #define GL_CULL_FACE_MODE 0x0B45 172 | #define GL_FRONT_FACE 0x0B46 173 | #define GL_DEPTH_RANGE 0x0B70 174 | #define GL_DEPTH_WRITEMASK 0x0B72 175 | #define GL_DEPTH_CLEAR_VALUE 0x0B73 176 | #define GL_DEPTH_FUNC 0x0B74 177 | #define GL_STENCIL_CLEAR_VALUE 0x0B91 178 | #define GL_STENCIL_FUNC 0x0B92 179 | #define GL_STENCIL_FAIL 0x0B94 180 | #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 181 | #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 182 | #define GL_STENCIL_REF 0x0B97 183 | #define GL_STENCIL_VALUE_MASK 0x0B93 184 | #define GL_STENCIL_WRITEMASK 0x0B98 185 | #define GL_STENCIL_BACK_FUNC 0x8800 186 | #define GL_STENCIL_BACK_FAIL 0x8801 187 | #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 188 | #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 189 | #define GL_STENCIL_BACK_REF 0x8CA3 190 | #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 191 | #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 192 | #define GL_VIEWPORT 0x0BA2 193 | #define GL_SCISSOR_BOX 0x0C10 194 | /* GL_SCISSOR_TEST */ 195 | #define GL_COLOR_CLEAR_VALUE 0x0C22 196 | #define GL_COLOR_WRITEMASK 0x0C23 197 | #define GL_UNPACK_ALIGNMENT 0x0CF5 198 | #define GL_PACK_ALIGNMENT 0x0D05 199 | #define GL_MAX_TEXTURE_SIZE 0x0D33 200 | #define GL_MAX_VIEWPORT_DIMS 0x0D3A 201 | #define GL_SUBPIXEL_BITS 0x0D50 202 | #define GL_RED_BITS 0x0D52 203 | #define GL_GREEN_BITS 0x0D53 204 | #define GL_BLUE_BITS 0x0D54 205 | #define GL_ALPHA_BITS 0x0D55 206 | #define GL_DEPTH_BITS 0x0D56 207 | #define GL_STENCIL_BITS 0x0D57 208 | #define GL_POLYGON_OFFSET_UNITS 0x2A00 209 | /* GL_POLYGON_OFFSET_FILL */ 210 | #define GL_POLYGON_OFFSET_FACTOR 0x8038 211 | #define GL_TEXTURE_BINDING_2D 0x8069 212 | #define GL_SAMPLE_BUFFERS 0x80A8 213 | #define GL_SAMPLES 0x80A9 214 | #define GL_SAMPLE_COVERAGE_VALUE 0x80AA 215 | #define GL_SAMPLE_COVERAGE_INVERT 0x80AB 216 | 217 | /* GetTextureParameter */ 218 | /* GL_TEXTURE_MAG_FILTER */ 219 | /* GL_TEXTURE_MIN_FILTER */ 220 | /* GL_TEXTURE_WRAP_S */ 221 | /* GL_TEXTURE_WRAP_T */ 222 | 223 | #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 224 | #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 225 | 226 | /* HintMode */ 227 | #define GL_DONT_CARE 0x1100 228 | #define GL_FASTEST 0x1101 229 | #define GL_NICEST 0x1102 230 | 231 | /* HintTarget */ 232 | #define GL_GENERATE_MIPMAP_HINT 0x8192 233 | 234 | /* DataType */ 235 | #define GL_BYTE 0x1400 236 | #define GL_UNSIGNED_BYTE 0x1401 237 | #define GL_SHORT 0x1402 238 | #define GL_UNSIGNED_SHORT 0x1403 239 | #define GL_INT 0x1404 240 | #define GL_UNSIGNED_INT 0x1405 241 | #define GL_FLOAT 0x1406 242 | #define GL_FIXED 0x140C 243 | 244 | /* PixelFormat */ 245 | #define GL_DEPTH_COMPONENT 0x1902 246 | #define GL_ALPHA 0x1906 247 | #define GL_RGB 0x1907 248 | #define GL_RGBA 0x1908 249 | #define GL_LUMINANCE 0x1909 250 | #define GL_LUMINANCE_ALPHA 0x190A 251 | 252 | /* PixelType */ 253 | /* GL_UNSIGNED_BYTE */ 254 | #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 255 | #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 256 | #define GL_UNSIGNED_SHORT_5_6_5 0x8363 257 | 258 | /* Shaders */ 259 | #define GL_FRAGMENT_SHADER 0x8B30 260 | #define GL_VERTEX_SHADER 0x8B31 261 | #define GL_MAX_VERTEX_ATTRIBS 0x8869 262 | #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB 263 | #define GL_MAX_VARYING_VECTORS 0x8DFC 264 | #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D 265 | #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C 266 | #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 267 | #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD 268 | #define GL_SHADER_TYPE 0x8B4F 269 | #define GL_DELETE_STATUS 0x8B80 270 | #define GL_LINK_STATUS 0x8B82 271 | #define GL_VALIDATE_STATUS 0x8B83 272 | #define GL_ATTACHED_SHADERS 0x8B85 273 | #define GL_ACTIVE_UNIFORMS 0x8B86 274 | #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 275 | #define GL_ACTIVE_ATTRIBUTES 0x8B89 276 | #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A 277 | #define GL_SHADING_LANGUAGE_VERSION 0x8B8C 278 | #define GL_CURRENT_PROGRAM 0x8B8D 279 | 280 | /* StencilFunction */ 281 | #define GL_NEVER 0x0200 282 | #define GL_LESS 0x0201 283 | #define GL_EQUAL 0x0202 284 | #define GL_LEQUAL 0x0203 285 | #define GL_GREATER 0x0204 286 | #define GL_NOTEQUAL 0x0205 287 | #define GL_GEQUAL 0x0206 288 | #define GL_ALWAYS 0x0207 289 | 290 | /* StencilOp */ 291 | /* GL_ZERO */ 292 | #define GL_KEEP 0x1E00 293 | #define GL_REPLACE 0x1E01 294 | #define GL_INCR 0x1E02 295 | #define GL_DECR 0x1E03 296 | #define GL_INVERT 0x150A 297 | #define GL_INCR_WRAP 0x8507 298 | #define GL_DECR_WRAP 0x8508 299 | 300 | /* StringName */ 301 | #define GL_VENDOR 0x1F00 302 | #define GL_RENDERER 0x1F01 303 | #define GL_VERSION 0x1F02 304 | #define GL_EXTENSIONS 0x1F03 305 | 306 | /* TextureMagFilter */ 307 | #define GL_NEAREST 0x2600 308 | #define GL_LINEAR 0x2601 309 | 310 | /* TextureMinFilter */ 311 | /* GL_NEAREST */ 312 | /* GL_LINEAR */ 313 | #define GL_NEAREST_MIPMAP_NEAREST 0x2700 314 | #define GL_LINEAR_MIPMAP_NEAREST 0x2701 315 | #define GL_NEAREST_MIPMAP_LINEAR 0x2702 316 | #define GL_LINEAR_MIPMAP_LINEAR 0x2703 317 | 318 | /* TextureParameterName */ 319 | #define GL_TEXTURE_MAG_FILTER 0x2800 320 | #define GL_TEXTURE_MIN_FILTER 0x2801 321 | #define GL_TEXTURE_WRAP_S 0x2802 322 | #define GL_TEXTURE_WRAP_T 0x2803 323 | 324 | /* TextureTarget */ 325 | /* GL_TEXTURE_2D */ 326 | #define GL_TEXTURE 0x1702 327 | 328 | #define GL_TEXTURE_CUBE_MAP 0x8513 329 | #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 330 | #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 331 | #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 332 | #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 333 | #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 334 | #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 335 | #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A 336 | #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C 337 | 338 | /* TextureUnit */ 339 | #define GL_TEXTURE0 0x84C0 340 | #define GL_TEXTURE1 0x84C1 341 | #define GL_TEXTURE2 0x84C2 342 | #define GL_TEXTURE3 0x84C3 343 | #define GL_TEXTURE4 0x84C4 344 | #define GL_TEXTURE5 0x84C5 345 | #define GL_TEXTURE6 0x84C6 346 | #define GL_TEXTURE7 0x84C7 347 | #define GL_TEXTURE8 0x84C8 348 | #define GL_TEXTURE9 0x84C9 349 | #define GL_TEXTURE10 0x84CA 350 | #define GL_TEXTURE11 0x84CB 351 | #define GL_TEXTURE12 0x84CC 352 | #define GL_TEXTURE13 0x84CD 353 | #define GL_TEXTURE14 0x84CE 354 | #define GL_TEXTURE15 0x84CF 355 | #define GL_TEXTURE16 0x84D0 356 | #define GL_TEXTURE17 0x84D1 357 | #define GL_TEXTURE18 0x84D2 358 | #define GL_TEXTURE19 0x84D3 359 | #define GL_TEXTURE20 0x84D4 360 | #define GL_TEXTURE21 0x84D5 361 | #define GL_TEXTURE22 0x84D6 362 | #define GL_TEXTURE23 0x84D7 363 | #define GL_TEXTURE24 0x84D8 364 | #define GL_TEXTURE25 0x84D9 365 | #define GL_TEXTURE26 0x84DA 366 | #define GL_TEXTURE27 0x84DB 367 | #define GL_TEXTURE28 0x84DC 368 | #define GL_TEXTURE29 0x84DD 369 | #define GL_TEXTURE30 0x84DE 370 | #define GL_TEXTURE31 0x84DF 371 | #define GL_ACTIVE_TEXTURE 0x84E0 372 | 373 | /* TextureWrapMode */ 374 | #define GL_REPEAT 0x2901 375 | #define GL_CLAMP_TO_EDGE 0x812F 376 | #define GL_MIRRORED_REPEAT 0x8370 377 | 378 | /* Uniform Types */ 379 | #define GL_FLOAT_VEC2 0x8B50 380 | #define GL_FLOAT_VEC3 0x8B51 381 | #define GL_FLOAT_VEC4 0x8B52 382 | #define GL_INT_VEC2 0x8B53 383 | #define GL_INT_VEC3 0x8B54 384 | #define GL_INT_VEC4 0x8B55 385 | #define GL_BOOL 0x8B56 386 | #define GL_BOOL_VEC2 0x8B57 387 | #define GL_BOOL_VEC3 0x8B58 388 | #define GL_BOOL_VEC4 0x8B59 389 | #define GL_FLOAT_MAT2 0x8B5A 390 | #define GL_FLOAT_MAT3 0x8B5B 391 | #define GL_FLOAT_MAT4 0x8B5C 392 | #define GL_SAMPLER_2D 0x8B5E 393 | #define GL_SAMPLER_CUBE 0x8B60 394 | 395 | /* Vertex Arrays */ 396 | #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 397 | #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 398 | #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 399 | #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 400 | #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A 401 | #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 402 | #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F 403 | 404 | /* Read Format */ 405 | #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A 406 | #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B 407 | 408 | /* Shader Source */ 409 | #define GL_COMPILE_STATUS 0x8B81 410 | #define GL_INFO_LOG_LENGTH 0x8B84 411 | #define GL_SHADER_SOURCE_LENGTH 0x8B88 412 | #define GL_SHADER_COMPILER 0x8DFA 413 | 414 | /* Shader Binary */ 415 | #define GL_SHADER_BINARY_FORMATS 0x8DF8 416 | #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 417 | 418 | /* Shader Precision-Specified Types */ 419 | #define GL_LOW_FLOAT 0x8DF0 420 | #define GL_MEDIUM_FLOAT 0x8DF1 421 | #define GL_HIGH_FLOAT 0x8DF2 422 | #define GL_LOW_INT 0x8DF3 423 | #define GL_MEDIUM_INT 0x8DF4 424 | #define GL_HIGH_INT 0x8DF5 425 | 426 | /* Framebuffer Object. */ 427 | #define GL_FRAMEBUFFER 0x8D40 428 | #define GL_RENDERBUFFER 0x8D41 429 | 430 | #define GL_RGBA4 0x8056 431 | #define GL_RGB5_A1 0x8057 432 | #define GL_RGB565 0x8D62 433 | #define GL_DEPTH_COMPONENT16 0x81A5 434 | #define GL_STENCIL_INDEX 0x1901 435 | #define GL_STENCIL_INDEX8 0x8D48 436 | 437 | #define GL_RENDERBUFFER_WIDTH 0x8D42 438 | #define GL_RENDERBUFFER_HEIGHT 0x8D43 439 | #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 440 | #define GL_RENDERBUFFER_RED_SIZE 0x8D50 441 | #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 442 | #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 443 | #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 444 | #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 445 | #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 446 | 447 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 448 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 449 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 450 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 451 | 452 | #define GL_COLOR_ATTACHMENT0 0x8CE0 453 | #define GL_DEPTH_ATTACHMENT 0x8D00 454 | #define GL_STENCIL_ATTACHMENT 0x8D20 455 | 456 | #define GL_NONE 0 457 | 458 | #define GL_FRAMEBUFFER_COMPLETE 0x8CD5 459 | #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 460 | #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 461 | #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 462 | #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD 463 | 464 | #define GL_FRAMEBUFFER_BINDING 0x8CA6 465 | #define GL_RENDERBUFFER_BINDING 0x8CA7 466 | #define GL_MAX_RENDERBUFFER_SIZE 0x84E8 467 | 468 | #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 469 | 470 | /*------------------------------------------------------------------------- 471 | * GL core functions. 472 | *-----------------------------------------------------------------------*/ 473 | 474 | GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); 475 | GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); 476 | GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); 477 | GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); 478 | GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); 479 | GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); 480 | GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); 481 | GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 482 | GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); 483 | GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); 484 | GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); 485 | GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); 486 | GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); 487 | GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); 488 | GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); 489 | GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); 490 | GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 491 | GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); 492 | GL_APICALL void GL_APIENTRY glClearStencil (GLint s); 493 | GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); 494 | GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); 495 | GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); 496 | GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); 497 | GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); 498 | GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); 499 | GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); 500 | GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); 501 | GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); 502 | GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); 503 | GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); 504 | GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); 505 | GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); 506 | GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); 507 | GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); 508 | GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); 509 | GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); 510 | GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); 511 | GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); 512 | GL_APICALL void GL_APIENTRY glDisable (GLenum cap); 513 | GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); 514 | GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); 515 | GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); 516 | GL_APICALL void GL_APIENTRY glEnable (GLenum cap); 517 | GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); 518 | GL_APICALL void GL_APIENTRY glFinish (void); 519 | GL_APICALL void GL_APIENTRY glFlush (void); 520 | GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); 521 | GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); 522 | GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); 523 | GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); 524 | GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); 525 | GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); 526 | GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); 527 | GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); 528 | GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); 529 | GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); 530 | GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); 531 | GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); 532 | GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); 533 | GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); 534 | GL_APICALL GLenum GL_APIENTRY glGetError (void); 535 | GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); 536 | GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); 537 | GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); 538 | GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); 539 | GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); 540 | GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); 541 | GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); 542 | GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); 543 | GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); 544 | GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); 545 | GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); 546 | GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); 547 | GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); 548 | GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); 549 | GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); 550 | GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); 551 | GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); 552 | GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); 553 | GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); 554 | GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); 555 | GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); 556 | GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); 557 | GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); 558 | GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); 559 | GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); 560 | GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); 561 | GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); 562 | GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); 563 | GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); 564 | GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); 565 | GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); 566 | GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); 567 | GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); 568 | GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); 569 | GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); 570 | GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); 571 | GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); 572 | GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length); 573 | GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); 574 | GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); 575 | GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); 576 | GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); 577 | GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); 578 | GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); 579 | GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); 580 | GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); 581 | GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); 582 | GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); 583 | GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); 584 | GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); 585 | GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); 586 | GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); 587 | GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); 588 | GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); 589 | GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); 590 | GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); 591 | GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); 592 | GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); 593 | GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); 594 | GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); 595 | GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); 596 | GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); 597 | GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 598 | GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); 599 | GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); 600 | GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); 601 | GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 602 | GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 603 | GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 604 | GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); 605 | GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); 606 | GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); 607 | GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); 608 | GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); 609 | GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); 610 | GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); 611 | GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); 612 | GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 613 | GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); 614 | GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); 615 | GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); 616 | 617 | #ifdef __cplusplus 618 | } 619 | #endif 620 | 621 | #endif /* __gl2_h_ */ 622 | -------------------------------------------------------------------------------- /GLES2/gl2ext.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2ext_h_ 2 | #define __gl2ext_h_ 3 | 4 | /* $Revision: 15049 $ on $Date:: 2011-07-06 17:28:16 -0700 #$ */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* 11 | * This document is licensed under the SGI Free Software B License Version 12 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 13 | */ 14 | 15 | #ifndef GL_APIENTRYP 16 | # define GL_APIENTRYP GL_APIENTRY* 17 | #endif 18 | 19 | /*------------------------------------------------------------------------* 20 | * OES extension tokens 21 | *------------------------------------------------------------------------*/ 22 | 23 | /* GL_OES_compressed_ETC1_RGB8_texture */ 24 | #ifndef GL_OES_compressed_ETC1_RGB8_texture 25 | #define GL_ETC1_RGB8_OES 0x8D64 26 | #endif 27 | 28 | /* GL_OES_compressed_paletted_texture */ 29 | #ifndef GL_OES_compressed_paletted_texture 30 | #define GL_PALETTE4_RGB8_OES 0x8B90 31 | #define GL_PALETTE4_RGBA8_OES 0x8B91 32 | #define GL_PALETTE4_R5_G6_B5_OES 0x8B92 33 | #define GL_PALETTE4_RGBA4_OES 0x8B93 34 | #define GL_PALETTE4_RGB5_A1_OES 0x8B94 35 | #define GL_PALETTE8_RGB8_OES 0x8B95 36 | #define GL_PALETTE8_RGBA8_OES 0x8B96 37 | #define GL_PALETTE8_R5_G6_B5_OES 0x8B97 38 | #define GL_PALETTE8_RGBA4_OES 0x8B98 39 | #define GL_PALETTE8_RGB5_A1_OES 0x8B99 40 | #endif 41 | 42 | /* GL_OES_depth24 */ 43 | #ifndef GL_OES_depth24 44 | #define GL_DEPTH_COMPONENT24_OES 0x81A6 45 | #endif 46 | 47 | /* GL_OES_depth32 */ 48 | #ifndef GL_OES_depth32 49 | #define GL_DEPTH_COMPONENT32_OES 0x81A7 50 | #endif 51 | 52 | /* GL_OES_depth_texture */ 53 | /* No new tokens introduced by this extension. */ 54 | 55 | /* GL_OES_EGL_image */ 56 | #ifndef GL_OES_EGL_image 57 | typedef void* GLeglImageOES; 58 | #endif 59 | 60 | /* GL_OES_EGL_image_external */ 61 | #ifndef GL_OES_EGL_image_external 62 | /* GLeglImageOES defined in GL_OES_EGL_image already. */ 63 | #define GL_TEXTURE_EXTERNAL_OES 0x8D65 64 | #define GL_SAMPLER_EXTERNAL_OES 0x8D66 65 | #define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 66 | #define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 67 | #endif 68 | 69 | /* GL_OES_element_index_uint */ 70 | #ifndef GL_OES_element_index_uint 71 | #define GL_UNSIGNED_INT 0x1405 72 | #endif 73 | 74 | /* GL_OES_get_program_binary */ 75 | #ifndef GL_OES_get_program_binary 76 | #define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 77 | #define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE 78 | #define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF 79 | #endif 80 | 81 | /* GL_OES_mapbuffer */ 82 | #ifndef GL_OES_mapbuffer 83 | #define GL_WRITE_ONLY_OES 0x88B9 84 | #define GL_BUFFER_ACCESS_OES 0x88BB 85 | #define GL_BUFFER_MAPPED_OES 0x88BC 86 | #define GL_BUFFER_MAP_POINTER_OES 0x88BD 87 | #endif 88 | 89 | /* GL_OES_packed_depth_stencil */ 90 | #ifndef GL_OES_packed_depth_stencil 91 | #define GL_DEPTH_STENCIL_OES 0x84F9 92 | #define GL_UNSIGNED_INT_24_8_OES 0x84FA 93 | #define GL_DEPTH24_STENCIL8_OES 0x88F0 94 | #endif 95 | 96 | /* GL_OES_rgb8_rgba8 */ 97 | #ifndef GL_OES_rgb8_rgba8 98 | #define GL_RGB8_OES 0x8051 99 | #define GL_RGBA8_OES 0x8058 100 | #endif 101 | 102 | /* GL_OES_standard_derivatives */ 103 | #ifndef GL_OES_standard_derivatives 104 | #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B 105 | #endif 106 | 107 | /* GL_OES_stencil1 */ 108 | #ifndef GL_OES_stencil1 109 | #define GL_STENCIL_INDEX1_OES 0x8D46 110 | #endif 111 | 112 | /* GL_OES_stencil4 */ 113 | #ifndef GL_OES_stencil4 114 | #define GL_STENCIL_INDEX4_OES 0x8D47 115 | #endif 116 | 117 | /* GL_OES_texture_3D */ 118 | #ifndef GL_OES_texture_3D 119 | #define GL_TEXTURE_WRAP_R_OES 0x8072 120 | #define GL_TEXTURE_3D_OES 0x806F 121 | #define GL_TEXTURE_BINDING_3D_OES 0x806A 122 | #define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 123 | #define GL_SAMPLER_3D_OES 0x8B5F 124 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 125 | #endif 126 | 127 | /* GL_OES_texture_float */ 128 | /* No new tokens introduced by this extension. */ 129 | 130 | /* GL_OES_texture_float_linear */ 131 | /* No new tokens introduced by this extension. */ 132 | 133 | /* GL_OES_texture_half_float */ 134 | #ifndef GL_OES_texture_half_float 135 | #define GL_HALF_FLOAT_OES 0x8D61 136 | #endif 137 | 138 | /* GL_OES_texture_half_float_linear */ 139 | /* No new tokens introduced by this extension. */ 140 | 141 | /* GL_OES_texture_npot */ 142 | /* No new tokens introduced by this extension. */ 143 | 144 | /* GL_OES_vertex_array_object */ 145 | #ifndef GL_OES_vertex_array_object 146 | #define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 147 | #endif 148 | 149 | /* GL_OES_vertex_half_float */ 150 | /* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ 151 | 152 | /* GL_OES_vertex_type_10_10_10_2 */ 153 | #ifndef GL_OES_vertex_type_10_10_10_2 154 | #define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 155 | #define GL_INT_10_10_10_2_OES 0x8DF7 156 | #endif 157 | 158 | /*------------------------------------------------------------------------* 159 | * AMD extension tokens 160 | *------------------------------------------------------------------------*/ 161 | 162 | /* GL_AMD_compressed_3DC_texture */ 163 | #ifndef GL_AMD_compressed_3DC_texture 164 | #define GL_3DC_X_AMD 0x87F9 165 | #define GL_3DC_XY_AMD 0x87FA 166 | #endif 167 | 168 | /* GL_AMD_compressed_ATC_texture */ 169 | #ifndef GL_AMD_compressed_ATC_texture 170 | #define GL_ATC_RGB_AMD 0x8C92 171 | #define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 172 | #define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE 173 | #endif 174 | 175 | /* GL_AMD_performance_monitor */ 176 | #ifndef GL_AMD_performance_monitor 177 | #define GL_COUNTER_TYPE_AMD 0x8BC0 178 | #define GL_COUNTER_RANGE_AMD 0x8BC1 179 | #define GL_UNSIGNED_INT64_AMD 0x8BC2 180 | #define GL_PERCENTAGE_AMD 0x8BC3 181 | #define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 182 | #define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 183 | #define GL_PERFMON_RESULT_AMD 0x8BC6 184 | #endif 185 | 186 | /* GL_AMD_program_binary_Z400 */ 187 | #ifndef GL_AMD_program_binary_Z400 188 | #define GL_Z400_BINARY_AMD 0x8740 189 | #endif 190 | 191 | /*------------------------------------------------------------------------* 192 | * ANGLE extension tokens 193 | *------------------------------------------------------------------------*/ 194 | 195 | /* GL_ANGLE_framebuffer_blit */ 196 | #ifndef GL_ANGLE_framebuffer_blit 197 | #define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 198 | #define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 199 | #define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 200 | #define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA 201 | #endif 202 | 203 | /* GL_ANGLE_framebuffer_multisample */ 204 | #ifndef GL_ANGLE_framebuffer_multisample 205 | #define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB 206 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 207 | #define GL_MAX_SAMPLES_ANGLE 0x8D57 208 | #endif 209 | 210 | /*------------------------------------------------------------------------* 211 | * APPLE extension tokens 212 | *------------------------------------------------------------------------*/ 213 | 214 | /* GL_APPLE_rgb_422 */ 215 | #ifndef GL_APPLE_rgb_422 216 | #define GL_RGB_422_APPLE 0x8A1F 217 | #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA 218 | #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB 219 | #endif 220 | 221 | /* GL_APPLE_framebuffer_multisample */ 222 | #ifndef GL_APPLE_framebuffer_multisample 223 | #define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB 224 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 225 | #define GL_MAX_SAMPLES_APPLE 0x8D57 226 | #define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 227 | #define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 228 | #define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 229 | #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA 230 | #endif 231 | 232 | /* GL_APPLE_texture_format_BGRA8888 */ 233 | #ifndef GL_APPLE_texture_format_BGRA8888 234 | #define GL_BGRA_EXT 0x80E1 235 | #endif 236 | 237 | /* GL_APPLE_texture_max_level */ 238 | #ifndef GL_APPLE_texture_max_level 239 | #define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D 240 | #endif 241 | 242 | /*------------------------------------------------------------------------* 243 | * ARM extension tokens 244 | *------------------------------------------------------------------------*/ 245 | 246 | /* GL_ARM_mali_shader_binary */ 247 | #ifndef GL_ARM_mali_shader_binary 248 | #define GL_MALI_SHADER_BINARY_ARM 0x8F60 249 | #endif 250 | 251 | /* GL_ARM_rgba8 */ 252 | /* No new tokens introduced by this extension. */ 253 | 254 | /*------------------------------------------------------------------------* 255 | * EXT extension tokens 256 | *------------------------------------------------------------------------*/ 257 | 258 | /* GL_EXT_blend_minmax */ 259 | #ifndef GL_EXT_blend_minmax 260 | #define GL_MIN_EXT 0x8007 261 | #define GL_MAX_EXT 0x8008 262 | #endif 263 | 264 | /* GL_EXT_discard_framebuffer */ 265 | #ifndef GL_EXT_discard_framebuffer 266 | #define GL_COLOR_EXT 0x1800 267 | #define GL_DEPTH_EXT 0x1801 268 | #define GL_STENCIL_EXT 0x1802 269 | #endif 270 | 271 | /* GL_EXT_multi_draw_arrays */ 272 | /* No new tokens introduced by this extension. */ 273 | 274 | /* GL_EXT_read_format_bgra */ 275 | #ifndef GL_EXT_read_format_bgra 276 | #define GL_BGRA_EXT 0x80E1 277 | #define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 278 | #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 279 | #endif 280 | 281 | /* GL_EXT_shader_texture_lod */ 282 | /* No new tokens introduced by this extension. */ 283 | 284 | /* GL_EXT_texture_filter_anisotropic */ 285 | #ifndef GL_EXT_texture_filter_anisotropic 286 | #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE 287 | #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF 288 | #endif 289 | 290 | /* GL_EXT_texture_format_BGRA8888 */ 291 | #ifndef GL_EXT_texture_format_BGRA8888 292 | #define GL_BGRA_EXT 0x80E1 293 | #endif 294 | 295 | /* GL_EXT_texture_type_2_10_10_10_REV */ 296 | #ifndef GL_EXT_texture_type_2_10_10_10_REV 297 | #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 298 | #endif 299 | 300 | /* GL_EXT_texture_compression_dxt1 */ 301 | #ifndef GL_EXT_texture_compression_dxt1 302 | #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 303 | #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 304 | #endif 305 | 306 | /* GL_EXT_unpack_subimage */ 307 | #ifndef GL_EXT_unpack_subimage 308 | #define GL_UNPACK_ROW_LENGTH 0x0CF2 309 | #define GL_UNPACK_SKIP_ROWS 0x0CF3 310 | #define GL_UNPACK_SKIP_PIXELS 0x0CF4 311 | #endif 312 | 313 | /*------------------------------------------------------------------------* 314 | * DMP extension tokens 315 | *------------------------------------------------------------------------*/ 316 | 317 | /* GL_DMP_shader_binary */ 318 | #ifndef GL_DMP_shader_binary 319 | #define GL_SHADER_BINARY_DMP 0x9250 320 | #endif 321 | 322 | /*------------------------------------------------------------------------* 323 | * IMG extension tokens 324 | *------------------------------------------------------------------------*/ 325 | 326 | /* GL_IMG_program_binary */ 327 | #ifndef GL_IMG_program_binary 328 | #define GL_SGX_PROGRAM_BINARY_IMG 0x9130 329 | #endif 330 | 331 | /* GL_IMG_read_format */ 332 | #ifndef GL_IMG_read_format 333 | #define GL_BGRA_IMG 0x80E1 334 | #define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 335 | #endif 336 | 337 | /* GL_IMG_shader_binary */ 338 | #ifndef GL_IMG_shader_binary 339 | #define GL_SGX_BINARY_IMG 0x8C0A 340 | #endif 341 | 342 | /* GL_IMG_texture_compression_pvrtc */ 343 | #ifndef GL_IMG_texture_compression_pvrtc 344 | #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 345 | #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 346 | #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 347 | #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 348 | #endif 349 | 350 | /* GL_IMG_multisampled_render_to_texture */ 351 | #ifndef GL_IMG_multisampled_render_to_texture 352 | #define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 353 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 354 | #define GL_MAX_SAMPLES_IMG 0x9135 355 | #define GL_TEXTURE_SAMPLES_IMG 0x9136 356 | #endif 357 | 358 | /*------------------------------------------------------------------------* 359 | * NV extension tokens 360 | *------------------------------------------------------------------------*/ 361 | 362 | /* GL_NV_coverage_sample */ 363 | #ifndef GL_NV_coverage_sample 364 | #define GL_COVERAGE_COMPONENT_NV 0x8ED0 365 | #define GL_COVERAGE_COMPONENT4_NV 0x8ED1 366 | #define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 367 | #define GL_COVERAGE_BUFFERS_NV 0x8ED3 368 | #define GL_COVERAGE_SAMPLES_NV 0x8ED4 369 | #define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 370 | #define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 371 | #define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 372 | #define GL_COVERAGE_BUFFER_BIT_NV 0x8000 373 | #endif 374 | 375 | /* GL_NV_depth_nonlinear */ 376 | #ifndef GL_NV_depth_nonlinear 377 | #define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C 378 | #endif 379 | 380 | /* GL_NV_draw_buffers */ 381 | #ifndef GL_NV_draw_buffers 382 | #define GL_MAX_DRAW_BUFFERS_NV 0x8824 383 | #define GL_DRAW_BUFFER0_NV 0x8825 384 | #define GL_DRAW_BUFFER1_NV 0x8826 385 | #define GL_DRAW_BUFFER2_NV 0x8827 386 | #define GL_DRAW_BUFFER3_NV 0x8828 387 | #define GL_DRAW_BUFFER4_NV 0x8829 388 | #define GL_DRAW_BUFFER5_NV 0x882A 389 | #define GL_DRAW_BUFFER6_NV 0x882B 390 | #define GL_DRAW_BUFFER7_NV 0x882C 391 | #define GL_DRAW_BUFFER8_NV 0x882D 392 | #define GL_DRAW_BUFFER9_NV 0x882E 393 | #define GL_DRAW_BUFFER10_NV 0x882F 394 | #define GL_DRAW_BUFFER11_NV 0x8830 395 | #define GL_DRAW_BUFFER12_NV 0x8831 396 | #define GL_DRAW_BUFFER13_NV 0x8832 397 | #define GL_DRAW_BUFFER14_NV 0x8833 398 | #define GL_DRAW_BUFFER15_NV 0x8834 399 | #define GL_COLOR_ATTACHMENT0_NV 0x8CE0 400 | #define GL_COLOR_ATTACHMENT1_NV 0x8CE1 401 | #define GL_COLOR_ATTACHMENT2_NV 0x8CE2 402 | #define GL_COLOR_ATTACHMENT3_NV 0x8CE3 403 | #define GL_COLOR_ATTACHMENT4_NV 0x8CE4 404 | #define GL_COLOR_ATTACHMENT5_NV 0x8CE5 405 | #define GL_COLOR_ATTACHMENT6_NV 0x8CE6 406 | #define GL_COLOR_ATTACHMENT7_NV 0x8CE7 407 | #define GL_COLOR_ATTACHMENT8_NV 0x8CE8 408 | #define GL_COLOR_ATTACHMENT9_NV 0x8CE9 409 | #define GL_COLOR_ATTACHMENT10_NV 0x8CEA 410 | #define GL_COLOR_ATTACHMENT11_NV 0x8CEB 411 | #define GL_COLOR_ATTACHMENT12_NV 0x8CEC 412 | #define GL_COLOR_ATTACHMENT13_NV 0x8CED 413 | #define GL_COLOR_ATTACHMENT14_NV 0x8CEE 414 | #define GL_COLOR_ATTACHMENT15_NV 0x8CEF 415 | #endif 416 | 417 | /* GL_NV_fbo_color_attachments */ 418 | #ifndef GL_NV_fbo_color_attachments 419 | #define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF 420 | /* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */ 421 | #endif 422 | 423 | /* GL_NV_fence */ 424 | #ifndef GL_NV_fence 425 | #define GL_ALL_COMPLETED_NV 0x84F2 426 | #define GL_FENCE_STATUS_NV 0x84F3 427 | #define GL_FENCE_CONDITION_NV 0x84F4 428 | #endif 429 | 430 | /* GL_NV_read_buffer */ 431 | #ifndef GL_NV_read_buffer 432 | #define GL_READ_BUFFER_NV 0x0C02 433 | #endif 434 | 435 | /* GL_NV_read_buffer_front */ 436 | /* No new tokens introduced by this extension. */ 437 | 438 | /* GL_NV_read_depth */ 439 | /* No new tokens introduced by this extension. */ 440 | 441 | /* GL_NV_read_depth_stencil */ 442 | /* No new tokens introduced by this extension. */ 443 | 444 | /* GL_NV_read_stencil */ 445 | /* No new tokens introduced by this extension. */ 446 | 447 | /* GL_NV_texture_compression_s3tc_update */ 448 | /* No new tokens introduced by this extension. */ 449 | 450 | /* GL_NV_texture_npot_2D_mipmap */ 451 | /* No new tokens introduced by this extension. */ 452 | 453 | /*------------------------------------------------------------------------* 454 | * QCOM extension tokens 455 | *------------------------------------------------------------------------*/ 456 | 457 | /* GL_QCOM_alpha_test */ 458 | #ifndef GL_QCOM_alpha_test 459 | #define GL_ALPHA_TEST_QCOM 0x0BC0 460 | #define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 461 | #define GL_ALPHA_TEST_REF_QCOM 0x0BC2 462 | #endif 463 | 464 | /* GL_QCOM_driver_control */ 465 | /* No new tokens introduced by this extension. */ 466 | 467 | /* GL_QCOM_extended_get */ 468 | #ifndef GL_QCOM_extended_get 469 | #define GL_TEXTURE_WIDTH_QCOM 0x8BD2 470 | #define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 471 | #define GL_TEXTURE_DEPTH_QCOM 0x8BD4 472 | #define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 473 | #define GL_TEXTURE_FORMAT_QCOM 0x8BD6 474 | #define GL_TEXTURE_TYPE_QCOM 0x8BD7 475 | #define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 476 | #define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 477 | #define GL_TEXTURE_TARGET_QCOM 0x8BDA 478 | #define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB 479 | #define GL_STATE_RESTORE 0x8BDC 480 | #endif 481 | 482 | /* GL_QCOM_extended_get2 */ 483 | /* No new tokens introduced by this extension. */ 484 | 485 | /* GL_QCOM_perfmon_global_mode */ 486 | #ifndef GL_QCOM_perfmon_global_mode 487 | #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 488 | #endif 489 | 490 | /* GL_QCOM_writeonly_rendering */ 491 | #ifndef GL_QCOM_writeonly_rendering 492 | #define GL_WRITEONLY_RENDERING_QCOM 0x8823 493 | #endif 494 | 495 | /* GL_QCOM_tiled_rendering */ 496 | #ifndef GL_QCOM_tiled_rendering 497 | #define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 498 | #define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 499 | #define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 500 | #define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 501 | #define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 502 | #define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 503 | #define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 504 | #define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 505 | #define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 506 | #define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 507 | #define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 508 | #define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 509 | #define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 510 | #define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 511 | #define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 512 | #define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 513 | #define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 514 | #define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 515 | #define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 516 | #define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 517 | #define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 518 | #define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 519 | #define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 520 | #define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 521 | #define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 522 | #define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 523 | #define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 524 | #define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 525 | #define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 526 | #define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 527 | #define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 528 | #define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 529 | #endif 530 | 531 | /*------------------------------------------------------------------------* 532 | * VIV extension tokens 533 | *------------------------------------------------------------------------*/ 534 | 535 | /* GL_VIV_shader_binary */ 536 | #ifndef GL_VIV_shader_binary 537 | #define GL_SHADER_BINARY_VIV 0x8FC4 538 | #endif 539 | 540 | /*------------------------------------------------------------------------* 541 | * End of extension tokens, start of corresponding extension functions 542 | *------------------------------------------------------------------------*/ 543 | 544 | /*------------------------------------------------------------------------* 545 | * OES extension functions 546 | *------------------------------------------------------------------------*/ 547 | 548 | /* GL_OES_compressed_ETC1_RGB8_texture */ 549 | #ifndef GL_OES_compressed_ETC1_RGB8_texture 550 | #define GL_OES_compressed_ETC1_RGB8_texture 1 551 | #endif 552 | 553 | /* GL_OES_compressed_paletted_texture */ 554 | #ifndef GL_OES_compressed_paletted_texture 555 | #define GL_OES_compressed_paletted_texture 1 556 | #endif 557 | 558 | /* GL_OES_depth24 */ 559 | #ifndef GL_OES_depth24 560 | #define GL_OES_depth24 1 561 | #endif 562 | 563 | /* GL_OES_depth32 */ 564 | #ifndef GL_OES_depth32 565 | #define GL_OES_depth32 1 566 | #endif 567 | 568 | /* GL_OES_depth_texture */ 569 | #ifndef GL_OES_depth_texture 570 | #define GL_OES_depth_texture 1 571 | #endif 572 | 573 | /* GL_OES_EGL_image */ 574 | #ifndef GL_OES_EGL_image 575 | #define GL_OES_EGL_image 1 576 | #ifdef GL_GLEXT_PROTOTYPES 577 | GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); 578 | GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); 579 | #endif 580 | typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); 581 | typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); 582 | #endif 583 | 584 | /* GL_OES_EGL_image_external */ 585 | #ifndef GL_OES_EGL_image_external 586 | #define GL_OES_EGL_image_external 1 587 | /* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */ 588 | #endif 589 | 590 | /* GL_OES_element_index_uint */ 591 | #ifndef GL_OES_element_index_uint 592 | #define GL_OES_element_index_uint 1 593 | #endif 594 | 595 | /* GL_OES_fbo_render_mipmap */ 596 | #ifndef GL_OES_fbo_render_mipmap 597 | #define GL_OES_fbo_render_mipmap 1 598 | #endif 599 | 600 | /* GL_OES_fragment_precision_high */ 601 | #ifndef GL_OES_fragment_precision_high 602 | #define GL_OES_fragment_precision_high 1 603 | #endif 604 | 605 | /* GL_OES_get_program_binary */ 606 | #ifndef GL_OES_get_program_binary 607 | #define GL_OES_get_program_binary 1 608 | #ifdef GL_GLEXT_PROTOTYPES 609 | GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); 610 | GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); 611 | #endif 612 | typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); 613 | typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); 614 | #endif 615 | 616 | /* GL_OES_mapbuffer */ 617 | #ifndef GL_OES_mapbuffer 618 | #define GL_OES_mapbuffer 1 619 | #ifdef GL_GLEXT_PROTOTYPES 620 | GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); 621 | GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); 622 | GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params); 623 | #endif 624 | typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); 625 | typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); 626 | typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params); 627 | #endif 628 | 629 | /* GL_OES_packed_depth_stencil */ 630 | #ifndef GL_OES_packed_depth_stencil 631 | #define GL_OES_packed_depth_stencil 1 632 | #endif 633 | 634 | /* GL_OES_rgb8_rgba8 */ 635 | #ifndef GL_OES_rgb8_rgba8 636 | #define GL_OES_rgb8_rgba8 1 637 | #endif 638 | 639 | /* GL_OES_standard_derivatives */ 640 | #ifndef GL_OES_standard_derivatives 641 | #define GL_OES_standard_derivatives 1 642 | #endif 643 | 644 | /* GL_OES_stencil1 */ 645 | #ifndef GL_OES_stencil1 646 | #define GL_OES_stencil1 1 647 | #endif 648 | 649 | /* GL_OES_stencil4 */ 650 | #ifndef GL_OES_stencil4 651 | #define GL_OES_stencil4 1 652 | #endif 653 | 654 | /* GL_OES_texture_3D */ 655 | #ifndef GL_OES_texture_3D 656 | #define GL_OES_texture_3D 1 657 | #ifdef GL_GLEXT_PROTOTYPES 658 | GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); 659 | GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); 660 | GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); 661 | GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); 662 | GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); 663 | GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); 664 | #endif 665 | typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); 666 | typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); 667 | typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); 668 | typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); 669 | typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); 670 | typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); 671 | #endif 672 | 673 | /* GL_OES_texture_float */ 674 | #ifndef GL_OES_texture_float 675 | #define GL_OES_texture_float 1 676 | #endif 677 | 678 | /* GL_OES_texture_float_linear */ 679 | #ifndef GL_OES_texture_float_linear 680 | #define GL_OES_texture_float_linear 1 681 | #endif 682 | 683 | /* GL_OES_texture_half_float */ 684 | #ifndef GL_OES_texture_half_float 685 | #define GL_OES_texture_half_float 1 686 | #endif 687 | 688 | /* GL_OES_texture_half_float_linear */ 689 | #ifndef GL_OES_texture_half_float_linear 690 | #define GL_OES_texture_half_float_linear 1 691 | #endif 692 | 693 | /* GL_OES_texture_npot */ 694 | #ifndef GL_OES_texture_npot 695 | #define GL_OES_texture_npot 1 696 | #endif 697 | 698 | /* GL_OES_vertex_array_object */ 699 | #ifndef GL_OES_vertex_array_object 700 | #define GL_OES_vertex_array_object 1 701 | #ifdef GL_GLEXT_PROTOTYPES 702 | GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); 703 | GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); 704 | GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); 705 | GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); 706 | #endif 707 | typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); 708 | typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); 709 | typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); 710 | typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); 711 | #endif 712 | 713 | /* GL_OES_vertex_half_float */ 714 | #ifndef GL_OES_vertex_half_float 715 | #define GL_OES_vertex_half_float 1 716 | #endif 717 | 718 | /* GL_OES_vertex_type_10_10_10_2 */ 719 | #ifndef GL_OES_vertex_type_10_10_10_2 720 | #define GL_OES_vertex_type_10_10_10_2 1 721 | #endif 722 | 723 | /*------------------------------------------------------------------------* 724 | * AMD extension functions 725 | *------------------------------------------------------------------------*/ 726 | 727 | /* GL_AMD_compressed_3DC_texture */ 728 | #ifndef GL_AMD_compressed_3DC_texture 729 | #define GL_AMD_compressed_3DC_texture 1 730 | #endif 731 | 732 | /* GL_AMD_compressed_ATC_texture */ 733 | #ifndef GL_AMD_compressed_ATC_texture 734 | #define GL_AMD_compressed_ATC_texture 1 735 | #endif 736 | 737 | /* AMD_performance_monitor */ 738 | #ifndef GL_AMD_performance_monitor 739 | #define GL_AMD_performance_monitor 1 740 | #ifdef GL_GLEXT_PROTOTYPES 741 | GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); 742 | GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); 743 | GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); 744 | GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); 745 | GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); 746 | GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); 747 | GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); 748 | GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); 749 | GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); 750 | GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); 751 | GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); 752 | #endif 753 | typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); 754 | typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); 755 | typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); 756 | typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); 757 | typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); 758 | typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); 759 | typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); 760 | typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); 761 | typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); 762 | typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); 763 | typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); 764 | #endif 765 | 766 | /* GL_AMD_program_binary_Z400 */ 767 | #ifndef GL_AMD_program_binary_Z400 768 | #define GL_AMD_program_binary_Z400 1 769 | #endif 770 | 771 | /*------------------------------------------------------------------------* 772 | * ANGLE extension functions 773 | *------------------------------------------------------------------------*/ 774 | 775 | /* GL_ANGLE_framebuffer_blit */ 776 | #ifndef GL_ANGLE_framebuffer_blit 777 | #define GL_ANGLE_framebuffer_blit 1 778 | #ifdef GL_GLEXT_PROTOTYPES 779 | GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 780 | #endif 781 | typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 782 | #endif 783 | 784 | /* GL_ANGLE_framebuffer_multisample */ 785 | #ifndef GL_ANGLE_framebuffer_multisample 786 | #define GL_ANGLE_framebuffer_multisample 1 787 | #ifdef GL_GLEXT_PROTOTYPES 788 | GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); 789 | #endif 790 | typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); 791 | #endif 792 | 793 | /*------------------------------------------------------------------------* 794 | * APPLE extension functions 795 | *------------------------------------------------------------------------*/ 796 | 797 | /* GL_APPLE_rgb_422 */ 798 | #ifndef GL_APPLE_rgb_422 799 | #define GL_APPLE_rgb_422 1 800 | #endif 801 | 802 | /* GL_APPLE_framebuffer_multisample */ 803 | #ifndef GL_APPLE_framebuffer_multisample 804 | #define GL_APPLE_framebuffer_multisample 1 805 | #ifdef GL_GLEXT_PROTOTYPES 806 | GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei); 807 | GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); 808 | #endif /* GL_GLEXT_PROTOTYPES */ 809 | typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); 810 | typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); 811 | #endif 812 | 813 | /* GL_APPLE_texture_format_BGRA8888 */ 814 | #ifndef GL_APPLE_texture_format_BGRA8888 815 | #define GL_APPLE_texture_format_BGRA8888 1 816 | #endif 817 | 818 | /* GL_APPLE_texture_max_level */ 819 | #ifndef GL_APPLE_texture_max_level 820 | #define GL_APPLE_texture_max_level 1 821 | #endif 822 | 823 | /*------------------------------------------------------------------------* 824 | * ARM extension functions 825 | *------------------------------------------------------------------------*/ 826 | 827 | /* GL_ARM_mali_shader_binary */ 828 | #ifndef GL_ARM_mali_shader_binary 829 | #define GL_ARM_mali_shader_binary 1 830 | #endif 831 | 832 | /* GL_ARM_rgba8 */ 833 | #ifndef GL_ARM_rgba8 834 | #define GL_ARM_rgba8 1 835 | #endif 836 | 837 | /*------------------------------------------------------------------------* 838 | * EXT extension functions 839 | *------------------------------------------------------------------------*/ 840 | 841 | /* GL_EXT_blend_minmax */ 842 | #ifndef GL_EXT_blend_minmax 843 | #define GL_EXT_blend_minmax 1 844 | #endif 845 | 846 | /* GL_EXT_discard_framebuffer */ 847 | #ifndef GL_EXT_discard_framebuffer 848 | #define GL_EXT_discard_framebuffer 1 849 | #ifdef GL_GLEXT_PROTOTYPES 850 | GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); 851 | #endif 852 | typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); 853 | #endif 854 | 855 | #ifndef GL_EXT_multi_draw_arrays 856 | #define GL_EXT_multi_draw_arrays 1 857 | #ifdef GL_GLEXT_PROTOTYPES 858 | GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); 859 | GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); 860 | #endif /* GL_GLEXT_PROTOTYPES */ 861 | typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); 862 | typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); 863 | #endif 864 | 865 | /* GL_EXT_read_format_bgra */ 866 | #ifndef GL_EXT_read_format_bgra 867 | #define GL_EXT_read_format_bgra 1 868 | #endif 869 | 870 | /* GL_EXT_shader_texture_lod */ 871 | #ifndef GL_EXT_shader_texture_lod 872 | #define GL_EXT_shader_texture_lod 1 873 | #endif 874 | 875 | /* GL_EXT_texture_filter_anisotropic */ 876 | #ifndef GL_EXT_texture_filter_anisotropic 877 | #define GL_EXT_texture_filter_anisotropic 1 878 | #endif 879 | 880 | /* GL_EXT_texture_format_BGRA8888 */ 881 | #ifndef GL_EXT_texture_format_BGRA8888 882 | #define GL_EXT_texture_format_BGRA8888 1 883 | #endif 884 | 885 | /* GL_EXT_texture_type_2_10_10_10_REV */ 886 | #ifndef GL_EXT_texture_type_2_10_10_10_REV 887 | #define GL_EXT_texture_type_2_10_10_10_REV 1 888 | #endif 889 | 890 | /* GL_EXT_texture_compression_dxt1 */ 891 | #ifndef GL_EXT_texture_compression_dxt1 892 | #define GL_EXT_texture_compression_dxt1 1 893 | #endif 894 | 895 | /* GL_EXT_unpack_subimage */ 896 | #ifndef GL_EXT_unpack_subimage 897 | #define GL_EXT_unpack_subimage 1 898 | #endif 899 | 900 | /*------------------------------------------------------------------------* 901 | * DMP extension functions 902 | *------------------------------------------------------------------------*/ 903 | 904 | /* GL_DMP_shader_binary */ 905 | #ifndef GL_DMP_shader_binary 906 | #define GL_DMP_shader_binary 1 907 | #endif 908 | 909 | /*------------------------------------------------------------------------* 910 | * IMG extension functions 911 | *------------------------------------------------------------------------*/ 912 | 913 | /* GL_IMG_program_binary */ 914 | #ifndef GL_IMG_program_binary 915 | #define GL_IMG_program_binary 1 916 | #endif 917 | 918 | /* GL_IMG_read_format */ 919 | #ifndef GL_IMG_read_format 920 | #define GL_IMG_read_format 1 921 | #endif 922 | 923 | /* GL_IMG_shader_binary */ 924 | #ifndef GL_IMG_shader_binary 925 | #define GL_IMG_shader_binary 1 926 | #endif 927 | 928 | /* GL_IMG_texture_compression_pvrtc */ 929 | #ifndef GL_IMG_texture_compression_pvrtc 930 | #define GL_IMG_texture_compression_pvrtc 1 931 | #endif 932 | 933 | /* GL_IMG_multisampled_render_to_texture */ 934 | #ifndef GL_IMG_multisampled_render_to_texture 935 | #define GL_IMG_multisampled_render_to_texture 1 936 | #ifdef GL_GLEXT_PROTOTYPES 937 | GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei); 938 | GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); 939 | #endif 940 | typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); 941 | typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); 942 | #endif 943 | 944 | /*------------------------------------------------------------------------* 945 | * NV extension functions 946 | *------------------------------------------------------------------------*/ 947 | 948 | /* GL_NV_coverage_sample */ 949 | #ifndef GL_NV_coverage_sample 950 | #define GL_NV_coverage_sample 1 951 | #ifdef GL_GLEXT_PROTOTYPES 952 | GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); 953 | GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); 954 | #endif 955 | typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); 956 | typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); 957 | #endif 958 | 959 | /* GL_NV_depth_nonlinear */ 960 | #ifndef GL_NV_depth_nonlinear 961 | #define GL_NV_depth_nonlinear 1 962 | #endif 963 | 964 | /* GL_NV_draw_buffers */ 965 | #ifndef GL_NV_draw_buffers 966 | #define GL_NV_draw_buffers 1 967 | #ifdef GL_GLEXT_PROTOTYPES 968 | GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); 969 | #endif 970 | typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); 971 | #endif 972 | 973 | /* GL_NV_fbo_color_attachments */ 974 | #ifndef GL_NV_fbo_color_attachments 975 | #define GL_NV_fbo_color_attachments 1 976 | #endif 977 | 978 | /* GL_NV_fence */ 979 | #ifndef GL_NV_fence 980 | #define GL_NV_fence 1 981 | #ifdef GL_GLEXT_PROTOTYPES 982 | GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); 983 | GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *); 984 | GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint); 985 | GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint); 986 | GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); 987 | GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint); 988 | GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum); 989 | #endif 990 | typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); 991 | typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); 992 | typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); 993 | typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); 994 | typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); 995 | typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); 996 | typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); 997 | #endif 998 | 999 | /* GL_NV_read_buffer */ 1000 | #ifndef GL_NV_read_buffer 1001 | #define GL_NV_read_buffer 1 1002 | #ifdef GL_GLEXT_PROTOTYPES 1003 | GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); 1004 | #endif 1005 | typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); 1006 | #endif 1007 | 1008 | /* GL_NV_read_buffer_front */ 1009 | #ifndef GL_NV_read_buffer_front 1010 | #define GL_NV_read_buffer_front 1 1011 | #endif 1012 | 1013 | /* GL_NV_read_depth */ 1014 | #ifndef GL_NV_read_depth 1015 | #define GL_NV_read_depth 1 1016 | #endif 1017 | 1018 | /* GL_NV_read_depth_stencil */ 1019 | #ifndef GL_NV_read_depth_stencil 1020 | #define GL_NV_read_depth_stencil 1 1021 | #endif 1022 | 1023 | /* GL_NV_read_stencil */ 1024 | #ifndef GL_NV_read_stencil 1025 | #define GL_NV_read_stencil 1 1026 | #endif 1027 | 1028 | /* GL_NV_texture_compression_s3tc_update */ 1029 | #ifndef GL_NV_texture_compression_s3tc_update 1030 | #define GL_NV_texture_compression_s3tc_update 1 1031 | #endif 1032 | 1033 | /* GL_NV_texture_npot_2D_mipmap */ 1034 | #ifndef GL_NV_texture_npot_2D_mipmap 1035 | #define GL_NV_texture_npot_2D_mipmap 1 1036 | #endif 1037 | 1038 | /*------------------------------------------------------------------------* 1039 | * QCOM extension functions 1040 | *------------------------------------------------------------------------*/ 1041 | 1042 | /* GL_QCOM_alpha_test */ 1043 | #ifndef GL_QCOM_alpha_test 1044 | #define GL_QCOM_alpha_test 1 1045 | #ifdef GL_GLEXT_PROTOTYPES 1046 | GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); 1047 | #endif 1048 | typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); 1049 | #endif 1050 | 1051 | /* GL_QCOM_driver_control */ 1052 | #ifndef GL_QCOM_driver_control 1053 | #define GL_QCOM_driver_control 1 1054 | #ifdef GL_GLEXT_PROTOTYPES 1055 | GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); 1056 | GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); 1057 | GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); 1058 | GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); 1059 | #endif 1060 | typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); 1061 | typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); 1062 | typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); 1063 | typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); 1064 | #endif 1065 | 1066 | /* GL_QCOM_extended_get */ 1067 | #ifndef GL_QCOM_extended_get 1068 | #define GL_QCOM_extended_get 1 1069 | #ifdef GL_GLEXT_PROTOTYPES 1070 | GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); 1071 | GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); 1072 | GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); 1073 | GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); 1074 | GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); 1075 | GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); 1076 | GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); 1077 | GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); 1078 | #endif 1079 | typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); 1080 | typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); 1081 | typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); 1082 | typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); 1083 | typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); 1084 | typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); 1085 | typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); 1086 | typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); 1087 | #endif 1088 | 1089 | /* GL_QCOM_extended_get2 */ 1090 | #ifndef GL_QCOM_extended_get2 1091 | #define GL_QCOM_extended_get2 1 1092 | #ifdef GL_GLEXT_PROTOTYPES 1093 | GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); 1094 | GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); 1095 | GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); 1096 | GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); 1097 | #endif 1098 | typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); 1099 | typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); 1100 | typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); 1101 | typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); 1102 | #endif 1103 | 1104 | /* GL_QCOM_perfmon_global_mode */ 1105 | #ifndef GL_QCOM_perfmon_global_mode 1106 | #define GL_QCOM_perfmon_global_mode 1 1107 | #endif 1108 | 1109 | /* GL_QCOM_writeonly_rendering */ 1110 | #ifndef GL_QCOM_writeonly_rendering 1111 | #define GL_QCOM_writeonly_rendering 1 1112 | #endif 1113 | 1114 | /* GL_QCOM_tiled_rendering */ 1115 | #ifndef GL_QCOM_tiled_rendering 1116 | #define GL_QCOM_tiled_rendering 1 1117 | #ifdef GL_GLEXT_PROTOTYPES 1118 | GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); 1119 | GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); 1120 | #endif 1121 | typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); 1122 | typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); 1123 | #endif 1124 | 1125 | /*------------------------------------------------------------------------* 1126 | * VIV extension tokens 1127 | *------------------------------------------------------------------------*/ 1128 | 1129 | /* GL_VIV_shader_binary */ 1130 | #ifndef GL_VIV_shader_binary 1131 | #define GL_VIV_shader_binary 1 1132 | #endif 1133 | 1134 | #ifdef __cplusplus 1135 | } 1136 | #endif 1137 | 1138 | #endif /* __gl2ext_h_ */ 1139 | -------------------------------------------------------------------------------- /GLES2/gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | #include 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Raspberry Pi 3d demo. 2 | 3 | This uses the EGL and OpenGLES libraries to draw 3d graphics from inside Python with hardware acceleration. 4 | 5 | USAGE 6 | 7 | EXAMPLE A) Draw a Mandelbrot. Use mouse to scroll and view Julia sets. Press mouse button to quit. 8 | 9 | python -i pyopengles.py 10 | Press ctrl-D to quit Python and close the display 11 | 12 | (If nothing appears on the screen make sure you have at least 64megabytes allocated for the GPU.) 13 | 14 | 15 | EXAMPLE B) Use standard OpenGLES commands 16 | 17 | from pyopengles import * 18 | egl = EGL() 19 | # Normal OpenGLES commands 20 | opengles.glClearColor ( eglfloat(0.0), eglfloat(1.0), eglfloat(1.0), eglfloat(1.0) ); 21 | opengles.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 22 | # Send this to make the graphics drawn visible 23 | openegl.eglSwapBuffers(egl.display, egl.surface) 24 | 25 | 26 | 27 | EXAMPLE C) Draw a rotating coloured cone on the screen. Press mouse button to quit. 28 | 29 | python cone.py 30 | -------------------------------------------------------------------------------- /cone.py: -------------------------------------------------------------------------------- 1 | import itertools 2 | from pyopengles import * 3 | from math import * 4 | 5 | def eglshorts(L): 6 | """Converts a tuple to an array of eglshorts (would a pointer return be better?)""" 7 | return (eglshort*len(L))(*L) 8 | 9 | class Buffer(object): 10 | """Hold a pair of Buffer Objects to draw a part of a model""" 11 | def __init__(self,pts,faces): 12 | """Generate a vertex buffer to hold data and indices""" 13 | pts=[tuple(p) for p in pts] 14 | normals=[[] for p in pts] 15 | for f in faces: 16 | a,b,c=f[0:3] 17 | n=tuple(vec_normal(vec_cross(vec_sub(pts[b],pts[a]),vec_sub(pts[c],pts[a])))) 18 | for x in f[0:3]: 19 | normals[x].append(n) 20 | for i,N in enumerate(normals): 21 | if len(N)==0: 22 | normals[i]=(0,0,.01) 23 | continue 24 | s=1.0/len(N) 25 | normals[i]=tuple( vec_normal( [sum(v[k] for v in N) for k in range(3)] ) ) 26 | P=[ p+n for p,n in zip(pts,normals)] 27 | X=eglfloats([x for x in itertools.chain(*P)]) 28 | 29 | P=[f[0:3] for f in faces] 30 | E=eglshorts([x for x in itertools.chain(*P)]) 31 | 32 | self.vbuf=eglint() 33 | opengles.glGenBuffers(1,ctypes.byref(self.vbuf)) 34 | self.ebuf=eglint() 35 | opengles.glGenBuffers(1,ctypes.byref(self.ebuf)) 36 | self.select() 37 | opengles.glBufferData(GL_ARRAY_BUFFER, ctypes.sizeof(X), ctypes.byref(X), GL_STATIC_DRAW); 38 | opengles.glBufferData(GL_ELEMENT_ARRAY_BUFFER, ctypes.sizeof(E), ctypes.byref(E), GL_STATIC_DRAW); 39 | self.ntris = len(faces) 40 | 41 | def select(self): 42 | """Makes our buffers active""" 43 | opengles.glBindBuffer(GL_ARRAY_BUFFER, self.vbuf); 44 | opengles.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, self.ebuf); 45 | 46 | def draw(self,s): 47 | self.select() 48 | opengles.glVertexAttribPointer(s.attr_normal, 3, GL_FLOAT, 0, 24, 12); 49 | opengles.glVertexAttribPointer(s.attr_vertex, 3, GL_FLOAT, 0, 24, 0); 50 | opengles.glEnableVertexAttribArray(s.attr_normal); 51 | opengles.glEnableVertexAttribArray(s.attr_vertex); 52 | opengles.glDrawElements ( GL_TRIANGLES, self.ntris*3, GL_UNSIGNED_SHORT, 0 ); 53 | 54 | 55 | class Shader(object): 56 | def __init__(self): 57 | """Prepares a shader for 3d point + normal""" 58 | 59 | self.vshader_source = ctypes.c_char_p( 60 | """ 61 | attribute vec3 vertex; 62 | attribute vec3 normal; 63 | uniform mat4 view; 64 | varying vec3 n; 65 | void main(void) { 66 | //light = 0.5+max(0.0,0.5*dot(normal,vec3(0.7,0,0.7))); 67 | n=normal; 68 | gl_Position = view * vec4(vertex,1.0); 69 | }""") 70 | 71 | self.fshader_source = ctypes.c_char_p( 72 | """ 73 | varying vec3 n; 74 | void main(void) { 75 | gl_FragColor = vec4(n.x+0.5,n.y+0.5,n.z+0.5,1.0); 76 | }""") 77 | 78 | vshader = opengles.glCreateShader(GL_VERTEX_SHADER); 79 | opengles.glShaderSource(vshader, 1, ctypes.byref(self.vshader_source), 0) 80 | opengles.glCompileShader(vshader); 81 | self.showlog(vshader) 82 | 83 | fshader = opengles.glCreateShader(GL_FRAGMENT_SHADER); 84 | opengles.glShaderSource(fshader, 1, ctypes.byref(self.fshader_source), 0); 85 | opengles.glCompileShader(fshader); 86 | self.showlog(fshader); 87 | 88 | program = opengles.glCreateProgram(); 89 | opengles.glAttachShader(program, vshader); 90 | opengles.glAttachShader(program, fshader); 91 | opengles.glLinkProgram(program); 92 | self.showprogramlog(program); 93 | 94 | self.program = program 95 | self.attr_vertex = opengles.glGetAttribLocation(program, "vertex"); 96 | self.attr_normal = opengles.glGetAttribLocation(program, "normal"); 97 | self.unif_view = opengles.glGetUniformLocation(program, "view"); 98 | self.select() 99 | 100 | def select(self): 101 | """Makes this shader active""" 102 | opengles.glUseProgram ( self.program ); 103 | 104 | def select_view(self,M,M_reflect=None): 105 | """Call this to program the view matrix. 106 | """ 107 | E=eglfloats(list(itertools.chain(*M))) 108 | opengles.glUniformMatrix4fv(self.unif_view,16,eglint(0),ctypes.byref(E)); 109 | 110 | def showlog(self,shader): 111 | """Prints the compile log for a shader""" 112 | N=1024 113 | log=(ctypes.c_char*N)() 114 | loglen=ctypes.c_int() 115 | opengles.glGetShaderInfoLog(shader,N,ctypes.byref(loglen),ctypes.byref(log)) 116 | print log.value 117 | 118 | def showprogramlog(self,shader): 119 | """Prints the compile log for a program""" 120 | N=1024 121 | log=(ctypes.c_char*N)() 122 | loglen=ctypes.c_int() 123 | opengles.glGetProgramInfoLog(shader,N,ctypes.byref(loglen),ctypes.byref(log)) 124 | print log.value 125 | 126 | class View(object): 127 | """The view holds the perspective transformations for the current view. 128 | Call lookAt to set the camera. 129 | Call begin_matrix to start a new view based on this perspective, then translate or rotate to set up transform. 130 | Can use view.V to access the matrix representing the current transform""" 131 | 132 | def lookAt(self,at,eye): 133 | """Set up view matrix to look from eye to at including perspective""" 134 | self.L=LookAtMatrix(at,eye) 135 | self.P=ProjectionMatrix() 136 | self.M=mat_mult(self.L,self.P) # Apply transform/rotation first, then shift into perspective space 137 | self.L_reflect=LookAtMatrix(at,eye,reflect=True) 138 | self.M_reflect=mat_mult(self.L_reflect,self.P) 139 | 140 | def begin_matrix(self): 141 | self.V = [row[:] for row in self.M] 142 | 143 | def translate(self,pt): 144 | """Move an object to the given location""" 145 | V=self.V 146 | V[3]=[sum(pt[j]*V[j][i] for j in xrange(3))+V[3][i] for i in xrange(4)] 147 | 148 | def rotate(self,angle): 149 | """Rotate an object by an angle in degrees""" 150 | c=math.cos(angle*3.1415/180.0) 151 | s=math.sin(angle*3.1415/180.0) 152 | M=[[c,s,0,0],[-s,c,0,0],[0,0,1,0],[0,0,0,1]] 153 | self.V=mat_mult(M,self.V) 154 | 155 | class Cone: 156 | 157 | def __init__(self,sz=20.0,numsides=20): 158 | """Prepares vertices and faces for a cone. Both sides of each face are drawn""" 159 | pts = [] 160 | faces = [] 161 | for a in range(numsides): 162 | x=sz*math.sin(2*3.14159*a/numsides) 163 | y=sz*math.cos(2*3.14159*a/numsides) 164 | pts.append((x,y,0)) 165 | faces.append((numsides,(a+1)%numsides,a)) 166 | pts.append((0.0,0.0,sz)) 167 | self.buf=Buffer(pts,faces) 168 | self.pts=pts 169 | self.faces=faces 170 | 171 | def draw(self,s): 172 | self.buf.draw(s) 173 | 174 | def TranslateMatrix(pt): 175 | M=[[0]*4 for i in range(4)] 176 | for i in range(4): 177 | M[i][i]=1.0 178 | for i in range(3): 179 | M[3][i]=pt[i] 180 | return M 181 | 182 | def ProjectionMatrix(near=10,far=1000.0,fov_h=1.7,fov_v=1.4): 183 | """Setup projection matrix with given distance to near and far planes 184 | and fields of view in radians""" 185 | # Matrices are considered to be M[row][col] 186 | # Use DirectX convention, so need to do rowvec*Matrix to transform 187 | w=1./tan(fov_h*0.5) 188 | h=1./tan(fov_v*0.5) 189 | Q=far/(far-near) 190 | M=[[0]*4 for i in range(4)] 191 | M[0][0]=w 192 | M[1][1]=h 193 | M[2][2]=Q 194 | M[3][2]=-Q*near 195 | M[2][3]=1 196 | return M 197 | 198 | def vec_sub(A,B): 199 | return [a-b for a,b in zip(A,B)] 200 | 201 | def vec_dot(A,B): 202 | return sum(a*b for a,b in zip(A,B)) 203 | 204 | def vec_cross(a,b): 205 | return [a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]] 206 | 207 | def vec_normal(A): 208 | n=math.sqrt(sum(a**2 for a in A))+0.0001 209 | return [a/n for a in A] 210 | 211 | def LookAtMatrix(at,eye,up=[0,0,1],reflect=False): 212 | """Define a matrix of an eye looking at""" 213 | # If reflect, then reflect in plane -20.0 (water depth) 214 | if reflect: 215 | depth=-20.0 # Shallower to avoid edge effects 216 | eye[2]=2*depth-eye[2] 217 | at[2]=2*depth-at[2] 218 | zaxis = vec_normal(vec_sub(at,eye)) 219 | xaxis = vec_normal(vec_cross(up,zaxis)) 220 | yaxis = vec_cross(zaxis,xaxis) 221 | xaxis.append(-vec_dot(xaxis,eye)) 222 | yaxis.append(-vec_dot(yaxis,eye)) 223 | zaxis.append(-vec_dot(zaxis,eye)) 224 | z=[0,0,0,1.0] 225 | return [ [xaxis[a],yaxis[a],zaxis[a],z[a]] for a in range(4)] 226 | 227 | def BillboardMatrix(): 228 | """Define a matrix that copies x,y and sets z to 0.9""" 229 | return [ [1.0,0.0,0.0,0.0],[0.0,1.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.9,1.0]] 230 | 231 | def mat_mult(A,B): 232 | return [ [ sum(A[i][j]*B[j][k] for j in range(4)) for k in range(4)] for i in range(4)] 233 | 234 | def mat_transpose(A): 235 | return [ [ A[k][i] for k in range(4)] for i in range(4)] 236 | 237 | def vec_mat_mult(A,B): 238 | return [ sum(A[j]*B[j][k] for j in range(4)) for k in range(4)] 239 | 240 | 241 | egl = EGL() 242 | cone = Cone(50); 243 | s = Shader() 244 | v = View() 245 | opengles.glViewport ( 0, 0, egl.width, egl.height ); 246 | opengles.glDepthRangef(eglfloat(-1.0),eglfloat(1.0)) 247 | opengles.glClearColor ( eglfloat(0.3), eglfloat(0.3), eglfloat(0.7), eglfloat(1.0) ); 248 | opengles.glBindFramebuffer(GL_FRAMEBUFFER,0) 249 | opengles.glFrontFace(GL_CW) 250 | opengles.glCullFace(GL_BACK) 251 | opengles.glEnable(GL_CULL_FACE) 252 | opengles.glEnable(GL_DEPTH_TEST) 253 | 254 | print 'Setup viewport' 255 | v.lookAt([0,0,0],[0,-100,50]) 256 | 257 | from pymouse import start_mouse 258 | 259 | m=start_mouse() 260 | 261 | frame=0 262 | def draw(s): 263 | global frame 264 | frame+=1 265 | 266 | opengles.glBindFramebuffer(GL_FRAMEBUFFER,0) 267 | opengles.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 268 | s.select() 269 | s.select_view(v.M) 270 | v.begin_matrix() 271 | v.rotate(frame*2) 272 | s.select_view(v.V) 273 | cone.draw(s) 274 | opengles.glFinish() 275 | openegl.eglSwapBuffers(egl.display, egl.surface) 276 | 277 | while 1: 278 | if m.finished: 279 | break 280 | draw(s) 281 | 282 | m.stop() 283 | -------------------------------------------------------------------------------- /egl.py: -------------------------------------------------------------------------------- 1 | EGL_SUCCESS = 0x3000 2 | EGL_NOT_INITIALIZED = 0x3001 3 | EGL_BAD_ACCESS = 0x3002 4 | EGL_BAD_ALLOC = 0x3003 5 | EGL_BAD_ATTRIBUTE = 0x3004 6 | EGL_BAD_CONFIG = 0x3005 7 | EGL_BAD_CONTEXT = 0x3006 8 | EGL_BAD_CURRENT_SURFACE = 0x3007 9 | EGL_BAD_DISPLAY = 0x3008 10 | EGL_BAD_MATCH = 0x3009 11 | EGL_BAD_NATIVE_PIXMAP = 0x300A 12 | EGL_BAD_NATIVE_WINDOW = 0x300B 13 | EGL_BAD_PARAMETER = 0x300C 14 | EGL_BAD_SURFACE = 0x300D 15 | EGL_CONTEXT_LOST = 0x300E 16 | EGL_BUFFER_SIZE = 0x3020 17 | EGL_ALPHA_SIZE = 0x3021 18 | EGL_BLUE_SIZE = 0x3022 19 | EGL_GREEN_SIZE = 0x3023 20 | EGL_RED_SIZE = 0x3024 21 | EGL_DEPTH_SIZE = 0x3025 22 | EGL_STENCIL_SIZE = 0x3026 23 | EGL_CONFIG_CAVEAT = 0x3027 24 | EGL_CONFIG_ID = 0x3028 25 | EGL_LEVEL = 0x3029 26 | EGL_MAX_PBUFFER_HEIGHT = 0x302A 27 | EGL_MAX_PBUFFER_PIXELS = 0x302B 28 | EGL_MAX_PBUFFER_WIDTH = 0x302C 29 | EGL_NATIVE_RENDERABLE = 0x302D 30 | EGL_NATIVE_VISUAL_ID = 0x302E 31 | EGL_NATIVE_VISUAL_TYPE = 0x302F 32 | EGL_SAMPLES = 0x3031 33 | EGL_SAMPLE_BUFFERS = 0x3032 34 | EGL_SURFACE_TYPE = 0x3033 35 | EGL_TRANSPARENT_TYPE = 0x3034 36 | EGL_TRANSPARENT_BLUE_VALUE = 0x3035 37 | EGL_TRANSPARENT_GREEN_VALUE = 0x3036 38 | EGL_TRANSPARENT_RED_VALUE = 0x3037 39 | EGL_NONE = 0x3038 40 | EGL_BIND_TO_TEXTURE_RGB = 0x3039 41 | EGL_BIND_TO_TEXTURE_RGBA = 0x303A 42 | EGL_MIN_SWAP_INTERVAL = 0x303B 43 | EGL_MAX_SWAP_INTERVAL = 0x303C 44 | EGL_LUMINANCE_SIZE = 0x303D 45 | EGL_ALPHA_MASK_SIZE = 0x303E 46 | EGL_COLOR_BUFFER_TYPE = 0x303F 47 | EGL_RENDERABLE_TYPE = 0x3040 48 | EGL_MATCH_NATIVE_PIXMAP = 0x3041 49 | EGL_CONFORMANT = 0x3042 50 | EGL_SLOW_CONFIG = 0x3050 51 | EGL_NON_CONFORMANT_CONFIG = 0x3051 52 | EGL_TRANSPARENT_RGB = 0x3052 53 | EGL_RGB_BUFFER = 0x308E 54 | EGL_LUMINANCE_BUFFER = 0x308F 55 | EGL_NO_TEXTURE = 0x305C 56 | EGL_TEXTURE_RGB = 0x305D 57 | EGL_TEXTURE_RGBA = 0x305E 58 | EGL_TEXTURE_2D = 0x305F 59 | EGL_PBUFFER_BIT = 0x0001 60 | EGL_PIXMAP_BIT = 0x0002 61 | EGL_WINDOW_BIT = 0x0004 62 | EGL_VG_COLORSPACE_LINEAR_BIT = 0x0020 63 | EGL_VG_ALPHA_FORMAT_PRE_BIT = 0x0040 64 | EGL_MULTISAMPLE_RESOLVE_BOX_BIT = 0x0200 65 | EGL_SWAP_BEHAVIOR_PRESERVED_BIT = 0x0400 66 | EGL_OPENGL_ES_BIT = 0x0001 67 | EGL_OPENVG_BIT = 0x0002 68 | EGL_OPENGL_ES2_BIT = 0x0004 69 | EGL_OPENGL_BIT = 0x0008 70 | EGL_VENDOR = 0x3053 71 | EGL_VERSION = 0x3054 72 | EGL_EXTENSIONS = 0x3055 73 | EGL_CLIENT_APIS = 0x308D 74 | EGL_HEIGHT = 0x3056 75 | EGL_WIDTH = 0x3057 76 | EGL_LARGEST_PBUFFER = 0x3058 77 | EGL_TEXTURE_FORMAT = 0x3080 78 | EGL_TEXTURE_TARGET = 0x3081 79 | EGL_MIPMAP_TEXTURE = 0x3082 80 | EGL_MIPMAP_LEVEL = 0x3083 81 | EGL_RENDER_BUFFER = 0x3086 82 | EGL_VG_COLORSPACE = 0x3087 83 | EGL_VG_ALPHA_FORMAT = 0x3088 84 | EGL_HORIZONTAL_RESOLUTION = 0x3090 85 | EGL_VERTICAL_RESOLUTION = 0x3091 86 | EGL_PIXEL_ASPECT_RATIO = 0x3092 87 | EGL_SWAP_BEHAVIOR = 0x3093 88 | EGL_MULTISAMPLE_RESOLVE = 0x3099 89 | EGL_BACK_BUFFER = 0x3084 90 | EGL_SINGLE_BUFFER = 0x3085 91 | EGL_VG_COLORSPACE_sRGB = 0x3089 92 | EGL_VG_COLORSPACE_LINEAR = 0x308A 93 | EGL_VG_ALPHA_FORMAT_NONPRE = 0x308B 94 | EGL_VG_ALPHA_FORMAT_PRE = 0x308C 95 | EGL_BUFFER_PRESERVED = 0x3094 96 | EGL_BUFFER_DESTROYED = 0x3095 97 | EGL_OPENVG_IMAGE = 0x3096 98 | EGL_CONTEXT_CLIENT_TYPE = 0x3097 99 | EGL_CONTEXT_CLIENT_VERSION = 0x3098 100 | EGL_MULTISAMPLE_RESOLVE_DEFAULT = 0x309A 101 | EGL_MULTISAMPLE_RESOLVE_BOX = 0x309B 102 | EGL_OPENGL_ES_API = 0x30A0 103 | EGL_OPENVG_API = 0x30A1 104 | EGL_OPENGL_API = 0x30A2 105 | EGL_DRAW = 0x3059 106 | EGL_READ = 0x305A 107 | EGL_CORE_NATIVE_ENGINE = 0x305B 108 | -------------------------------------------------------------------------------- /gl.py: -------------------------------------------------------------------------------- 1 | GL_DEPTH_BUFFER_BIT = 0x00000100 2 | GL_STENCIL_BUFFER_BIT = 0x00000400 3 | GL_COLOR_BUFFER_BIT = 0x00004000 4 | GL_POINTS = 0x0000 5 | GL_LINES = 0x0001 6 | GL_LINE_LOOP = 0x0002 7 | GL_LINE_STRIP = 0x0003 8 | GL_TRIANGLES = 0x0004 9 | GL_TRIANGLE_STRIP = 0x0005 10 | GL_TRIANGLE_FAN = 0x0006 11 | GL_NEVER = 0x0200 12 | GL_LESS = 0x0201 13 | GL_EQUAL = 0x0202 14 | GL_LEQUAL = 0x0203 15 | GL_GREATER = 0x0204 16 | GL_NOTEQUAL = 0x0205 17 | GL_GEQUAL = 0x0206 18 | GL_ALWAYS = 0x0207 19 | GL_SRC_COLOR = 0x0300 20 | GL_ONE_MINUS_SRC_COLOR = 0x0301 21 | GL_SRC_ALPHA = 0x0302 22 | GL_ONE_MINUS_SRC_ALPHA = 0x0303 23 | GL_DST_ALPHA = 0x0304 24 | GL_ONE_MINUS_DST_ALPHA = 0x0305 25 | GL_DST_COLOR = 0x0306 26 | GL_ONE_MINUS_DST_COLOR = 0x0307 27 | GL_SRC_ALPHA_SATURATE = 0x0308 28 | GL_CLIP_PLANE0 = 0x3000 29 | GL_CLIP_PLANE1 = 0x3001 30 | GL_CLIP_PLANE2 = 0x3002 31 | GL_CLIP_PLANE3 = 0x3003 32 | GL_CLIP_PLANE4 = 0x3004 33 | GL_CLIP_PLANE5 = 0x3005 34 | GL_FRONT = 0x0404 35 | GL_BACK = 0x0405 36 | GL_FRONT_AND_BACK = 0x0408 37 | GL_FOG = 0x0B60 38 | GL_LIGHTING = 0x0B50 39 | GL_TEXTURE_2D = 0x0DE1 40 | GL_CULL_FACE = 0x0B44 41 | GL_ALPHA_TEST = 0x0BC0 42 | GL_BLEND = 0x0BE2 43 | GL_COLOR_LOGIC_OP = 0x0BF2 44 | GL_DITHER = 0x0BD0 45 | GL_STENCIL_TEST = 0x0B90 46 | GL_DEPTH_TEST = 0x0B71 47 | GL_POINT_SMOOTH = 0x0B10 48 | GL_LINE_SMOOTH = 0x0B20 49 | GL_SCISSOR_TEST = 0x0C11 50 | GL_COLOR_MATERIAL = 0x0B57 51 | GL_NORMALIZE = 0x0BA1 52 | GL_RESCALE_NORMAL = 0x803A 53 | GL_POLYGON_OFFSET_FILL = 0x8037 54 | GL_VERTEX_ARRAY = 0x8074 55 | GL_NORMAL_ARRAY = 0x8075 56 | GL_COLOR_ARRAY = 0x8076 57 | GL_TEXTURE_COORD_ARRAY = 0x8078 58 | GL_MULTISAMPLE = 0x809D 59 | GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E 60 | GL_SAMPLE_ALPHA_TO_ONE = 0x809F 61 | GL_SAMPLE_COVERAGE = 0x80A0 62 | GL_INVALID_ENUM = 0x0500 63 | GL_INVALID_VALUE = 0x0501 64 | GL_INVALID_OPERATION = 0x0502 65 | GL_STACK_OVERFLOW = 0x0503 66 | GL_STACK_UNDERFLOW = 0x0504 67 | GL_OUT_OF_MEMORY = 0x0505 68 | GL_EXP = 0x0800 69 | GL_EXP2 = 0x0801 70 | GL_FOG_DENSITY = 0x0B62 71 | GL_FOG_START = 0x0B63 72 | GL_FOG_END = 0x0B64 73 | GL_FOG_MODE = 0x0B65 74 | GL_FOG_COLOR = 0x0B66 75 | GL_CW = 0x0900 76 | GL_CCW = 0x0901 77 | GL_CURRENT_COLOR = 0x0B00 78 | GL_CURRENT_NORMAL = 0x0B02 79 | GL_CURRENT_TEXTURE_COORDS = 0x0B03 80 | GL_POINT_SIZE = 0x0B11 81 | GL_POINT_SIZE_MIN = 0x8126 82 | GL_POINT_SIZE_MAX = 0x8127 83 | GL_POINT_FADE_THRESHOLD_SIZE = 0x8128 84 | GL_POINT_DISTANCE_ATTENUATION = 0x8129 85 | GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12 86 | GL_LINE_WIDTH = 0x0B21 87 | GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22 88 | GL_ALIASED_POINT_SIZE_RANGE = 0x846D 89 | GL_ALIASED_LINE_WIDTH_RANGE = 0x846E 90 | GL_CULL_FACE_MODE = 0x0B45 91 | GL_FRONT_FACE = 0x0B46 92 | GL_SHADE_MODEL = 0x0B54 93 | GL_DEPTH_RANGE = 0x0B70 94 | GL_DEPTH_WRITEMASK = 0x0B72 95 | GL_DEPTH_CLEAR_VALUE = 0x0B73 96 | GL_DEPTH_FUNC = 0x0B74 97 | GL_STENCIL_CLEAR_VALUE = 0x0B91 98 | GL_STENCIL_FUNC = 0x0B92 99 | GL_STENCIL_VALUE_MASK = 0x0B93 100 | GL_STENCIL_FAIL = 0x0B94 101 | GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95 102 | GL_STENCIL_PASS_DEPTH_PASS = 0x0B96 103 | GL_STENCIL_REF = 0x0B97 104 | GL_STENCIL_WRITEMASK = 0x0B98 105 | GL_MATRIX_MODE = 0x0BA0 106 | GL_VIEWPORT = 0x0BA2 107 | GL_MODELVIEW_STACK_DEPTH = 0x0BA3 108 | GL_PROJECTION_STACK_DEPTH = 0x0BA4 109 | GL_TEXTURE_STACK_DEPTH = 0x0BA5 110 | GL_MODELVIEW_MATRIX = 0x0BA6 111 | GL_PROJECTION_MATRIX = 0x0BA7 112 | GL_TEXTURE_MATRIX = 0x0BA8 113 | GL_ALPHA_TEST_FUNC = 0x0BC1 114 | GL_ALPHA_TEST_REF = 0x0BC2 115 | GL_BLEND_DST = 0x0BE0 116 | GL_BLEND_SRC = 0x0BE1 117 | GL_LOGIC_OP_MODE = 0x0BF0 118 | GL_SCISSOR_BOX = 0x0C10 119 | GL_SCISSOR_TEST = 0x0C11 120 | GL_COLOR_CLEAR_VALUE = 0x0C22 121 | GL_COLOR_WRITEMASK = 0x0C23 122 | GL_UNPACK_ALIGNMENT = 0x0CF5 123 | GL_PACK_ALIGNMENT = 0x0D05 124 | GL_MAX_LIGHTS = 0x0D31 125 | GL_MAX_CLIP_PLANES = 0x0D32 126 | GL_MAX_TEXTURE_SIZE = 0x0D33 127 | GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36 128 | GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38 129 | GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39 130 | GL_MAX_VIEWPORT_DIMS = 0x0D3A 131 | GL_MAX_TEXTURE_UNITS = 0x84E2 132 | GL_SUBPIXEL_BITS = 0x0D50 133 | GL_RED_BITS = 0x0D52 134 | GL_GREEN_BITS = 0x0D53 135 | GL_BLUE_BITS = 0x0D54 136 | GL_ALPHA_BITS = 0x0D55 137 | GL_DEPTH_BITS = 0x0D56 138 | GL_STENCIL_BITS = 0x0D57 139 | GL_POLYGON_OFFSET_UNITS = 0x2A00 140 | GL_POLYGON_OFFSET_FILL = 0x8037 141 | GL_POLYGON_OFFSET_FACTOR = 0x8038 142 | GL_TEXTURE_BINDING_2D = 0x8069 143 | GL_VERTEX_ARRAY_SIZE = 0x807A 144 | GL_VERTEX_ARRAY_TYPE = 0x807B 145 | GL_VERTEX_ARRAY_STRIDE = 0x807C 146 | GL_NORMAL_ARRAY_TYPE = 0x807E 147 | GL_NORMAL_ARRAY_STRIDE = 0x807F 148 | GL_COLOR_ARRAY_SIZE = 0x8081 149 | GL_COLOR_ARRAY_TYPE = 0x8082 150 | GL_COLOR_ARRAY_STRIDE = 0x8083 151 | GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088 152 | GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089 153 | GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A 154 | GL_VERTEX_ARRAY_POINTER = 0x808E 155 | GL_NORMAL_ARRAY_POINTER = 0x808F 156 | GL_COLOR_ARRAY_POINTER = 0x8090 157 | GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092 158 | GL_SAMPLE_BUFFERS = 0x80A8 159 | GL_SAMPLES = 0x80A9 160 | GL_SAMPLE_COVERAGE_VALUE = 0x80AA 161 | GL_SAMPLE_COVERAGE_INVERT = 0x80AB 162 | GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2 163 | GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3 164 | GL_DONT_CARE = 0x1100 165 | GL_FASTEST = 0x1101 166 | GL_NICEST = 0x1102 167 | GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50 168 | GL_POINT_SMOOTH_HINT = 0x0C51 169 | GL_LINE_SMOOTH_HINT = 0x0C52 170 | GL_FOG_HINT = 0x0C54 171 | GL_GENERATE_MIPMAP_HINT = 0x8192 172 | GL_LIGHT_MODEL_AMBIENT = 0x0B53 173 | GL_LIGHT_MODEL_TWO_SIDE = 0x0B52 174 | GL_AMBIENT = 0x1200 175 | GL_DIFFUSE = 0x1201 176 | GL_SPECULAR = 0x1202 177 | GL_POSITION = 0x1203 178 | GL_SPOT_DIRECTION = 0x1204 179 | GL_SPOT_EXPONENT = 0x1205 180 | GL_SPOT_CUTOFF = 0x1206 181 | GL_CONSTANT_ATTENUATION = 0x1207 182 | GL_LINEAR_ATTENUATION = 0x1208 183 | GL_QUADRATIC_ATTENUATION = 0x1209 184 | GL_BYTE = 0x1400 185 | GL_UNSIGNED_BYTE = 0x1401 186 | GL_SHORT = 0x1402 187 | GL_UNSIGNED_SHORT = 0x1403 188 | GL_FLOAT = 0x1406 189 | GL_FIXED = 0x140C 190 | GL_CLEAR = 0x1500 191 | GL_AND = 0x1501 192 | GL_AND_REVERSE = 0x1502 193 | GL_COPY = 0x1503 194 | GL_AND_INVERTED = 0x1504 195 | GL_NOOP = 0x1505 196 | GL_XOR = 0x1506 197 | GL_OR = 0x1507 198 | GL_NOR = 0x1508 199 | GL_EQUIV = 0x1509 200 | GL_INVERT = 0x150A 201 | GL_OR_REVERSE = 0x150B 202 | GL_COPY_INVERTED = 0x150C 203 | GL_OR_INVERTED = 0x150D 204 | GL_NAND = 0x150E 205 | GL_SET = 0x150F 206 | GL_EMISSION = 0x1600 207 | GL_SHININESS = 0x1601 208 | GL_AMBIENT_AND_DIFFUSE = 0x1602 209 | GL_MODELVIEW = 0x1700 210 | GL_PROJECTION = 0x1701 211 | GL_TEXTURE = 0x1702 212 | GL_ALPHA = 0x1906 213 | GL_RGB = 0x1907 214 | GL_RGBA = 0x1908 215 | GL_LUMINANCE = 0x1909 216 | GL_LUMINANCE_ALPHA = 0x190A 217 | GL_UNPACK_ALIGNMENT = 0x0CF5 218 | GL_PACK_ALIGNMENT = 0x0D05 219 | GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033 220 | GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034 221 | GL_UNSIGNED_SHORT_5_6_5 = 0x8363 222 | GL_FLAT = 0x1D00 223 | GL_SMOOTH = 0x1D01 224 | GL_KEEP = 0x1E00 225 | GL_REPLACE = 0x1E01 226 | GL_INCR = 0x1E02 227 | GL_DECR = 0x1E03 228 | GL_VENDOR = 0x1F00 229 | GL_RENDERER = 0x1F01 230 | GL_VERSION = 0x1F02 231 | GL_EXTENSIONS = 0x1F03 232 | GL_MODULATE = 0x2100 233 | GL_DECAL = 0x2101 234 | GL_ADD = 0x0104 235 | GL_TEXTURE_ENV_MODE = 0x2200 236 | GL_TEXTURE_ENV_COLOR = 0x2201 237 | GL_TEXTURE_ENV = 0x2300 238 | GL_NEAREST = 0x2600 239 | GL_LINEAR = 0x2601 240 | GL_NEAREST_MIPMAP_NEAREST = 0x2700 241 | GL_LINEAR_MIPMAP_NEAREST = 0x2701 242 | GL_NEAREST_MIPMAP_LINEAR = 0x2702 243 | GL_LINEAR_MIPMAP_LINEAR = 0x2703 244 | GL_TEXTURE_MAG_FILTER = 0x2800 245 | GL_TEXTURE_MIN_FILTER = 0x2801 246 | GL_TEXTURE_WRAP_S = 0x2802 247 | GL_TEXTURE_WRAP_T = 0x2803 248 | GL_GENERATE_MIPMAP = 0x8191 249 | GL_TEXTURE0 = 0x84C0 250 | GL_TEXTURE1 = 0x84C1 251 | GL_TEXTURE2 = 0x84C2 252 | GL_TEXTURE3 = 0x84C3 253 | GL_TEXTURE4 = 0x84C4 254 | GL_TEXTURE5 = 0x84C5 255 | GL_TEXTURE6 = 0x84C6 256 | GL_TEXTURE7 = 0x84C7 257 | GL_TEXTURE8 = 0x84C8 258 | GL_TEXTURE9 = 0x84C9 259 | GL_TEXTURE10 = 0x84CA 260 | GL_TEXTURE11 = 0x84CB 261 | GL_TEXTURE12 = 0x84CC 262 | GL_TEXTURE13 = 0x84CD 263 | GL_TEXTURE14 = 0x84CE 264 | GL_TEXTURE15 = 0x84CF 265 | GL_TEXTURE16 = 0x84D0 266 | GL_TEXTURE17 = 0x84D1 267 | GL_TEXTURE18 = 0x84D2 268 | GL_TEXTURE19 = 0x84D3 269 | GL_TEXTURE20 = 0x84D4 270 | GL_TEXTURE21 = 0x84D5 271 | GL_TEXTURE22 = 0x84D6 272 | GL_TEXTURE23 = 0x84D7 273 | GL_TEXTURE24 = 0x84D8 274 | GL_TEXTURE25 = 0x84D9 275 | GL_TEXTURE26 = 0x84DA 276 | GL_TEXTURE27 = 0x84DB 277 | GL_TEXTURE28 = 0x84DC 278 | GL_TEXTURE29 = 0x84DD 279 | GL_TEXTURE30 = 0x84DE 280 | GL_TEXTURE31 = 0x84DF 281 | GL_ACTIVE_TEXTURE = 0x84E0 282 | GL_CLIENT_ACTIVE_TEXTURE = 0x84E1 283 | GL_REPEAT = 0x2901 284 | GL_CLAMP_TO_EDGE = 0x812F 285 | GL_LIGHT0 = 0x4000 286 | GL_LIGHT1 = 0x4001 287 | GL_LIGHT2 = 0x4002 288 | GL_LIGHT3 = 0x4003 289 | GL_LIGHT4 = 0x4004 290 | GL_LIGHT5 = 0x4005 291 | GL_LIGHT6 = 0x4006 292 | GL_LIGHT7 = 0x4007 293 | GL_ARRAY_BUFFER = 0x8892 294 | GL_ELEMENT_ARRAY_BUFFER = 0x8893 295 | GL_ARRAY_BUFFER_BINDING = 0x8894 296 | GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895 297 | GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896 298 | GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897 299 | GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898 300 | GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A 301 | GL_STATIC_DRAW = 0x88E4 302 | GL_DYNAMIC_DRAW = 0x88E8 303 | GL_BUFFER_SIZE = 0x8764 304 | GL_BUFFER_USAGE = 0x8765 305 | GL_SUBTRACT = 0x84E7 306 | GL_COMBINE = 0x8570 307 | GL_COMBINE_RGB = 0x8571 308 | GL_COMBINE_ALPHA = 0x8572 309 | GL_RGB_SCALE = 0x8573 310 | GL_ADD_SIGNED = 0x8574 311 | GL_INTERPOLATE = 0x8575 312 | GL_CONSTANT = 0x8576 313 | GL_PRIMARY_COLOR = 0x8577 314 | GL_PREVIOUS = 0x8578 315 | GL_OPERAND0_RGB = 0x8590 316 | GL_OPERAND1_RGB = 0x8591 317 | GL_OPERAND2_RGB = 0x8592 318 | GL_OPERAND0_ALPHA = 0x8598 319 | GL_OPERAND1_ALPHA = 0x8599 320 | GL_OPERAND2_ALPHA = 0x859A 321 | GL_ALPHA_SCALE = 0x0D1C 322 | GL_SRC0_RGB = 0x8580 323 | GL_SRC1_RGB = 0x8581 324 | GL_SRC2_RGB = 0x8582 325 | GL_SRC0_ALPHA = 0x8588 326 | GL_SRC1_ALPHA = 0x8589 327 | GL_SRC2_ALPHA = 0x858A 328 | GL_DOT3_RGB = 0x86AE 329 | GL_DOT3_RGBA = 0x86AF 330 | GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A 331 | GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B 332 | GL_PALETTE4_RGB8_OES = 0x8B90 333 | GL_PALETTE4_RGBA8_OES = 0x8B91 334 | GL_PALETTE4_R5_G6_B5_OES = 0x8B92 335 | GL_PALETTE4_RGBA4_OES = 0x8B93 336 | GL_PALETTE4_RGB5_A1_OES = 0x8B94 337 | GL_PALETTE8_RGB8_OES = 0x8B95 338 | GL_PALETTE8_RGBA8_OES = 0x8B96 339 | GL_PALETTE8_R5_G6_B5_OES = 0x8B97 340 | GL_PALETTE8_RGBA4_OES = 0x8B98 341 | GL_PALETTE8_RGB5_A1_OES = 0x8B99 342 | GL_POINT_SIZE_ARRAY_OES = 0x8B9C 343 | GL_POINT_SIZE_ARRAY_TYPE_OES = 0x898A 344 | GL_POINT_SIZE_ARRAY_STRIDE_OES = 0x898B 345 | GL_POINT_SIZE_ARRAY_POINTER_OES = 0x898C 346 | GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = 0x8B9F 347 | GL_POINT_SPRITE_OES = 0x8861 348 | GL_COORD_REPLACE_OES = 0x8862 349 | -------------------------------------------------------------------------------- /gl2.py: -------------------------------------------------------------------------------- 1 | GL_DEPTH_BUFFER_BIT = 0x00000100 2 | GL_STENCIL_BUFFER_BIT = 0x00000400 3 | GL_COLOR_BUFFER_BIT = 0x00004000 4 | GL_POINTS = 0x0000 5 | GL_LINES = 0x0001 6 | GL_LINE_LOOP = 0x0002 7 | GL_LINE_STRIP = 0x0003 8 | GL_TRIANGLES = 0x0004 9 | GL_TRIANGLE_STRIP = 0x0005 10 | GL_TRIANGLE_FAN = 0x0006 11 | GL_SRC_COLOR = 0x0300 12 | GL_ONE_MINUS_SRC_COLOR = 0x0301 13 | GL_SRC_ALPHA = 0x0302 14 | GL_ONE_MINUS_SRC_ALPHA = 0x0303 15 | GL_DST_ALPHA = 0x0304 16 | GL_ONE_MINUS_DST_ALPHA = 0x0305 17 | GL_DST_COLOR = 0x0306 18 | GL_ONE_MINUS_DST_COLOR = 0x0307 19 | GL_SRC_ALPHA_SATURATE = 0x0308 20 | GL_FUNC_ADD = 0x8006 21 | GL_BLEND_EQUATION = 0x8009 22 | GL_BLEND_EQUATION_RGB = 0x8009 23 | GL_BLEND_EQUATION_ALPHA = 0x883D 24 | GL_FUNC_SUBTRACT = 0x800A 25 | GL_FUNC_REVERSE_SUBTRACT = 0x800B 26 | GL_BLEND_DST_RGB = 0x80C8 27 | GL_BLEND_SRC_RGB = 0x80C9 28 | GL_BLEND_DST_ALPHA = 0x80CA 29 | GL_BLEND_SRC_ALPHA = 0x80CB 30 | GL_CONSTANT_COLOR = 0x8001 31 | GL_ONE_MINUS_CONSTANT_COLOR = 0x8002 32 | GL_CONSTANT_ALPHA = 0x8003 33 | GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004 34 | GL_BLEND_COLOR = 0x8005 35 | GL_ARRAY_BUFFER = 0x8892 36 | GL_ELEMENT_ARRAY_BUFFER = 0x8893 37 | GL_ARRAY_BUFFER_BINDING = 0x8894 38 | GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895 39 | GL_STREAM_DRAW = 0x88E0 40 | GL_STATIC_DRAW = 0x88E4 41 | GL_DYNAMIC_DRAW = 0x88E8 42 | GL_BUFFER_SIZE = 0x8764 43 | GL_BUFFER_USAGE = 0x8765 44 | GL_CURRENT_VERTEX_ATTRIB = 0x8626 45 | GL_FRONT = 0x0404 46 | GL_BACK = 0x0405 47 | GL_FRONT_AND_BACK = 0x0408 48 | GL_TEXTURE_2D = 0x0DE1 49 | GL_CULL_FACE = 0x0B44 50 | GL_BLEND = 0x0BE2 51 | GL_DITHER = 0x0BD0 52 | GL_STENCIL_TEST = 0x0B90 53 | GL_DEPTH_TEST = 0x0B71 54 | GL_SCISSOR_TEST = 0x0C11 55 | GL_POLYGON_OFFSET_FILL = 0x8037 56 | GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E 57 | GL_SAMPLE_COVERAGE = 0x80A0 58 | GL_INVALID_ENUM = 0x0500 59 | GL_INVALID_VALUE = 0x0501 60 | GL_INVALID_OPERATION = 0x0502 61 | GL_OUT_OF_MEMORY = 0x0505 62 | GL_CW = 0x0900 63 | GL_CCW = 0x0901 64 | GL_LINE_WIDTH = 0x0B21 65 | GL_ALIASED_POINT_SIZE_RANGE = 0x846D 66 | GL_ALIASED_LINE_WIDTH_RANGE = 0x846E 67 | GL_CULL_FACE_MODE = 0x0B45 68 | GL_FRONT_FACE = 0x0B46 69 | GL_DEPTH_RANGE = 0x0B70 70 | GL_DEPTH_WRITEMASK = 0x0B72 71 | GL_DEPTH_CLEAR_VALUE = 0x0B73 72 | GL_DEPTH_FUNC = 0x0B74 73 | GL_STENCIL_CLEAR_VALUE = 0x0B91 74 | GL_STENCIL_FUNC = 0x0B92 75 | GL_STENCIL_FAIL = 0x0B94 76 | GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95 77 | GL_STENCIL_PASS_DEPTH_PASS = 0x0B96 78 | GL_STENCIL_REF = 0x0B97 79 | GL_STENCIL_VALUE_MASK = 0x0B93 80 | GL_STENCIL_WRITEMASK = 0x0B98 81 | GL_STENCIL_BACK_FUNC = 0x8800 82 | GL_STENCIL_BACK_FAIL = 0x8801 83 | GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802 84 | GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803 85 | GL_STENCIL_BACK_REF = 0x8CA3 86 | GL_STENCIL_BACK_VALUE_MASK = 0x8CA4 87 | GL_STENCIL_BACK_WRITEMASK = 0x8CA5 88 | GL_VIEWPORT = 0x0BA2 89 | GL_SCISSOR_BOX = 0x0C10 90 | GL_COLOR_CLEAR_VALUE = 0x0C22 91 | GL_COLOR_WRITEMASK = 0x0C23 92 | GL_UNPACK_ALIGNMENT = 0x0CF5 93 | GL_PACK_ALIGNMENT = 0x0D05 94 | GL_MAX_TEXTURE_SIZE = 0x0D33 95 | GL_MAX_VIEWPORT_DIMS = 0x0D3A 96 | GL_SUBPIXEL_BITS = 0x0D50 97 | GL_RED_BITS = 0x0D52 98 | GL_GREEN_BITS = 0x0D53 99 | GL_BLUE_BITS = 0x0D54 100 | GL_ALPHA_BITS = 0x0D55 101 | GL_DEPTH_BITS = 0x0D56 102 | GL_STENCIL_BITS = 0x0D57 103 | GL_POLYGON_OFFSET_UNITS = 0x2A00 104 | GL_POLYGON_OFFSET_FACTOR = 0x8038 105 | GL_TEXTURE_BINDING_2D = 0x8069 106 | GL_SAMPLE_BUFFERS = 0x80A8 107 | GL_SAMPLES = 0x80A9 108 | GL_SAMPLE_COVERAGE_VALUE = 0x80AA 109 | GL_SAMPLE_COVERAGE_INVERT = 0x80AB 110 | GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2 111 | GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3 112 | GL_DONT_CARE = 0x1100 113 | GL_FASTEST = 0x1101 114 | GL_NICEST = 0x1102 115 | GL_GENERATE_MIPMAP_HINT = 0x8192 116 | GL_BYTE = 0x1400 117 | GL_UNSIGNED_BYTE = 0x1401 118 | GL_SHORT = 0x1402 119 | GL_UNSIGNED_SHORT = 0x1403 120 | GL_INT = 0x1404 121 | GL_UNSIGNED_INT = 0x1405 122 | GL_FLOAT = 0x1406 123 | GL_FIXED = 0x140C 124 | GL_DEPTH_COMPONENT = 0x1902 125 | GL_ALPHA = 0x1906 126 | GL_RGB = 0x1907 127 | GL_RGBA = 0x1908 128 | GL_LUMINANCE = 0x1909 129 | GL_LUMINANCE_ALPHA = 0x190A 130 | GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033 131 | GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034 132 | GL_UNSIGNED_SHORT_5_6_5 = 0x8363 133 | GL_FRAGMENT_SHADER = 0x8B30 134 | GL_VERTEX_SHADER = 0x8B31 135 | GL_MAX_VERTEX_ATTRIBS = 0x8869 136 | GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB 137 | GL_MAX_VARYING_VECTORS = 0x8DFC 138 | GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D 139 | GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C 140 | GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872 141 | GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD 142 | GL_SHADER_TYPE = 0x8B4F 143 | GL_DELETE_STATUS = 0x8B80 144 | GL_LINK_STATUS = 0x8B82 145 | GL_VALIDATE_STATUS = 0x8B83 146 | GL_ATTACHED_SHADERS = 0x8B85 147 | GL_ACTIVE_UNIFORMS = 0x8B86 148 | GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87 149 | GL_ACTIVE_ATTRIBUTES = 0x8B89 150 | GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A 151 | GL_SHADING_LANGUAGE_VERSION = 0x8B8C 152 | GL_CURRENT_PROGRAM = 0x8B8D 153 | GL_NEVER = 0x0200 154 | GL_LESS = 0x0201 155 | GL_EQUAL = 0x0202 156 | GL_LEQUAL = 0x0203 157 | GL_GREATER = 0x0204 158 | GL_NOTEQUAL = 0x0205 159 | GL_GEQUAL = 0x0206 160 | GL_ALWAYS = 0x0207 161 | GL_KEEP = 0x1E00 162 | GL_REPLACE = 0x1E01 163 | GL_INCR = 0x1E02 164 | GL_DECR = 0x1E03 165 | GL_INVERT = 0x150A 166 | GL_INCR_WRAP = 0x8507 167 | GL_DECR_WRAP = 0x8508 168 | GL_VENDOR = 0x1F00 169 | GL_RENDERER = 0x1F01 170 | GL_VERSION = 0x1F02 171 | GL_EXTENSIONS = 0x1F03 172 | GL_NEAREST = 0x2600 173 | GL_LINEAR = 0x2601 174 | GL_NEAREST_MIPMAP_NEAREST = 0x2700 175 | GL_LINEAR_MIPMAP_NEAREST = 0x2701 176 | GL_NEAREST_MIPMAP_LINEAR = 0x2702 177 | GL_LINEAR_MIPMAP_LINEAR = 0x2703 178 | GL_TEXTURE_MAG_FILTER = 0x2800 179 | GL_TEXTURE_MIN_FILTER = 0x2801 180 | GL_TEXTURE_WRAP_S = 0x2802 181 | GL_TEXTURE_WRAP_T = 0x2803 182 | GL_TEXTURE = 0x1702 183 | GL_TEXTURE_CUBE_MAP = 0x8513 184 | GL_TEXTURE_BINDING_CUBE_MAP = 0x8514 185 | GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 186 | GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516 187 | GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517 188 | GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518 189 | GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519 190 | GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A 191 | GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C 192 | GL_TEXTURE0 = 0x84C0 193 | GL_TEXTURE1 = 0x84C1 194 | GL_TEXTURE2 = 0x84C2 195 | GL_TEXTURE3 = 0x84C3 196 | GL_TEXTURE4 = 0x84C4 197 | GL_TEXTURE5 = 0x84C5 198 | GL_TEXTURE6 = 0x84C6 199 | GL_TEXTURE7 = 0x84C7 200 | GL_TEXTURE8 = 0x84C8 201 | GL_TEXTURE9 = 0x84C9 202 | GL_TEXTURE10 = 0x84CA 203 | GL_TEXTURE11 = 0x84CB 204 | GL_TEXTURE12 = 0x84CC 205 | GL_TEXTURE13 = 0x84CD 206 | GL_TEXTURE14 = 0x84CE 207 | GL_TEXTURE15 = 0x84CF 208 | GL_TEXTURE16 = 0x84D0 209 | GL_TEXTURE17 = 0x84D1 210 | GL_TEXTURE18 = 0x84D2 211 | GL_TEXTURE19 = 0x84D3 212 | GL_TEXTURE20 = 0x84D4 213 | GL_TEXTURE21 = 0x84D5 214 | GL_TEXTURE22 = 0x84D6 215 | GL_TEXTURE23 = 0x84D7 216 | GL_TEXTURE24 = 0x84D8 217 | GL_TEXTURE25 = 0x84D9 218 | GL_TEXTURE26 = 0x84DA 219 | GL_TEXTURE27 = 0x84DB 220 | GL_TEXTURE28 = 0x84DC 221 | GL_TEXTURE29 = 0x84DD 222 | GL_TEXTURE30 = 0x84DE 223 | GL_TEXTURE31 = 0x84DF 224 | GL_ACTIVE_TEXTURE = 0x84E0 225 | GL_REPEAT = 0x2901 226 | GL_CLAMP_TO_EDGE = 0x812F 227 | GL_MIRRORED_REPEAT = 0x8370 228 | GL_FLOAT_VEC2 = 0x8B50 229 | GL_FLOAT_VEC3 = 0x8B51 230 | GL_FLOAT_VEC4 = 0x8B52 231 | GL_INT_VEC2 = 0x8B53 232 | GL_INT_VEC3 = 0x8B54 233 | GL_INT_VEC4 = 0x8B55 234 | GL_BOOL = 0x8B56 235 | GL_BOOL_VEC2 = 0x8B57 236 | GL_BOOL_VEC3 = 0x8B58 237 | GL_BOOL_VEC4 = 0x8B59 238 | GL_FLOAT_MAT2 = 0x8B5A 239 | GL_FLOAT_MAT3 = 0x8B5B 240 | GL_FLOAT_MAT4 = 0x8B5C 241 | GL_SAMPLER_2D = 0x8B5E 242 | GL_SAMPLER_CUBE = 0x8B60 243 | GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 244 | GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623 245 | GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624 246 | GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625 247 | GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A 248 | GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645 249 | GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F 250 | GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A 251 | GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B 252 | GL_COMPILE_STATUS = 0x8B81 253 | GL_INFO_LOG_LENGTH = 0x8B84 254 | GL_SHADER_SOURCE_LENGTH = 0x8B88 255 | GL_SHADER_COMPILER = 0x8DFA 256 | GL_SHADER_BINARY_FORMATS = 0x8DF8 257 | GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9 258 | GL_LOW_FLOAT = 0x8DF0 259 | GL_MEDIUM_FLOAT = 0x8DF1 260 | GL_HIGH_FLOAT = 0x8DF2 261 | GL_LOW_INT = 0x8DF3 262 | GL_MEDIUM_INT = 0x8DF4 263 | GL_HIGH_INT = 0x8DF5 264 | GL_FRAMEBUFFER = 0x8D40 265 | GL_RENDERBUFFER = 0x8D41 266 | GL_RGBA4 = 0x8056 267 | GL_RGB5_A1 = 0x8057 268 | GL_RGB565 = 0x8D62 269 | GL_DEPTH_COMPONENT16 = 0x81A5 270 | GL_STENCIL_INDEX = 0x1901 271 | GL_STENCIL_INDEX8 = 0x8D48 272 | GL_RENDERBUFFER_WIDTH = 0x8D42 273 | GL_RENDERBUFFER_HEIGHT = 0x8D43 274 | GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44 275 | GL_RENDERBUFFER_RED_SIZE = 0x8D50 276 | GL_RENDERBUFFER_GREEN_SIZE = 0x8D51 277 | GL_RENDERBUFFER_BLUE_SIZE = 0x8D52 278 | GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53 279 | GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54 280 | GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55 281 | GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0 282 | GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1 283 | GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2 284 | GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3 285 | GL_COLOR_ATTACHMENT0 = 0x8CE0 286 | GL_DEPTH_ATTACHMENT = 0x8D00 287 | GL_STENCIL_ATTACHMENT = 0x8D20 288 | GL_FRAMEBUFFER_COMPLETE = 0x8CD5 289 | GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6 290 | GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7 291 | GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 292 | GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD 293 | GL_FRAMEBUFFER_BINDING = 0x8CA6 294 | GL_RENDERBUFFER_BINDING = 0x8CA7 295 | GL_MAX_RENDERBUFFER_SIZE = 0x84E8 296 | GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506 297 | -------------------------------------------------------------------------------- /gl2ext.py: -------------------------------------------------------------------------------- 1 | GL_ETC1_RGB8_OES = 0x8D64 2 | GL_PALETTE4_RGB8_OES = 0x8B90 3 | GL_PALETTE4_RGBA8_OES = 0x8B91 4 | GL_PALETTE4_R5_G6_B5_OES = 0x8B92 5 | GL_PALETTE4_RGBA4_OES = 0x8B93 6 | GL_PALETTE4_RGB5_A1_OES = 0x8B94 7 | GL_PALETTE8_RGB8_OES = 0x8B95 8 | GL_PALETTE8_RGBA8_OES = 0x8B96 9 | GL_PALETTE8_R5_G6_B5_OES = 0x8B97 10 | GL_PALETTE8_RGBA4_OES = 0x8B98 11 | GL_PALETTE8_RGB5_A1_OES = 0x8B99 12 | GL_DEPTH_COMPONENT24_OES = 0x81A6 13 | GL_DEPTH_COMPONENT32_OES = 0x81A7 14 | GL_TEXTURE_EXTERNAL_OES = 0x8D65 15 | GL_SAMPLER_EXTERNAL_OES = 0x8D66 16 | GL_TEXTURE_BINDING_EXTERNAL_OES = 0x8D67 17 | GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES = 0x8D68 18 | GL_UNSIGNED_INT = 0x1405 19 | GL_PROGRAM_BINARY_LENGTH_OES = 0x8741 20 | GL_NUM_PROGRAM_BINARY_FORMATS_OES = 0x87FE 21 | GL_PROGRAM_BINARY_FORMATS_OES = 0x87FF 22 | GL_WRITE_ONLY_OES = 0x88B9 23 | GL_BUFFER_ACCESS_OES = 0x88BB 24 | GL_BUFFER_MAPPED_OES = 0x88BC 25 | GL_BUFFER_MAP_POINTER_OES = 0x88BD 26 | GL_DEPTH_STENCIL_OES = 0x84F9 27 | GL_UNSIGNED_INT_24_8_OES = 0x84FA 28 | GL_DEPTH24_STENCIL8_OES = 0x88F0 29 | GL_RGB8_OES = 0x8051 30 | GL_RGBA8_OES = 0x8058 31 | GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B 32 | GL_STENCIL_INDEX1_OES = 0x8D46 33 | GL_STENCIL_INDEX4_OES = 0x8D47 34 | GL_TEXTURE_WRAP_R_OES = 0x8072 35 | GL_TEXTURE_3D_OES = 0x806F 36 | GL_TEXTURE_BINDING_3D_OES = 0x806A 37 | GL_MAX_3D_TEXTURE_SIZE_OES = 0x8073 38 | GL_SAMPLER_3D_OES = 0x8B5F 39 | GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES = 0x8CD4 40 | GL_HALF_FLOAT_OES = 0x8D61 41 | GL_VERTEX_ARRAY_BINDING_OES = 0x85B5 42 | GL_UNSIGNED_INT_10_10_10_2_OES = 0x8DF6 43 | GL_INT_10_10_10_2_OES = 0x8DF7 44 | GL_3DC_X_AMD = 0x87F9 45 | GL_3DC_XY_AMD = 0x87FA 46 | GL_ATC_RGB_AMD = 0x8C92 47 | GL_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93 48 | GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE 49 | GL_COUNTER_TYPE_AMD = 0x8BC0 50 | GL_COUNTER_RANGE_AMD = 0x8BC1 51 | GL_UNSIGNED_INT64_AMD = 0x8BC2 52 | GL_PERCENTAGE_AMD = 0x8BC3 53 | GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4 54 | GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5 55 | GL_PERFMON_RESULT_AMD = 0x8BC6 56 | GL_Z400_BINARY_AMD = 0x8740 57 | GL_READ_FRAMEBUFFER_ANGLE = 0x8CA8 58 | GL_DRAW_FRAMEBUFFER_ANGLE = 0x8CA9 59 | GL_DRAW_FRAMEBUFFER_BINDING_ANGLE = 0x8CA6 60 | GL_READ_FRAMEBUFFER_BINDING_ANGLE = 0x8CAA 61 | GL_RENDERBUFFER_SAMPLES_ANGLE = 0x8CAB 62 | GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE = 0x8D56 63 | GL_MAX_SAMPLES_ANGLE = 0x8D57 64 | GL_RGB_422_APPLE = 0x8A1F 65 | GL_UNSIGNED_SHORT_8_8_APPLE = 0x85BA 66 | GL_UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB 67 | GL_RENDERBUFFER_SAMPLES_APPLE = 0x8CAB 68 | GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE = 0x8D56 69 | GL_MAX_SAMPLES_APPLE = 0x8D57 70 | GL_READ_FRAMEBUFFER_APPLE = 0x8CA8 71 | GL_DRAW_FRAMEBUFFER_APPLE = 0x8CA9 72 | GL_DRAW_FRAMEBUFFER_BINDING_APPLE = 0x8CA6 73 | GL_READ_FRAMEBUFFER_BINDING_APPLE = 0x8CAA 74 | GL_BGRA_EXT = 0x80E1 75 | GL_TEXTURE_MAX_LEVEL_APPLE = 0x813D 76 | GL_MALI_SHADER_BINARY_ARM = 0x8F60 77 | GL_MIN_EXT = 0x8007 78 | GL_MAX_EXT = 0x8008 79 | GL_COLOR_EXT = 0x1800 80 | GL_DEPTH_EXT = 0x1801 81 | GL_STENCIL_EXT = 0x1802 82 | GL_BGRA_EXT = 0x80E1 83 | GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT = 0x8365 84 | GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT = 0x8366 85 | GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE 86 | GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF 87 | GL_BGRA_EXT = 0x80E1 88 | GL_UNSIGNED_INT_2_10_10_10_REV_EXT = 0x8368 89 | GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0 90 | GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1 91 | GL_UNPACK_ROW_LENGTH = 0x0CF2 92 | GL_UNPACK_SKIP_ROWS = 0x0CF3 93 | GL_UNPACK_SKIP_PIXELS = 0x0CF4 94 | GL_SHADER_BINARY_DMP = 0x9250 95 | GL_SGX_PROGRAM_BINARY_IMG = 0x9130 96 | GL_BGRA_IMG = 0x80E1 97 | GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG = 0x8365 98 | GL_SGX_BINARY_IMG = 0x8C0A 99 | GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00 100 | GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01 101 | GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02 102 | GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03 103 | GL_RENDERBUFFER_SAMPLES_IMG = 0x9133 104 | GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG = 0x9134 105 | GL_MAX_SAMPLES_IMG = 0x9135 106 | GL_TEXTURE_SAMPLES_IMG = 0x9136 107 | GL_COVERAGE_COMPONENT_NV = 0x8ED0 108 | GL_COVERAGE_COMPONENT4_NV = 0x8ED1 109 | GL_COVERAGE_ATTACHMENT_NV = 0x8ED2 110 | GL_COVERAGE_BUFFERS_NV = 0x8ED3 111 | GL_COVERAGE_SAMPLES_NV = 0x8ED4 112 | GL_COVERAGE_ALL_FRAGMENTS_NV = 0x8ED5 113 | GL_COVERAGE_EDGE_FRAGMENTS_NV = 0x8ED6 114 | GL_COVERAGE_AUTOMATIC_NV = 0x8ED7 115 | GL_COVERAGE_BUFFER_BIT_NV = 0x8000 116 | GL_DEPTH_COMPONENT16_NONLINEAR_NV = 0x8E2C 117 | GL_MAX_DRAW_BUFFERS_NV = 0x8824 118 | GL_DRAW_BUFFER0_NV = 0x8825 119 | GL_DRAW_BUFFER1_NV = 0x8826 120 | GL_DRAW_BUFFER2_NV = 0x8827 121 | GL_DRAW_BUFFER3_NV = 0x8828 122 | GL_DRAW_BUFFER4_NV = 0x8829 123 | GL_DRAW_BUFFER5_NV = 0x882A 124 | GL_DRAW_BUFFER6_NV = 0x882B 125 | GL_DRAW_BUFFER7_NV = 0x882C 126 | GL_DRAW_BUFFER8_NV = 0x882D 127 | GL_DRAW_BUFFER9_NV = 0x882E 128 | GL_DRAW_BUFFER10_NV = 0x882F 129 | GL_DRAW_BUFFER11_NV = 0x8830 130 | GL_DRAW_BUFFER12_NV = 0x8831 131 | GL_DRAW_BUFFER13_NV = 0x8832 132 | GL_DRAW_BUFFER14_NV = 0x8833 133 | GL_DRAW_BUFFER15_NV = 0x8834 134 | GL_COLOR_ATTACHMENT0_NV = 0x8CE0 135 | GL_COLOR_ATTACHMENT1_NV = 0x8CE1 136 | GL_COLOR_ATTACHMENT2_NV = 0x8CE2 137 | GL_COLOR_ATTACHMENT3_NV = 0x8CE3 138 | GL_COLOR_ATTACHMENT4_NV = 0x8CE4 139 | GL_COLOR_ATTACHMENT5_NV = 0x8CE5 140 | GL_COLOR_ATTACHMENT6_NV = 0x8CE6 141 | GL_COLOR_ATTACHMENT7_NV = 0x8CE7 142 | GL_COLOR_ATTACHMENT8_NV = 0x8CE8 143 | GL_COLOR_ATTACHMENT9_NV = 0x8CE9 144 | GL_COLOR_ATTACHMENT10_NV = 0x8CEA 145 | GL_COLOR_ATTACHMENT11_NV = 0x8CEB 146 | GL_COLOR_ATTACHMENT12_NV = 0x8CEC 147 | GL_COLOR_ATTACHMENT13_NV = 0x8CED 148 | GL_COLOR_ATTACHMENT14_NV = 0x8CEE 149 | GL_COLOR_ATTACHMENT15_NV = 0x8CEF 150 | GL_MAX_COLOR_ATTACHMENTS_NV = 0x8CDF 151 | GL_ALL_COMPLETED_NV = 0x84F2 152 | GL_FENCE_STATUS_NV = 0x84F3 153 | GL_FENCE_CONDITION_NV = 0x84F4 154 | GL_READ_BUFFER_NV = 0x0C02 155 | GL_ALPHA_TEST_QCOM = 0x0BC0 156 | GL_ALPHA_TEST_FUNC_QCOM = 0x0BC1 157 | GL_ALPHA_TEST_REF_QCOM = 0x0BC2 158 | GL_TEXTURE_WIDTH_QCOM = 0x8BD2 159 | GL_TEXTURE_HEIGHT_QCOM = 0x8BD3 160 | GL_TEXTURE_DEPTH_QCOM = 0x8BD4 161 | GL_TEXTURE_INTERNAL_FORMAT_QCOM = 0x8BD5 162 | GL_TEXTURE_FORMAT_QCOM = 0x8BD6 163 | GL_TEXTURE_TYPE_QCOM = 0x8BD7 164 | GL_TEXTURE_IMAGE_VALID_QCOM = 0x8BD8 165 | GL_TEXTURE_NUM_LEVELS_QCOM = 0x8BD9 166 | GL_TEXTURE_TARGET_QCOM = 0x8BDA 167 | GL_TEXTURE_OBJECT_VALID_QCOM = 0x8BDB 168 | GL_STATE_RESTORE = 0x8BDC 169 | GL_PERFMON_GLOBAL_MODE_QCOM = 0x8FA0 170 | GL_WRITEONLY_RENDERING_QCOM = 0x8823 171 | GL_COLOR_BUFFER_BIT0_QCOM = 0x00000001 172 | GL_COLOR_BUFFER_BIT1_QCOM = 0x00000002 173 | GL_COLOR_BUFFER_BIT2_QCOM = 0x00000004 174 | GL_COLOR_BUFFER_BIT3_QCOM = 0x00000008 175 | GL_COLOR_BUFFER_BIT4_QCOM = 0x00000010 176 | GL_COLOR_BUFFER_BIT5_QCOM = 0x00000020 177 | GL_COLOR_BUFFER_BIT6_QCOM = 0x00000040 178 | GL_COLOR_BUFFER_BIT7_QCOM = 0x00000080 179 | GL_DEPTH_BUFFER_BIT0_QCOM = 0x00000100 180 | GL_DEPTH_BUFFER_BIT1_QCOM = 0x00000200 181 | GL_DEPTH_BUFFER_BIT2_QCOM = 0x00000400 182 | GL_DEPTH_BUFFER_BIT3_QCOM = 0x00000800 183 | GL_DEPTH_BUFFER_BIT4_QCOM = 0x00001000 184 | GL_DEPTH_BUFFER_BIT5_QCOM = 0x00002000 185 | GL_DEPTH_BUFFER_BIT6_QCOM = 0x00004000 186 | GL_DEPTH_BUFFER_BIT7_QCOM = 0x00008000 187 | GL_STENCIL_BUFFER_BIT0_QCOM = 0x00010000 188 | GL_STENCIL_BUFFER_BIT1_QCOM = 0x00020000 189 | GL_STENCIL_BUFFER_BIT2_QCOM = 0x00040000 190 | GL_STENCIL_BUFFER_BIT3_QCOM = 0x00080000 191 | GL_STENCIL_BUFFER_BIT4_QCOM = 0x00100000 192 | GL_STENCIL_BUFFER_BIT5_QCOM = 0x00200000 193 | GL_STENCIL_BUFFER_BIT6_QCOM = 0x00400000 194 | GL_STENCIL_BUFFER_BIT7_QCOM = 0x00800000 195 | GL_MULTISAMPLE_BUFFER_BIT0_QCOM = 0x01000000 196 | GL_MULTISAMPLE_BUFFER_BIT1_QCOM = 0x02000000 197 | GL_MULTISAMPLE_BUFFER_BIT2_QCOM = 0x04000000 198 | GL_MULTISAMPLE_BUFFER_BIT3_QCOM = 0x08000000 199 | GL_MULTISAMPLE_BUFFER_BIT4_QCOM = 0x10000000 200 | GL_MULTISAMPLE_BUFFER_BIT5_QCOM = 0x20000000 201 | GL_MULTISAMPLE_BUFFER_BIT6_QCOM = 0x40000000 202 | GL_MULTISAMPLE_BUFFER_BIT7_QCOM = 0x80000000 203 | GL_SHADER_BINARY_VIV = 0x8FC4 204 | -------------------------------------------------------------------------------- /glext.py: -------------------------------------------------------------------------------- 1 | GL_BLEND_EQUATION_RGB_OES = 0x8009 2 | GL_BLEND_EQUATION_ALPHA_OES = 0x883D 3 | GL_BLEND_DST_RGB_OES = 0x80C8 4 | GL_BLEND_SRC_RGB_OES = 0x80C9 5 | GL_BLEND_DST_ALPHA_OES = 0x80CA 6 | GL_BLEND_SRC_ALPHA_OES = 0x80CB 7 | GL_BLEND_EQUATION_OES = 0x8009 8 | GL_FUNC_ADD_OES = 0x8006 9 | GL_FUNC_SUBTRACT_OES = 0x800A 10 | GL_FUNC_REVERSE_SUBTRACT_OES = 0x800B 11 | GL_ETC1_RGB8_OES = 0x8D64 12 | GL_DEPTH_COMPONENT24_OES = 0x81A6 13 | GL_DEPTH_COMPONENT32_OES = 0x81A7 14 | GL_TEXTURE_CROP_RECT_OES = 0x8B9D 15 | GL_TEXTURE_EXTERNAL_OES = 0x8D65 16 | GL_TEXTURE_BINDING_EXTERNAL_OES = 0x8D67 17 | GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES = 0x8D68 18 | GL_UNSIGNED_INT = 0x1405 19 | GL_FIXED_OES = 0x140C 20 | GL_FRAMEBUFFER_OES = 0x8D40 21 | GL_RENDERBUFFER_OES = 0x8D41 22 | GL_RGBA4_OES = 0x8056 23 | GL_RGB5_A1_OES = 0x8057 24 | GL_RGB565_OES = 0x8D62 25 | GL_DEPTH_COMPONENT16_OES = 0x81A5 26 | GL_RENDERBUFFER_WIDTH_OES = 0x8D42 27 | GL_RENDERBUFFER_HEIGHT_OES = 0x8D43 28 | GL_RENDERBUFFER_INTERNAL_FORMAT_OES = 0x8D44 29 | GL_RENDERBUFFER_RED_SIZE_OES = 0x8D50 30 | GL_RENDERBUFFER_GREEN_SIZE_OES = 0x8D51 31 | GL_RENDERBUFFER_BLUE_SIZE_OES = 0x8D52 32 | GL_RENDERBUFFER_ALPHA_SIZE_OES = 0x8D53 33 | GL_RENDERBUFFER_DEPTH_SIZE_OES = 0x8D54 34 | GL_RENDERBUFFER_STENCIL_SIZE_OES = 0x8D55 35 | GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES = 0x8CD0 36 | GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES = 0x8CD1 37 | GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES = 0x8CD2 38 | GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES = 0x8CD3 39 | GL_COLOR_ATTACHMENT0_OES = 0x8CE0 40 | GL_DEPTH_ATTACHMENT_OES = 0x8D00 41 | GL_STENCIL_ATTACHMENT_OES = 0x8D20 42 | GL_FRAMEBUFFER_COMPLETE_OES = 0x8CD5 43 | GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES = 0x8CD6 44 | GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES = 0x8CD7 45 | GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES = 0x8CD9 46 | GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES = 0x8CDA 47 | GL_FRAMEBUFFER_UNSUPPORTED_OES = 0x8CDD 48 | GL_FRAMEBUFFER_BINDING_OES = 0x8CA6 49 | GL_RENDERBUFFER_BINDING_OES = 0x8CA7 50 | GL_MAX_RENDERBUFFER_SIZE_OES = 0x84E8 51 | GL_INVALID_FRAMEBUFFER_OPERATION_OES = 0x0506 52 | GL_WRITE_ONLY_OES = 0x88B9 53 | GL_BUFFER_ACCESS_OES = 0x88BB 54 | GL_BUFFER_MAPPED_OES = 0x88BC 55 | GL_BUFFER_MAP_POINTER_OES = 0x88BD 56 | GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898D 57 | GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898E 58 | GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898F 59 | GL_MAX_VERTEX_UNITS_OES = 0x86A4 60 | GL_MAX_PALETTE_MATRICES_OES = 0x8842 61 | GL_MATRIX_PALETTE_OES = 0x8840 62 | GL_MATRIX_INDEX_ARRAY_OES = 0x8844 63 | GL_WEIGHT_ARRAY_OES = 0x86AD 64 | GL_CURRENT_PALETTE_MATRIX_OES = 0x8843 65 | GL_MATRIX_INDEX_ARRAY_SIZE_OES = 0x8846 66 | GL_MATRIX_INDEX_ARRAY_TYPE_OES = 0x8847 67 | GL_MATRIX_INDEX_ARRAY_STRIDE_OES = 0x8848 68 | GL_MATRIX_INDEX_ARRAY_POINTER_OES = 0x8849 69 | GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES = 0x8B9E 70 | GL_WEIGHT_ARRAY_SIZE_OES = 0x86AB 71 | GL_WEIGHT_ARRAY_TYPE_OES = 0x86A9 72 | GL_WEIGHT_ARRAY_STRIDE_OES = 0x86AA 73 | GL_WEIGHT_ARRAY_POINTER_OES = 0x86AC 74 | GL_WEIGHT_ARRAY_BUFFER_BINDING_OES = 0x889E 75 | GL_DEPTH_STENCIL_OES = 0x84F9 76 | GL_UNSIGNED_INT_24_8_OES = 0x84FA 77 | GL_DEPTH24_STENCIL8_OES = 0x88F0 78 | GL_RGB8_OES = 0x8051 79 | GL_RGBA8_OES = 0x8058 80 | GL_STENCIL_INDEX1_OES = 0x8D46 81 | GL_STENCIL_INDEX4_OES = 0x8D47 82 | GL_STENCIL_INDEX8_OES = 0x8D48 83 | GL_INCR_WRAP_OES = 0x8507 84 | GL_DECR_WRAP_OES = 0x8508 85 | GL_NORMAL_MAP_OES = 0x8511 86 | GL_REFLECTION_MAP_OES = 0x8512 87 | GL_TEXTURE_CUBE_MAP_OES = 0x8513 88 | GL_TEXTURE_BINDING_CUBE_MAP_OES = 0x8514 89 | GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES = 0x8515 90 | GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES = 0x8516 91 | GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES = 0x8517 92 | GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES = 0x8518 93 | GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES = 0x8519 94 | GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES = 0x851A 95 | GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES = 0x851C 96 | GL_TEXTURE_GEN_MODE_OES = 0x2500 97 | GL_TEXTURE_GEN_STR_OES = 0x8D60 98 | GL_MIRRORED_REPEAT_OES = 0x8370 99 | GL_VERTEX_ARRAY_BINDING_OES = 0x85B5 100 | GL_3DC_X_AMD = 0x87F9 101 | GL_3DC_XY_AMD = 0x87FA 102 | GL_ATC_RGB_AMD = 0x8C92 103 | GL_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93 104 | GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE 105 | GL_RENDERBUFFER_SAMPLES_APPLE = 0x8CAB 106 | GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE = 0x8D56 107 | GL_MAX_SAMPLES_APPLE = 0x8D57 108 | GL_READ_FRAMEBUFFER_APPLE = 0x8CA8 109 | GL_DRAW_FRAMEBUFFER_APPLE = 0x8CA9 110 | GL_DRAW_FRAMEBUFFER_BINDING_APPLE = 0x8CA6 111 | GL_READ_FRAMEBUFFER_BINDING_APPLE = 0x8CAA 112 | GL_BGRA_EXT = 0x80E1 113 | GL_TEXTURE_MAX_LEVEL_APPLE = 0x813D 114 | GL_MIN_EXT = 0x8007 115 | GL_MAX_EXT = 0x8008 116 | GL_COLOR_EXT = 0x1800 117 | GL_DEPTH_EXT = 0x1801 118 | GL_STENCIL_EXT = 0x1802 119 | GL_BGRA_EXT = 0x80E1 120 | GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT = 0x8365 121 | GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT = 0x8366 122 | GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE 123 | GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF 124 | GL_BGRA_EXT = 0x80E1 125 | GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD 126 | GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500 127 | GL_TEXTURE_LOD_BIAS_EXT = 0x8501 128 | GL_BGRA_IMG = 0x80E1 129 | GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG = 0x8365 130 | GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00 131 | GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01 132 | GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02 133 | GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03 134 | GL_MODULATE_COLOR_IMG = 0x8C04 135 | GL_RECIP_ADD_SIGNED_ALPHA_IMG = 0x8C05 136 | GL_TEXTURE_ALPHA_MODULATE_IMG = 0x8C06 137 | GL_FACTOR_ALPHA_MODULATE_IMG = 0x8C07 138 | GL_FRAGMENT_ALPHA_MODULATE_IMG = 0x8C08 139 | GL_ADD_BLEND_IMG = 0x8C09 140 | GL_DOT3_RGBA_IMG = 0x86AF 141 | GL_CLIP_PLANE0_IMG = 0x3000 142 | GL_CLIP_PLANE1_IMG = 0x3001 143 | GL_CLIP_PLANE2_IMG = 0x3002 144 | GL_CLIP_PLANE3_IMG = 0x3003 145 | GL_CLIP_PLANE4_IMG = 0x3004 146 | GL_CLIP_PLANE5_IMG = 0x3005 147 | GL_MAX_CLIP_PLANES_IMG = 0x0D32 148 | GL_RENDERBUFFER_SAMPLES_IMG = 0x9133 149 | GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG = 0x9134 150 | GL_MAX_SAMPLES_IMG = 0x9135 151 | GL_TEXTURE_SAMPLES_IMG = 0x9136 152 | GL_ALL_COMPLETED_NV = 0x84F2 153 | GL_FENCE_STATUS_NV = 0x84F3 154 | GL_FENCE_CONDITION_NV = 0x84F4 155 | GL_TEXTURE_WIDTH_QCOM = 0x8BD2 156 | GL_TEXTURE_HEIGHT_QCOM = 0x8BD3 157 | GL_TEXTURE_DEPTH_QCOM = 0x8BD4 158 | GL_TEXTURE_INTERNAL_FORMAT_QCOM = 0x8BD5 159 | GL_TEXTURE_FORMAT_QCOM = 0x8BD6 160 | GL_TEXTURE_TYPE_QCOM = 0x8BD7 161 | GL_TEXTURE_IMAGE_VALID_QCOM = 0x8BD8 162 | GL_TEXTURE_NUM_LEVELS_QCOM = 0x8BD9 163 | GL_TEXTURE_TARGET_QCOM = 0x8BDA 164 | GL_TEXTURE_OBJECT_VALID_QCOM = 0x8BDB 165 | GL_STATE_RESTORE = 0x8BDC 166 | GL_PERFMON_GLOBAL_MODE_QCOM = 0x8FA0 167 | GL_WRITEONLY_RENDERING_QCOM = 0x8823 168 | GL_COLOR_BUFFER_BIT0_QCOM = 0x00000001 169 | GL_COLOR_BUFFER_BIT1_QCOM = 0x00000002 170 | GL_COLOR_BUFFER_BIT2_QCOM = 0x00000004 171 | GL_COLOR_BUFFER_BIT3_QCOM = 0x00000008 172 | GL_COLOR_BUFFER_BIT4_QCOM = 0x00000010 173 | GL_COLOR_BUFFER_BIT5_QCOM = 0x00000020 174 | GL_COLOR_BUFFER_BIT6_QCOM = 0x00000040 175 | GL_COLOR_BUFFER_BIT7_QCOM = 0x00000080 176 | GL_DEPTH_BUFFER_BIT0_QCOM = 0x00000100 177 | GL_DEPTH_BUFFER_BIT1_QCOM = 0x00000200 178 | GL_DEPTH_BUFFER_BIT2_QCOM = 0x00000400 179 | GL_DEPTH_BUFFER_BIT3_QCOM = 0x00000800 180 | GL_DEPTH_BUFFER_BIT4_QCOM = 0x00001000 181 | GL_DEPTH_BUFFER_BIT5_QCOM = 0x00002000 182 | GL_DEPTH_BUFFER_BIT6_QCOM = 0x00004000 183 | GL_DEPTH_BUFFER_BIT7_QCOM = 0x00008000 184 | GL_STENCIL_BUFFER_BIT0_QCOM = 0x00010000 185 | GL_STENCIL_BUFFER_BIT1_QCOM = 0x00020000 186 | GL_STENCIL_BUFFER_BIT2_QCOM = 0x00040000 187 | GL_STENCIL_BUFFER_BIT3_QCOM = 0x00080000 188 | GL_STENCIL_BUFFER_BIT4_QCOM = 0x00100000 189 | GL_STENCIL_BUFFER_BIT5_QCOM = 0x00200000 190 | GL_STENCIL_BUFFER_BIT6_QCOM = 0x00400000 191 | GL_STENCIL_BUFFER_BIT7_QCOM = 0x00800000 192 | GL_MULTISAMPLE_BUFFER_BIT0_QCOM = 0x01000000 193 | GL_MULTISAMPLE_BUFFER_BIT1_QCOM = 0x02000000 194 | GL_MULTISAMPLE_BUFFER_BIT2_QCOM = 0x04000000 195 | GL_MULTISAMPLE_BUFFER_BIT3_QCOM = 0x08000000 196 | GL_MULTISAMPLE_BUFFER_BIT4_QCOM = 0x10000000 197 | GL_MULTISAMPLE_BUFFER_BIT5_QCOM = 0x20000000 198 | GL_MULTISAMPLE_BUFFER_BIT6_QCOM = 0x40000000 199 | GL_MULTISAMPLE_BUFFER_BIT7_QCOM = 0x80000000 200 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Peter de Rivaz 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted. 4 | -------------------------------------------------------------------------------- /prepare_constants.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Peter de Rivaz 2 | # 3 | # This file automatically extracts useful information from the .h header files. 4 | import re 5 | def extract(c_header_name,py_name): 6 | """Extracts useful information from a .h file into a .py file""" 7 | with open(py_name,'w') as py: 8 | with open(c_header_name) as c: 9 | for line in c.readlines(): 10 | A=line.split() 11 | if len(A)<3: continue 12 | if A[0]!='#define': continue 13 | if A[2][0:2]!= '0x': continue 14 | print >>py,A[1],'=',A[2] 15 | 16 | 17 | extract('EGL\egl.h','egl.py') 18 | extract('GLES2\gl2.h','gl2.py') 19 | extract('GLES2\gl2ext.h','gl2ext.py') 20 | extract('GLES\gl.h','gl.py') 21 | extract('GLES\glext.h','glext.py') 22 | -------------------------------------------------------------------------------- /pymouse.py: -------------------------------------------------------------------------------- 1 | import threading 2 | 3 | XSIGN = 1<<4 4 | YSIGN = 1<<5 5 | 6 | class MouseThread ( threading.Thread ): 7 | 8 | def __init__(self): 9 | threading.Thread.__init__(self) 10 | self.fd = open('/dev/input/mouse0','r') 11 | self.x = 800 12 | self.y = 400 13 | self.height=1080 14 | self.width=1920 15 | self.finished=False 16 | 17 | def run ( self ): 18 | while 1: 19 | while 1: 20 | buttons,dx,dy=map(ord,self.fd.read(3)) 21 | if buttons&8: 22 | break # This bit should always be set 23 | self.fd.read(1) # Try to sync up again 24 | if buttons&3: 25 | self.finished=True 26 | break # Stop if mouse button pressed! 27 | if buttons&XSIGN: 28 | dx-=256 29 | if buttons&YSIGN: 30 | dy-=256 31 | self.x+=dx 32 | self.y+=dy 33 | if self.x<0: self.x=0 34 | if self.y<0: self.y=0 35 | self.x=min(self.x,self.width) 36 | self.y=min(self.y,self.height) 37 | print self.x,self.y 38 | 39 | def start_mouse(): 40 | """Start a thread to read the PS2 mouse stream. 41 | 42 | Returns a mouse object, can get m.x and m.y mouse position""" 43 | m=MouseThread() 44 | m.start() 45 | return m 46 | -------------------------------------------------------------------------------- /pyopengles.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012 Peter de Rivaz 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted. 6 | # 7 | # Raspberry Pi 3d demo using OpenGLES 2.0 via Python 8 | # 9 | # Version 0.1 (Draws a rectangle using vertex and fragment shaders) 10 | # Version 0.2 (Draws a Julia set on top of a Mandelbrot controlled by the mouse. Mandelbrot rendered to texture in advance. 11 | 12 | import ctypes 13 | import time 14 | import math 15 | # Pick up our constants extracted from the header files with prepare_constants.py 16 | from egl import * 17 | from gl2 import * 18 | from gl2ext import * 19 | import pymouse 20 | 21 | # Define verbose=True to get debug messages 22 | verbose = True 23 | 24 | # Define some extra constants that the automatic extraction misses 25 | EGL_DEFAULT_DISPLAY = 0 26 | EGL_NO_CONTEXT = 0 27 | EGL_NO_DISPLAY = 0 28 | EGL_NO_SURFACE = 0 29 | DISPMANX_PROTECTION_NONE = 0 30 | 31 | # Open the libraries 32 | bcm = ctypes.CDLL('libbcm_host.so') 33 | opengles = ctypes.CDLL('libGLESv2.so') 34 | openegl = ctypes.CDLL('libEGL.so') 35 | 36 | eglint = ctypes.c_int 37 | 38 | eglshort = ctypes.c_short 39 | 40 | def eglints(L): 41 | """Converts a tuple to an array of eglints (would a pointer return be better?)""" 42 | return (eglint*len(L))(*L) 43 | 44 | eglfloat = ctypes.c_float 45 | 46 | def eglfloats(L): 47 | return (eglfloat*len(L))(*L) 48 | 49 | def check(e): 50 | """Checks that error is zero""" 51 | if e==0: return 52 | if verbose: 53 | print 'Error code',hex(e&0xffffffff) 54 | raise ValueError 55 | 56 | class EGL(object): 57 | 58 | def __init__(self,depthbuffer=False): 59 | """Opens up the OpenGL library and prepares a window for display""" 60 | b = bcm.bcm_host_init() 61 | assert b==0 62 | self.display = openegl.eglGetDisplay(EGL_DEFAULT_DISPLAY) 63 | assert self.display 64 | r = openegl.eglInitialize(self.display,0,0) 65 | assert r 66 | if depthbuffer: 67 | attribute_list = eglints( (EGL_RED_SIZE, 8, 68 | EGL_GREEN_SIZE, 8, 69 | EGL_BLUE_SIZE, 8, 70 | EGL_ALPHA_SIZE, 8, 71 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, 72 | EGL_DEPTH_SIZE, 16, 73 | EGL_NONE) ) 74 | else: 75 | attribute_list = eglints( (EGL_RED_SIZE, 8, 76 | EGL_GREEN_SIZE, 8, 77 | EGL_BLUE_SIZE, 8, 78 | EGL_ALPHA_SIZE, 8, 79 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, 80 | EGL_NONE) ) 81 | # EGL_SAMPLE_BUFFERS, 1, 82 | # EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, 83 | 84 | numconfig = eglint() 85 | config = ctypes.c_void_p() 86 | r = openegl.eglChooseConfig(self.display, 87 | ctypes.byref(attribute_list), 88 | ctypes.byref(config), 1, 89 | ctypes.byref(numconfig)); 90 | assert r 91 | r = openegl.eglBindAPI(EGL_OPENGL_ES_API) 92 | assert r 93 | if verbose: 94 | print 'numconfig=',numconfig 95 | context_attribs = eglints( (EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE) ) 96 | self.context = openegl.eglCreateContext(self.display, config, 97 | EGL_NO_CONTEXT, 98 | ctypes.byref(context_attribs)) 99 | assert self.context != EGL_NO_CONTEXT 100 | width = eglint() 101 | height = eglint() 102 | s = bcm.graphics_get_display_size(0,ctypes.byref(width),ctypes.byref(height)) 103 | self.width = width 104 | self.height = height 105 | assert s>=0 106 | dispman_display = bcm.vc_dispmanx_display_open(0) 107 | dispman_update = bcm.vc_dispmanx_update_start( 0 ) 108 | dst_rect = eglints( (0,0,width.value,height.value) ) 109 | src_rect = eglints( (0,0,width.value<<16, height.value<<16) ) 110 | assert dispman_update 111 | assert dispman_display 112 | dispman_element = bcm.vc_dispmanx_element_add ( dispman_update, dispman_display, 113 | 0, ctypes.byref(dst_rect), 0, 114 | ctypes.byref(src_rect), 115 | DISPMANX_PROTECTION_NONE, 116 | 0 , 0, 0) 117 | bcm.vc_dispmanx_update_submit_sync( dispman_update ) 118 | nativewindow = eglints((dispman_element,width,height)); 119 | nw_p = ctypes.pointer(nativewindow) 120 | self.nw_p = nw_p 121 | self.surface = openegl.eglCreateWindowSurface( self.display, config, nw_p, 0) 122 | assert self.surface != EGL_NO_SURFACE 123 | r = openegl.eglMakeCurrent(self.display, self.surface, self.surface, self.context) 124 | assert r 125 | 126 | class demo(): 127 | 128 | def showlog(self,shader): 129 | """Prints the compile log for a shader""" 130 | N=1024 131 | log=(ctypes.c_char*N)() 132 | loglen=ctypes.c_int() 133 | opengles.glGetShaderInfoLog(shader,N,ctypes.byref(loglen),ctypes.byref(log)) 134 | print log.value 135 | 136 | def showprogramlog(self,shader): 137 | """Prints the compile log for a program""" 138 | N=1024 139 | log=(ctypes.c_char*N)() 140 | loglen=ctypes.c_int() 141 | opengles.glGetProgramInfoLog(shader,N,ctypes.byref(loglen),ctypes.byref(log)) 142 | print log.value 143 | 144 | def __init__(self): 145 | self.vertex_data = eglfloats((-1.0,-1.0,1.0,1.0, 146 | 1.0,-1.0,1.0,1.0, 147 | 1.0,1.0,1.0,1.0, 148 | -1.0,1.0,1.0,1.0)) 149 | self.vshader_source = ctypes.c_char_p( 150 | "attribute vec4 vertex;" 151 | "varying vec2 tcoord;" 152 | "void main(void) {" 153 | " vec4 pos = vertex;" 154 | " pos.xy*=0.9;" 155 | " gl_Position = pos;" 156 | " tcoord = vertex.xy*0.5+0.5;" 157 | "}") 158 | 159 | self.fshader_source = ctypes.c_char_p( 160 | "uniform vec4 color;" 161 | "void main(void) {" 162 | " gl_FragColor = color;" 163 | "}") 164 | 165 | # Mandelbrot 166 | mandelbrot_fshader_source = ctypes.c_char_p(""" 167 | uniform vec4 color; 168 | uniform vec2 scale; 169 | varying vec2 tcoord; 170 | void main(void) { 171 | float intensity; 172 | vec4 color2; 173 | float cr=(gl_FragCoord.x-810.0)*scale.x; //0.0005; 174 | float ci=(gl_FragCoord.y-540.0)*scale.y; //0.0005; 175 | 176 | float ar=cr; 177 | float ai=ci; 178 | 179 | float tr,ti; 180 | float col=0.0; 181 | float p=0.0; 182 | int i=0; 183 | 184 | for(int i2=1;i2<16;i2++) 185 | { 186 | tr=ar*ar-ai*ai+cr; 187 | ti=2.0*ar*ai+ci; 188 | p=tr*tr+ti*ti; 189 | ar=tr; 190 | ai=ti; 191 | if (p>16.0) 192 | { 193 | i=i2; 194 | break; 195 | } 196 | 197 | } 198 | color2 = vec4(float(i)*0.0625,0,0,1); 199 | gl_FragColor = color2; 200 | }""") 201 | 202 | # Julia 203 | julia_fshader_source = ctypes.c_char_p(""" 204 | uniform vec4 color; 205 | uniform vec2 scale; 206 | uniform vec2 offset; 207 | varying vec2 tcoord; 208 | uniform sampler2D tex; 209 | void main(void) { 210 | float intensity; 211 | vec4 color2; 212 | float ar=(gl_FragCoord.x-810.0)*scale.x; 213 | float ai=(gl_FragCoord.y-540.0)*scale.y; 214 | 215 | float cr=(offset.x-810.0)*scale.x; 216 | float ci=(offset.y-540.0)*scale.y; 217 | 218 | float tr,ti; 219 | float col=0.0; 220 | float p=0.0; 221 | int i=0; 222 | int j=0; 223 | vec2 t2; 224 | 225 | t2.x=tcoord.x+(offset.x-810.0)*(1.0/1920.0); 226 | t2.y=tcoord.y+(offset.y-540.0)*(1.0/1080.0); 227 | 228 | for(int i2=1;i2<16;i2++) 229 | { 230 | tr=ar*ar-ai*ai+cr; 231 | ti=2.0*ar*ai+ci; 232 | p=tr*tr+ti*ti; 233 | ar=tr; 234 | ai=ti; 235 | if (p>16.0) 236 | { 237 | i=i2; 238 | break; 239 | } 240 | } 241 | 242 | col=float(j)*(0.005); 243 | color2 = vec4(col,float(i)*0.0625,0,1); 244 | color2 = color2+texture2D(tex,t2); 245 | gl_FragColor = color2; 246 | }""") 247 | 248 | vshader = opengles.glCreateShader(GL_VERTEX_SHADER); 249 | opengles.glShaderSource(vshader, 1, ctypes.byref(self.vshader_source), 0) 250 | opengles.glCompileShader(vshader); 251 | 252 | if verbose: 253 | self.showlog(vshader) 254 | 255 | fshader = opengles.glCreateShader(GL_FRAGMENT_SHADER); 256 | opengles.glShaderSource(fshader, 1, ctypes.byref(julia_fshader_source), 0); 257 | opengles.glCompileShader(fshader); 258 | 259 | if verbose: 260 | self.showlog(fshader) 261 | 262 | mshader = opengles.glCreateShader(GL_FRAGMENT_SHADER); 263 | opengles.glShaderSource(mshader, 1, ctypes.byref(mandelbrot_fshader_source), 0); 264 | opengles.glCompileShader(mshader); 265 | 266 | if verbose: 267 | self.showlog(mshader) 268 | 269 | program = opengles.glCreateProgram(); 270 | opengles.glAttachShader(program, vshader); 271 | opengles.glAttachShader(program, fshader); 272 | opengles.glLinkProgram(program); 273 | 274 | if verbose: 275 | self.showprogramlog(program) 276 | 277 | self.program = program 278 | self.unif_color = opengles.glGetUniformLocation(program, "color"); 279 | self.attr_vertex = opengles.glGetAttribLocation(program, "vertex"); 280 | self.unif_scale = opengles.glGetUniformLocation(program, "scale"); 281 | self.unif_offset = opengles.glGetUniformLocation(program, "offset"); 282 | self.unif_tex = opengles.glGetUniformLocation(program, "tex"); 283 | 284 | 285 | program2 = opengles.glCreateProgram(); 286 | opengles.glAttachShader(program2, vshader); 287 | opengles.glAttachShader(program2, mshader); 288 | opengles.glLinkProgram(program2); 289 | 290 | if verbose: 291 | self.showprogramlog(program2) 292 | 293 | self.program2 = program2 294 | self.attr_vertex2 = opengles.glGetAttribLocation(program2, "vertex"); 295 | self.unif_scale2 = opengles.glGetUniformLocation(program2, "scale"); 296 | self.unif_offset2 = opengles.glGetUniformLocation(program2, "offset"); 297 | 298 | opengles.glClearColor ( eglfloat(0.0), eglfloat(1.0), eglfloat(1.0), eglfloat(1.0) ); 299 | 300 | self.buf=eglint() 301 | opengles.glGenBuffers(1,ctypes.byref(self.buf)) 302 | 303 | self.check() 304 | 305 | # Prepare a texture image 306 | self.tex=eglint() 307 | self.check() 308 | opengles.glGenTextures(1,ctypes.byref(self.tex)) 309 | self.check() 310 | opengles.glBindTexture(GL_TEXTURE_2D,self.tex) 311 | self.check() 312 | # opengles.glActiveTexture(0) 313 | #test_tex=(eglshort*(1920*1080))(*([3567]*20000)) 314 | #test_tex_p = ctypes.pointer(test_tex) 315 | #self.store=[test_tex,test_tex_p] 316 | opengles.glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,1920,1080,0,GL_RGB,GL_UNSIGNED_SHORT_5_6_5,0) 317 | #opengles.glTexImage2D(GL_TEXTURE_2D,0,1920,1080,0,GL_RGB,GL_UNSIGNED_BYTE,0) 318 | self.check() 319 | opengles.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, eglfloat(GL_NEAREST)) 320 | opengles.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, eglfloat(GL_NEAREST)) 321 | self.check() 322 | # Prepare a framebuffer for rendering 323 | self.tex_fb=eglint() 324 | opengles.glGenFramebuffers(1,ctypes.byref(self.tex_fb)) 325 | self.check() 326 | opengles.glBindFramebuffer(GL_FRAMEBUFFER,self.tex_fb) 327 | self.check() 328 | opengles.glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,self.tex,0) 329 | self.check() 330 | opengles.glBindFramebuffer(GL_FRAMEBUFFER,0) 331 | self.check() 332 | # Prepare viewport 333 | opengles.glViewport ( 0, 0, egl.width, egl.height ); 334 | self.check() 335 | 336 | # Upload vertex data to a buffer 337 | opengles.glBindBuffer(GL_ARRAY_BUFFER, self.buf); 338 | opengles.glBufferData(GL_ARRAY_BUFFER, ctypes.sizeof(self.vertex_data), 339 | ctypes.byref(self.vertex_data), GL_STATIC_DRAW); 340 | opengles.glVertexAttribPointer(self.attr_vertex, 4, GL_FLOAT, 0, 16, 0); 341 | opengles.glEnableVertexAttribArray(self.attr_vertex); 342 | self.check() 343 | 344 | def draw_mandelbrot_to_texture(self,scale): 345 | # Draw the mandelbrot to a texture 346 | opengles.glBindFramebuffer(GL_FRAMEBUFFER,self.tex_fb) 347 | self.check() 348 | opengles.glBindBuffer(GL_ARRAY_BUFFER, self.buf); 349 | 350 | opengles.glUseProgram ( self.program2 ); 351 | self.check() 352 | 353 | opengles.glUniform2f(self.unif_scale2, eglfloat(scale), eglfloat(scale)); 354 | self.check() 355 | #opengles.glUniform2f(self.unif_offset2, eglfloat(offset[0]), eglfloat(offset[1])); 356 | #self.check() 357 | opengles.glDrawArrays ( GL_TRIANGLE_FAN, 0, 4 ); 358 | self.check() 359 | 360 | opengles.glFlush() 361 | opengles.glFinish() 362 | self.check() 363 | 364 | def draw_triangles(self,scale=0.0005,offset=(0.2,0.3)): 365 | 366 | # Now render to the main frame buffer 367 | opengles.glBindFramebuffer(GL_FRAMEBUFFER,0) 368 | # Clear the background (not really necessary I suppose) 369 | opengles.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 370 | self.check() 371 | 372 | opengles.glBindBuffer(GL_ARRAY_BUFFER, self.buf); 373 | self.check() 374 | opengles.glUseProgram ( self.program ); 375 | self.check() 376 | opengles.glBindTexture(GL_TEXTURE_2D,self.tex) 377 | self.check() 378 | opengles.glUniform4f(self.unif_color, eglfloat(0.5), eglfloat(0.5), eglfloat(0.8), eglfloat(1.0)); 379 | self.check() 380 | opengles.glUniform2f(self.unif_scale, eglfloat(scale), eglfloat(scale)); 381 | self.check() 382 | opengles.glUniform2f(self.unif_offset, eglfloat(offset[0]), eglfloat(offset[1])); 383 | self.check() 384 | opengles.glUniform1i(self.unif_tex, 0); # I don't really understand this part, perhaps it relates to active texture? 385 | self.check() 386 | 387 | opengles.glDrawArrays ( GL_TRIANGLE_FAN, 0, 4 ); 388 | self.check() 389 | 390 | opengles.glBindBuffer(GL_ARRAY_BUFFER, 0); 391 | 392 | opengles.glFlush() 393 | opengles.glFinish() 394 | self.check() 395 | 396 | openegl.eglSwapBuffers(egl.display, egl.surface); 397 | self.check() 398 | 399 | def check(self): 400 | e=opengles.glGetError() 401 | if e: 402 | print hex(e) 403 | raise ValueError 404 | 405 | def showerror(): 406 | e=opengles.glGetError() 407 | print hex(e) 408 | 409 | if __name__ == "__main__": 410 | egl = EGL() 411 | d = demo() 412 | d.draw_mandelbrot_to_texture(0.003) 413 | m=pymouse.start_mouse() 414 | while 1: 415 | #offset=(400,600) 416 | offset=(m.x,m.y) 417 | d.draw_triangles(0.003,offset) 418 | time.sleep(0.01) 419 | if m.finished: 420 | break 421 | showerror() 422 | 423 | 424 | 425 | 426 | --------------------------------------------------------------------------------