PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/gles_header.pas

https://bitbucket.org/carli/gles-headers
Pascal | 819 lines | 639 code | 74 blank | 106 comment | 148 complexity | 9fe15737e8a92dbfae00918d0220c47b MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1{
  2Copyright (c) 2010, Carl-Philip H?nsch
  3
  4Permission to use, copy, modify, and/or distribute this software for any purpose with or
  5without fee is hereby granted, provided that the above copyright notice and this permission
  6notice appear in all copies.
  7
  8THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  9SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 10THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
 11DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
 12CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
 13OR PERFORMANCE OF THIS SOFTWARE.
 14}
 15
 16
 17
 18{$MODE Delphi}
 19{$MACRO ON}
 20{$IFDEF Windows}
 21  {$DEFINE extdecl := stdcall}
 22{$ELSE}
 23  {$DEFINE extdecl := cdecl}
 24  {$IFDEF MorphOS}
 25    {$INLINE ON}
 26    {$DEFINE GL_UNIT}
 27  {$ELSE}
 28    //{$LINKLIB c}
 29  {$ENDIF}
 30{$ENDIF}
 31
 32unit gles_header;
 33
 34interface
 35
 36type
 37	GLchar = char;
 38	GLenum = cardinal;        PGLenum = ^GLenum;
 39	GLboolean = cardinal;     PGLboolean = ^GLboolean;
 40	GLbitfield = cardinal;
 41	GLbyte = shortint;
 42	GLshort = smallint;
 43	GLint = integer;          PGLint = ^GLint;
 44  GLuint = cardinal;        PGLuint = ^GLuint;
 45	GLsizei = integer;        PGLsizei = ^GLsizei;
 46	GLubyte = byte;
 47	GLfloat = single;         PGLfloat = ^GLfloat;
 48	GLclampf = single;
 49	GLfixed = single;
 50
 51	GLintptr = ^GLint;
 52	GLsizeiptr = ^GLsizei;
 53
 54const GL_ES_VERSION_2_0 = 1;
 55      SDL_OPENGLES = $00000040; // f?r die gepatchte SDL-Version
 56      // herunterladbar von https://github.com/Cpasjuste/sdl-1.2.13_gles
 57
 58{ ClearBufferMask }
 59 GL_DEPTH_BUFFER_BIT =              $00000100;
 60 GL_STENCIL_BUFFER_BIT =            $00000400;
 61 GL_COLOR_BUFFER_BIT =              $00004000;
 62
 63{ Boolean }
 64 GL_FALSE =                         0;
 65 GL_TRUE =                          1;
 66
 67{ BeginMode }
 68 GL_POINTS =                        $0000;
 69 GL_LINES =                         $0001;
 70 GL_LINE_LOOP =                     $0002;
 71 GL_LINE_STRIP =                    $0003;
 72 GL_TRIANGLES =                     $0004;
 73 GL_TRIANGLE_STRIP =                $0005;
 74 GL_TRIANGLE_FAN =                  $0006;
 75
 76{ AlphaFunction (not supported in ES20) }
 77{      GL_NEVER }
 78{      GL_LESS }
 79{      GL_EQUAL }
 80{      GL_LEQUAL }
 81{      GL_GREATER }
 82{      GL_NOTEQUAL }
 83{      GL_GEQUAL }
 84{      GL_ALWAYS }
 85
 86{ BlendingFactorDest }
 87 GL_ZERO                          = 0;
 88 GL_ONE                           = 1;
 89 GL_SRC_COLOR                     = $0300;
 90 GL_ONE_MINUS_SRC_COLOR           = $0301;
 91 GL_SRC_ALPHA                     = $0302;
 92 GL_ONE_MINUS_SRC_ALPHA           = $0303;
 93 GL_DST_ALPHA                     = $0304;
 94 GL_ONE_MINUS_DST_ALPHA           = $0305;
 95
 96{ BlendingFactorSrc }
 97{      GL_ZERO }
 98{      GL_ONE }
 99 GL_DST_COLOR                     = $0306;
100 GL_ONE_MINUS_DST_COLOR           = $0307;
101 GL_SRC_ALPHA_SATURATE            = $0308;
102{      GL_SRC_ALPHA }
103{      GL_ONE_MINUS_SRC_ALPHA }
104{      GL_DST_ALPHA }
105{      GL_ONE_MINUS_DST_ALPHA }
106
107{ BlendEquationSeparate }
108 GL_FUNC_ADD                      = $8006;
109 GL_BLEND_EQUATION                = $8009;
110 GL_BLEND_EQUATION_RGB            = $8009;    { same as BLEND_EQUATION }
111 GL_BLEND_EQUATION_ALPHA          = $883D;
112
113{ BlendSubtract }
114 GL_FUNC_SUBTRACT                 = $800A;
115 GL_FUNC_REVERSE_SUBTRACT         = $800B;
116
117{ Separate Blend Functions }
118 GL_BLEND_DST_RGB                 = $80C8;
119 GL_BLEND_SRC_RGB                 = $80C9;
120 GL_BLEND_DST_ALPHA               = $80CA;
121 GL_BLEND_SRC_ALPHA               = $80CB;
122 GL_CONSTANT_COLOR                = $8001;
123 GL_ONE_MINUS_CONSTANT_COLOR      = $8002;
124 GL_CONSTANT_ALPHA                = $8003;
125 GL_ONE_MINUS_CONSTANT_ALPHA      = $8004;
126 GL_BLEND_COLOR                   = $8005;
127
128{ Buffer Objects }
129 GL_ARRAY_BUFFER                  = $8892;
130 GL_ELEMENT_ARRAY_BUFFER          = $8893;
131 GL_ARRAY_BUFFER_BINDING          = $8894;
132 GL_ELEMENT_ARRAY_BUFFER_BINDING  = $8895;
133
134 GL_STREAM_DRAW                   = $88E0;
135 GL_STATIC_DRAW                   = $88E4;
136 GL_DYNAMIC_DRAW                  = $88E8;
137
138 GL_BUFFER_SIZE                   = $8764;
139 GL_BUFFER_USAGE                  = $8765;
140
141 GL_CURRENT_VERTEX_ATTRIB         = $8626;
142
143{ CullFaceMode }
144 GL_FRONT                         = $0404;
145 GL_BACK                          = $0405;
146 GL_FRONT_AND_BACK                = $0408;
147
148{ DepthFunction }
149{      GL_NEVER }
150{      GL_LESS }
151{      GL_EQUAL }
152{      GL_LEQUAL }
153{      GL_GREATER }
154{      GL_NOTEQUAL }
155{      GL_GEQUAL }
156{      GL_ALWAYS }
157
158{ EnableCap }
159 GL_TEXTURE_2D                    = $0DE1;
160 GL_CULL_FACE                     = $0B44;
161 GL_BLEND                         = $0BE2;
162 GL_DITHER                        = $0BD0;
163 GL_STENCIL_TEST                  = $0B90;
164 GL_DEPTH_TEST                    = $0B71;
165 GL_SCISSOR_TEST                  = $0C11;
166 GL_POLYGON_OFFSET_FILL           = $8037;
167 GL_SAMPLE_ALPHA_TO_COVERAGE      = $809E;
168 GL_SAMPLE_COVERAGE               = $80A0;
169
170{ ErrorCode }
171 GL_NO_ERROR                      = 0;
172 GL_INVALID_ENUM                  = $0500;
173 GL_INVALID_VALUE                 = $0501;
174 GL_INVALID_OPERATION             = $0502;
175 GL_OUT_OF_MEMORY                 = $0505;
176
177{ FrontFaceDirection }
178 GL_CW                            = $0900;
179 GL_CCW                           = $0901;
180
181{ GetPName }
182 GL_LINE_WIDTH                    = $0B21;
183 GL_ALIASED_POINT_SIZE_RANGE      = $846D;
184 GL_ALIASED_LINE_WIDTH_RANGE      = $846E;
185 GL_CULL_FACE_MODE                = $0B45;
186 GL_FRONT_FACE                    = $0B46;
187 GL_DEPTH_RANGE                   = $0B70;
188 GL_DEPTH_WRITEMASK               = $0B72;
189 GL_DEPTH_CLEAR_VALUE             = $0B73;
190 GL_DEPTH_FUNC                    = $0B74;
191 GL_STENCIL_CLEAR_VALUE           = $0B91;
192 GL_STENCIL_FUNC                  = $0B92;
193 GL_STENCIL_FAIL                  = $0B94;
194 GL_STENCIL_PASS_DEPTH_FAIL       = $0B95;
195 GL_STENCIL_PASS_DEPTH_PASS       = $0B96;
196 GL_STENCIL_REF                   = $0B97;
197 GL_STENCIL_VALUE_MASK            = $0B93;
198 GL_STENCIL_WRITEMASK             = $0B98;
199 GL_STENCIL_BACK_FUNC             = $8800;
200 GL_STENCIL_BACK_FAIL             = $8801;
201 GL_STENCIL_BACK_PASS_DEPTH_FAIL  = $8802;
202 GL_STENCIL_BACK_PASS_DEPTH_PASS  = $8803;
203 GL_STENCIL_BACK_REF              = $8CA3;
204 GL_STENCIL_BACK_VALUE_MASK       = $8CA4;
205 GL_STENCIL_BACK_WRITEMASK        = $8CA5;
206 GL_VIEWPORT                      = $0BA2;
207 GL_SCISSOR_BOX                   = $0C10;
208{      GL_SCISSOR_TEST }
209 GL_COLOR_CLEAR_VALUE             = $0C22;
210 GL_COLOR_WRITEMASK               = $0C23;
211 GL_UNPACK_ALIGNMENT              = $0CF5;
212 GL_PACK_ALIGNMENT                = $0D05;
213 GL_MAX_TEXTURE_SIZE              = $0D33;
214 GL_MAX_VIEWPORT_DIMS             = $0D3A;
215 GL_SUBPIXEL_BITS                 = $0D50;
216 GL_RED_BITS                      = $0D52;
217 GL_GREEN_BITS                    = $0D53;
218 GL_BLUE_BITS                     = $0D54;
219 GL_ALPHA_BITS                    = $0D55;
220 GL_DEPTH_BITS                    = $0D56;
221 GL_STENCIL_BITS                  = $0D57;
222 GL_POLYGON_OFFSET_UNITS          = $2A00;
223{      GL_POLYGON_OFFSET_FILL }
224 GL_POLYGON_OFFSET_FACTOR         = $8038;
225 GL_TEXTURE_BINDING_2D            = $8069;
226 GL_SAMPLE_BUFFERS                = $80A8;
227 GL_SAMPLES                       = $80A9;
228 GL_SAMPLE_COVERAGE_VALUE         = $80AA;
229 GL_SAMPLE_COVERAGE_INVERT        = $80AB;
230
231{ GetTextureParameter }
232{      GL_TEXTURE_MAG_FILTER }
233{      GL_TEXTURE_MIN_FILTER }
234{      GL_TEXTURE_WRAP_S }
235{      GL_TEXTURE_WRAP_T }
236
237 GL_NUM_COMPRESSED_TEXTURE_FORMATS =$86A2;
238 GL_COMPRESSED_TEXTURE_FORMATS     =$86A3;
239
240{ HintMode }
241 GL_DONT_CARE                     = $1100;
242 GL_FASTEST                       = $1101;
243 GL_NICEST                        = $1102;
244
245{ HintTarget }
246 GL_GENERATE_MIPMAP_HINT           = $8192;
247
248{ DataType }
249 GL_BYTE                          = $1400;
250 GL_UNSIGNED_BYTE                 = $1401;
251 GL_SHORT                         = $1402;
252 GL_UNSIGNED_SHORT                = $1403;
253 GL_INT                           = $1404;
254 GL_UNSIGNED_INT                  = $1405;
255 GL_FLOAT                         = $1406;
256 GL_FIXED                         = $140C;
257
258{ PixelFormat }
259 GL_DEPTH_COMPONENT               = $1902;
260 GL_ALPHA                         = $1906;
261 GL_RGB                           = $1907;
262 GL_RGBA                          = $1908;
263 GL_LUMINANCE                     = $1909;
264 GL_LUMINANCE_ALPHA               = $190A;
265
266{ PixelType }
267{      GL_UNSIGNED_BYTE }
268 GL_UNSIGNED_SHORT_4_4_4_4       = $8033;
269 GL_UNSIGNED_SHORT_5_5_5_1       = $8034;
270 GL_UNSIGNED_SHORT_5_6_5         = $8363;
271
272{ Shaders }
273 GL_FRAGMENT_SHADER                = $8B30;
274 GL_VERTEX_SHADER                  = $8B31;
275 GL_MAX_VERTEX_ATTRIBS             = $8869;
276 GL_MAX_VERTEX_UNIFORM_VECTORS     = $8DFB;
277 GL_MAX_VARYING_VECTORS            = $8DFC;
278 GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS =$8B4D;
279 GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = $8B4C;
280 GL_MAX_TEXTURE_IMAGE_UNITS        = $8872;
281 GL_MAX_FRAGMENT_UNIFORM_VECTORS   = $8DFD;
282 GL_SHADER_TYPE                    = $8B4F;
283 GL_DELETE_STATUS                  = $8B80;
284 GL_LINK_STATUS                    = $8B82;
285 GL_VALIDATE_STATUS                = $8B83;
286 GL_ATTACHED_SHADERS               = $8B85;
287 GL_ACTIVE_UNIFORMS                = $8B86;
288 GL_ACTIVE_UNIFORM_MAX_LENGTH      = $8B87;
289 GL_ACTIVE_ATTRIBUTES              = $8B89;
290 GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    = $8B8A;
291 GL_SHADING_LANGUAGE_VERSION       = $8B8C;
292 GL_CURRENT_PROGRAM                = $8B8D;
293
294{ StencilFunction }
295 GL_NEVER                        = $0200;
296 GL_LESS                         = $0201;
297 GL_EQUAL                        = $0202;
298 GL_LEQUAL                       = $0203;
299 GL_GREATER                      = $0204;
300 GL_NOTEQUAL                     = $0205;
301 GL_GEQUAL                       = $0206;
302 GL_ALWAYS                       = $0207;
303
304{ StencilOp }
305{      GL_ZERO }
306 GL_KEEP                         = $1E00;
307 GL_REPLACE                      = $1E01;
308 GL_INCR                         = $1E02;
309 GL_DECR                         = $1E03;
310 GL_INVERT                       = $150A;
311 GL_INCR_WRAP                    = $8507;
312 GL_DECR_WRAP                    = $8508;
313
314{ StringName }
315 GL_VENDOR                       = $1F00;
316 GL_RENDERER                     = $1F01;
317 GL_VERSION                      = $1F02;
318 GL_EXTENSIONS                   = $1F03;
319
320{ TextureMagFilter }
321 GL_NEAREST                      = $2600;
322 GL_LINEAR                       = $2601;
323
324{ TextureMinFilter }
325{      GL_NEAREST }
326{      GL_LINEAR }
327 GL_NEAREST_MIPMAP_NEAREST       = $2700;
328 GL_LINEAR_MIPMAP_NEAREST        = $2701;
329 GL_NEAREST_MIPMAP_LINEAR        = $2702;
330 GL_LINEAR_MIPMAP_LINEAR         = $2703;
331
332{ TextureParameterName }
333 GL_TEXTURE_MAG_FILTER           = $2800;
334 GL_TEXTURE_MIN_FILTER           = $2801;
335 GL_TEXTURE_WRAP_S               = $2802;
336 GL_TEXTURE_WRAP_T               = $2803;
337
338{ TextureTarget }
339{      GL_TEXTURE_2D }
340 GL_TEXTURE                      = $1702;
341
342 GL_TEXTURE_CUBE_MAP             = $8513;
343 GL_TEXTURE_BINDING_CUBE_MAP     = $8514;
344 GL_TEXTURE_CUBE_MAP_POSITIVE_X  = $8515;
345 GL_TEXTURE_CUBE_MAP_NEGATIVE_X  = $8516;
346 GL_TEXTURE_CUBE_MAP_POSITIVE_Y  = $8517;
347 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y  = $8518;
348 GL_TEXTURE_CUBE_MAP_POSITIVE_Z  = $8519;
349 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z  = $851A;
350 GL_MAX_CUBE_MAP_TEXTURE_SIZE    = $851C;
351
352{ TextureUnit }
353 GL_TEXTURE0                     = $84C0;
354 GL_TEXTURE1                     = $84C1;
355 GL_TEXTURE2                     = $84C2;
356 GL_TEXTURE3                     = $84C3;
357 GL_TEXTURE4                     = $84C4;
358 GL_TEXTURE5                     = $84C5;
359 GL_TEXTURE6                     = $84C6;
360 GL_TEXTURE7                     = $84C7;
361 GL_TEXTURE8                     = $84C8;
362 GL_TEXTURE9                     = $84C9;
363 GL_TEXTURE10                    = $84CA;
364 GL_TEXTURE11                    = $84CB;
365 GL_TEXTURE12                    = $84CC;
366 GL_TEXTURE13                    = $84CD;
367 GL_TEXTURE14                    = $84CE;
368 GL_TEXTURE15                    = $84CF;
369 GL_TEXTURE16                    = $84D0;
370 GL_TEXTURE17                    = $84D1;
371 GL_TEXTURE18                    = $84D2;
372 GL_TEXTURE19                    = $84D3;
373 GL_TEXTURE20                    = $84D4;
374 GL_TEXTURE21                    = $84D5;
375 GL_TEXTURE22                    = $84D6;
376 GL_TEXTURE23                    = $84D7;
377 GL_TEXTURE24                    = $84D8;
378 GL_TEXTURE25                    = $84D9;
379 GL_TEXTURE26                    = $84DA;
380 GL_TEXTURE27                    = $84DB;
381 GL_TEXTURE28                    = $84DC;
382 GL_TEXTURE29                    = $84DD;
383 GL_TEXTURE30                    = $84DE;
384 GL_TEXTURE31                    = $84DF;
385 GL_ACTIVE_TEXTURE               = $84E0;
386
387{ TextureWrapMode }
388 GL_REPEAT                       = $2901;
389 GL_CLAMP_TO_EDGE                = $812F;
390 GL_MIRRORED_REPEAT              = $8370;
391
392{ Uniform Types }
393 GL_FLOAT_VEC2                   = $8B50;
394 GL_FLOAT_VEC3                   = $8B51;
395 GL_FLOAT_VEC4                   = $8B52;
396 GL_INT_VEC2                     = $8B53;
397 GL_INT_VEC3                     = $8B54;
398 GL_INT_VEC4                     = $8B55;
399 GL_BOOL                         = $8B56;
400 GL_BOOL_VEC2                    = $8B57;
401 GL_BOOL_VEC3                    = $8B58;
402 GL_BOOL_VEC4                    = $8B59;
403 GL_FLOAT_MAT2                   = $8B5A;
404 GL_FLOAT_MAT3                   = $8B5B;
405 GL_FLOAT_MAT4                   = $8B5C;
406 GL_SAMPLER_2D                   = $8B5E;
407 GL_SAMPLER_CUBE                 = $8B60;
408
409{ Vertex Arrays }
410 GL_VERTEX_ATTRIB_ARRAY_ENABLED      = $8622;
411 GL_VERTEX_ATTRIB_ARRAY_SIZE         = $8623;
412 GL_VERTEX_ATTRIB_ARRAY_STRIDE       = $8624;
413 GL_VERTEX_ATTRIB_ARRAY_TYPE         = $8625;
414 GL_VERTEX_ATTRIB_ARRAY_NORMALIZED   = $886A;
415 GL_VERTEX_ATTRIB_ARRAY_POINTER      = $8645;
416 GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING =$889F;
417
418{ Read Format }
419 GL_IMPLEMENTATION_COLOR_READ_TYPE = $8B9A;
420 GL_IMPLEMENTATION_COLOR_READ_FORMAT =$8B9B;
421
422{ Shader Source }
423 GL_COMPILE_STATUS               = $8B81;
424 GL_INFO_LOG_LENGTH              = $8B84;
425 GL_SHADER_SOURCE_LENGTH         = $8B88;
426 GL_SHADER_COMPILER              = $8DFA;
427
428{ Shader Binary }
429 GL_SHADER_BINARY_FORMATS        = $8DF8;
430 GL_NUM_SHADER_BINARY_FORMATS    = $8DF9;
431
432{ Shader Precision-Specified Types }
433 GL_LOW_FLOAT                    = $8DF0;
434 GL_MEDIUM_FLOAT                 = $8DF1;
435 GL_HIGH_FLOAT                   = $8DF2;
436 GL_LOW_INT                      = $8DF3;
437 GL_MEDIUM_INT                   = $8DF4;
438 GL_HIGH_INT                     = $8DF5;
439
440{ Framebuffer Object. }
441 GL_FRAMEBUFFER                  = $8D40;
442 GL_RENDERBUFFER                 = $8D41;
443
444 GL_RGBA4                        = $8056;
445 GL_RGB5_A1                      = $8057;
446 GL_RGB565                       = $8D62;
447 GL_DEPTH_COMPONENT16            = $81A5;
448 GL_STENCIL_INDEX                = $1901;
449 GL_STENCIL_INDEX8               = $8D48;
450
451 GL_RENDERBUFFER_WIDTH           = $8D42;
452 GL_RENDERBUFFER_HEIGHT          = $8D43;
453 GL_RENDERBUFFER_INTERNAL_FORMAT = $8D44;
454 GL_RENDERBUFFER_RED_SIZE        = $8D50;
455 GL_RENDERBUFFER_GREEN_SIZE      = $8D51;
456 GL_RENDERBUFFER_BLUE_SIZE       = $8D52;
457 GL_RENDERBUFFER_ALPHA_SIZE      = $8D53;
458 GL_RENDERBUFFER_DEPTH_SIZE      = $8D54;
459 GL_RENDERBUFFER_STENCIL_SIZE    = $8D55;
460
461 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE         = $8CD0;
462 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME         = $8CD1;
463 GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL       = $8CD2;
464 GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE =$8CD3;
465
466 GL_COLOR_ATTACHMENT0            = $8CE0;
467 GL_DEPTH_ATTACHMENT             = $8D00;
468 GL_STENCIL_ATTACHMENT           = $8D20;
469
470 GL_NONE                         = 0;
471
472 GL_FRAMEBUFFER_COMPLETE                    = $8CD5;
473 GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT       = $8CD6;
474 GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT =$8CD7;
475 GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS       = $8CD9;
476 GL_FRAMEBUFFER_UNSUPPORTED                 = $8CDD;
477
478 GL_FRAMEBUFFER_BINDING          = $8CA6;
479 GL_RENDERBUFFER_BINDING         = $8CA7;
480 GL_MAX_RENDERBUFFER_SIZE        = $84E8;
481
482 GL_INVALID_FRAMEBUFFER_OPERATION= $0506;
483 
484var 
485
486{-------------------------------------------------------------------------
487 * GL core functions.
488 *-----------------------------------------------------------------------}
489 
490
491
492  glActiveTexture: procedure (texture: GLenum); extdecl;
493  glAttachShader: procedure (prog: GLuint; shader: GLuint); extdecl;
494  glBindAttribLocation: procedure (prog: GLuint; index: GLuint; name: pchar); extdecl;
495  glBindBuffer: procedure (target: GLenum; buffer: GLuint); extdecl;
496  glBindFramebuffer: procedure (target: GLenum; framebuffer: GLuint); extdecl;
497  glBindRenderbuffer: procedure (target: GLenum; renderbuffer: GLuint); extdecl;
498  glBindTexture: procedure (target: GLenum; texture: GLuint); extdecl;
499  glBlendColor: procedure (red: GLclampf; green: GLclampf; blue: GLclampf; alpha: GLclampf); extdecl;
500  glBlendEquation: procedure (mode: GLenum); extdecl;
501  glBlendEquationSeparate: procedure (modeRGB: GLenum; modeAlpha: GLenum); extdecl;
502  glBlendFunc: procedure (sfactor: GLenum; dfactor: GLenum); extdecl;
503  glBlendFuncSeparate: procedure (srcRGB: GLenum; dstRGB: GLenum; srcAlpha: GLenum; dstAlpha: GLenum); extdecl;
504  glBufferData: procedure (target: GLenum; size: GLsizeiptr; data: pointer; usage: GLenum); extdecl;
505  glBufferSubData: procedure (target: GLenum; offset: GLintptr; size: GLsizeiptr; data: pointer); extdecl;
506  glCheckFramebufferStatus: function (target: GLenum): GLenum; extdecl;
507  glClear: procedure (mask: GLbitfield); extdecl;
508  glClearColor: procedure (red: GLclampf; green: GLclampf; blue: GLclampf; alpha: GLclampf); extdecl;
509  glClearDepthf: procedure (depth: GLclampf); extdecl;
510  glClearStencil: procedure (s: GLint); extdecl;
511  glColorMask: procedure (red: GLboolean; green: GLboolean; blue: GLboolean; alpha: GLboolean); extdecl;
512  glCompileShader: procedure (shader: GLuint); extdecl;
513  glCompressedTexImage2D: procedure (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; height: GLsizei; border: GLint; imageSize: GLsizei; data: pointer); extdecl;
514  glCompressedTexSubImage2D: procedure (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; format: GLenum; imageSize: GLsizei; data: pointer); extdecl;
515  glCopyTexImage2D: procedure (target: GLenum; level: GLint; internalformat: GLenum; x: GLint; y: GLint; width: GLsizei; height: GLsizei; border: GLint); extdecl;
516  glCopyTexSubImage2D: procedure (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; x: GLint; y: GLint; width: GLsizei; height: GLsizei); extdecl;
517  glCreateProgram: function: GLuint; extdecl;
518  glCreateShader: function (typ: GLenum): GLuint; extdecl;
519  glCullFace: procedure (mode: GLenum); extdecl;
520  glDeleteBuffers: procedure (n: GLsizei; const buffers: PGLuint); extdecl;
521  glDeleteFramebuffers: procedure (n: GLsizei; const framebuffers: PGLuint); extdecl;
522  glDeleteProgram: procedure (prog: GLuint); extdecl;
523  glDeleteRenderbuffers: procedure (n: GLsizei; const renderbuffers: PGLuint); extdecl;
524  glDeleteShader: procedure (shader: GLuint); extdecl;
525  glDeleteTextures: procedure (n: GLsizei; const textures: PGLuint); extdecl;
526  glDepthFunc: procedure (func: GLenum); extdecl;
527  glDepthMask: procedure (flag: GLboolean); extdecl;
528  glDepthRangef: procedure (zNear: GLclampf; zFar: GLclampf); extdecl;
529  glDetachShader: procedure (prog: GLuint; shader: GLuint); extdecl;
530  glDisable: procedure (cap: GLenum); extdecl;
531  glDisableVertexAttribArray: procedure (index: GLuint); extdecl;
532  glDrawArrays: procedure (mode: GLenum; first: GLint; count: GLsizei); extdecl;
533  glDrawElements: procedure (mode: GLenum; count: GLsizei; typ: GLenum; const indices: PGLuint); extdecl;
534  glEnable: procedure (cap: GLenum); extdecl;
535  glEnableVertexAttribArray: procedure (index: GLuint); extdecl;
536  glFinish: procedure; extdecl;
537  glFlush: procedure; extdecl;
538  glFramebufferRenderbuffer: procedure (target: GLenum; attachment: GLenum; renderbuffertarget: GLenum; renderbuffer: GLuint); extdecl;
539  glFramebufferTexture2D: procedure (target: GLenum; attachment: GLenum; textarget: GLenum; texture: GLuint; level: GLint); extdecl;
540  glFrontFace: procedure (mode: GLenum); extdecl;
541  glGenBuffers: procedure (n: GLsizei; buffers: PGLuint); extdecl;
542  glGenerateMipmap: procedure (target: GLenum); extdecl;
543  glGenFramebuffers: procedure (n: GLsizei; framebuffers: PGLuint); extdecl;
544  glGenRenderbuffers: procedure (n: GLsizei; renderbuffers: PGLuint); extdecl;
545  glGenTextures: procedure (n: GLsizei; textures: PGLuint); extdecl;
546  glGetActiveAttrib: procedure (prog: GLuint; index: GLuint; bufsize: GLsizei; length: PGLsizei; size: PGLint; typ: PGLenum; name: pchar); extdecl;
547  glGetActiveUniform: procedure (prog: GLuint; index: GLuint; bufsize: GLsizei; length: PGLsizei; size: PGLint; typ: PGLenum; name: pchar); extdecl;
548  glGetAttachedShaders: procedure (prog: GLuint; maxcount: GLsizei; count: PGLsizei; shaders: GLuint); extdecl;
549  glGetAttribLocation: function (prog: GLuint; name: pchar): integer; extdecl;
550  glGetBooleanv: procedure (pname: GLenum; params: PGLboolean); extdecl;
551  glGetBufferParameteriv: procedure (target: GLenum; pname: GLenum; params: PGLint); extdecl;
552  glGetError: function: GLenum; extdecl;
553  glGetFloatv: procedure (pname: GLenum; params: PGLfloat); extdecl;
554  glGetFramebufferAttachmentParameteriv: procedure (target: GLenum; attachment: GLenum; pname: GLenum; params: PGLint); extdecl;
555  glGetIntegerv: procedure (pname: GLenum; params: PGLint); extdecl;
556  glGetProgramiv: procedure (prog: GLuint; pname: GLenum; params: PGLint); extdecl;
557  glGetProgramInfoLog: procedure (prog: GLuint; bufsize: GLsizei; length: PGLsizei; infolog: pchar); extdecl;
558  glGetRenderbufferParameteriv: procedure (target: GLenum; pname: GLenum; params: PGLint); extdecl;
559  glGetShaderiv: procedure (shader: GLuint; pnname: GLenum; params: PGLint); extdecl;
560  glGetShaderInfoLog: procedure (shader: GLuint; bufsize: GLsizei; length: PGLsizei; infolog: pchar); extdecl;
561  glGetShaderPrecisionFormat: procedure (shadertype: GLenum; precisiontype: GLenum; range: PGLint; precision: PGLint); extdecl;
562  glGetShaderSource: procedure (shader: GLuint; bufsize: GLsizei; length: PGLsizei; source: pchar); extdecl;
563  glGetString: function (name: GLenum): pchar; extdecl;
564  glGetTexParameterfv: procedure (target: GLenum; pname: GLenum; params: PGLfloat); extdecl;
565  glGetTexParameteriv: procedure (target: GLenum; pname: GLenum; params: GLint); extdecl;
566  glGetUniformfv: procedure (prog: GLuint; location: GLint; params: PGLfloat); extdecl;
567  glGetUniformiv: procedure (prog: GLuint; location: GLint; params: PGLint); extdecl;
568  glGetUniformLocation: function (prog: GLuint; name: pchar): integer; extdecl;
569  glGetVertexAttribfv: procedure (index: GLuint; pname: GLenum; params: PGLfloat); extdecl;
570  glGetVertexAttribiv: procedure (index: GLuint; pname: GLenum; params: PGLint); extdecl;
571  glGetVertexAttribPointerv: procedure (index: GLuint; pname: GLenum; data: pointer); extdecl;
572  glHint: procedure (target: GLenum; mode: GLenum); extdecl;
573  glIsBuffer: function (buffer: GLuint): GLboolean; extdecl;
574  glIsEnabled: function (cap: GLenum): GLboolean; extdecl;
575  glIsFramebuffer: function (framebuffer: GLuint): GLboolean; extdecl;
576  glIsProgram: function (prog: GLuint): GLboolean; extdecl;
577  glIsRenderbuffer: function (renderbuffer: GLuint): GLboolean; extdecl;
578  glIsShader: function (shader: GLuint): GLboolean; extdecl;
579  glIsTexture: function (texture: GLuint): GLboolean; extdecl;
580  glLineWidth: procedure (width: GLfloat); extdecl;
581  glLinkProgram: procedure (prog: GLuint); extdecl;
582  glPixelStorei: procedure (pname: GLenum; param: GLint); extdecl;
583  glPolygonOffset: procedure (factor: GLfloat; units: GLfloat); extdecl;
584  glReadPixels: procedure (x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; typ: GLenum; pixels: pointer); extdecl;
585  glReleaseShaderCompiler: procedure ; extdecl;
586  glRenderbufferStorage: procedure (target: GLenum; internalformat: GLenum; width: GLsizei; height: GLsizei); extdecl;
587  glSampleCoverage: procedure (value: GLclampf; invert: GLboolean); extdecl;
588  glScissor: procedure (x: GLint; y: GLint; width: GLsizei; height: GLsizei); extdecl;
589  glShaderBinary: procedure (n: GLsizei; shaders: PGLuint; binaryformat: GLenum; binary: pointer; length: GLsizei); extdecl;
590  glShaderSource: procedure (shader: GLuint; count: GLsizei; str: ppchar; length: PGLint); extdecl;
591  glStencilFunc: procedure (func: GLenum; ref: GLint; mask: GLuint); extdecl;
592  glStencilFuncSeparate: procedure (face: GLenum; func: GLenum; ref: GLint; mask: GLuint); extdecl;
593  glStencilMask: procedure (mask: GLuint); extdecl;
594  glStencilMaskSeparate: procedure (face: GLenum; mask: GLuint); extdecl;
595  glStencilOp: procedure (fail: GLenum; zfail: GLenum; zpass: GLenum); extdecl;
596  glStencilOpSeparate: procedure (face: GLenum; fail: GLenum; zfail: GLenum; zpass: GLenum); extdecl;
597  glTexImage2D: procedure (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; typ: GLenum; pixels: pointer); extdecl;
598  glTexParameterf: procedure (target: GLenum; pname: GLenum; param: GLfloat); extdecl;
599  glTexParameterfv: procedure (target: GLenum; pname: GLenum; const params: PGLfloat); extdecl;
600  glTexParameteri: procedure (target: GLenum; pname: GLenum; param: GLint); extdecl;
601  glTexParameteriv: procedure (target: GLenum; pname: GLenum; const params: PGLint); extdecl;
602  glTexSubImage2D: procedure (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; format: GLenum; typ: GLenum; const pixels: pointer); extdecl;
603  glUniform1f: procedure (location: GLint; x: GLfloat); extdecl;
604  glUniform1fv: procedure (location: GLint; count: GLsizei; const v: PGLfloat); extdecl;
605  glUniform1i: procedure (location: GLint; x: GLint); extdecl;
606  glUniform1iv: procedure (location: GLint; count: GLsizei; const v: PGLint); extdecl;
607  glUniform2f: procedure (location: GLint; x: GLfloat; y: GLfloat); extdecl;
608  glUniform2fv: procedure (location: GLint; count: GLsizei; const v: PGLfloat); extdecl;
609  glUniform2i: procedure (location: GLint; x: GLint; y: GLint); extdecl;
610  glUniform2iv: procedure (location: GLint; count: GLsizei; const v: PGLint); extdecl;
611  glUniform3f: procedure (location: GLint; x: GLfloat; y: GLfloat; z: GLfloat); extdecl;
612  glUniform3fv: procedure (location: GLint; count: GLsizei; const v: PGLfloat); extdecl;
613  glUniform3i: procedure (location: GLint; x: GLint; y: GLint; z: GLint); extdecl;
614  glUniform3iv: procedure (location: GLint; count: GLsizei; const v: GLint); extdecl;
615  glUniform4f: procedure (location: GLint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl;
616  glUniform4fv: procedure (location: GLint; count: GLsizei; const v: PGLfloat); extdecl;
617  glUniform4i: procedure (location: GLint; x: GLint; y: GLint; z: GLint; w: GLint); extdecl;
618  glUniform4iv: procedure (location: GLint; count: GLsizei; const v: PGLint); extdecl;
619  glUniformMatrix2fv: procedure (location: GLint; count: GLsizei; transpose: GLboolean; const value: PGLfloat); extdecl;
620  glUniformMatrix3fv: procedure (location: GLint; count: GLsizei; transpose: GLboolean; const value: PGLfloat); extdecl;
621  glUniformMatrix4fv: procedure (location: GLint; count: GLsizei; transpose: GLboolean; const value: PGLfloat); extdecl;
622  glUseProgram: procedure (prog: GLuint); extdecl;
623  glValidateProgram: procedure (prog: GLuint); extdecl;
624  glVertexAttrib1f: procedure (indx: GLuint; x: GLfloat); extdecl;
625  glVertexAttrib1fv: procedure (indx: GLuint; const values: PGLfloat); extdecl;
626  glVertexAttrib2f: procedure (indx: GLuint; x: GLfloat; y: GLfloat); extdecl;
627  glVertexAttrib2fv: procedure (indx: GLuint; const values: PGLfloat); extdecl;
628  glVertexAttrib3f: procedure (indx: GLuint; x: GLfloat; y: GLfloat; z: GLfloat); extdecl;
629  glVertexAttrib3fv: procedure (indx: GLuint; const values: PGLfloat); extdecl;
630  glVertexAttrib4f: procedure (indx: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl;
631  glVertexAttrib4fv: procedure (indx: GLuint; const values: PGLfloat); extdecl;
632  glVertexAttribPointer: procedure (indx: GLuint; size: GLint; typ: GLenum; normalized: GLboolean; stride: GLsizei; const ptr: pointer); extdecl;
633  glViewport: procedure (x: GLint; y: GLint; width: GLsizei; height: GLsizei); extdecl;
634
635function gles_GetProcAddress(name: pchar): pointer;
636function InitOpenGL(extrafunctions: boolean): string;
637var GetProcAddress: function (name: pchar): pointer = @gles_GetProcAddress;
638
639implementation
640uses dynlibs, sysutils;
641
642
643var gles_lib: TLibHandle;
644const gles_libname = 'libGLESv2.so';
645procedure initialize_gles;
646begin
647 (*if fileexists(gles_libname)
648  then gles_lib:=LoadLibrary(gles_libname)
649  else gles_lib:=LoadLibrary('libGL.so.1');*)
650 gles_lib:=LoadLibrary(gles_libname);
651 if gles_lib=nilhandle then writeln(stderr, 'cannot find GL library');
652end;
653
654
655function gles_GetProcAddress(name: pchar): pointer;
656begin
657  result:=GetProcedureAddress(gles_lib, name);
658end;
659
660function InitOpenGL(extrafunctions: boolean): string;
661begin
662 initialize_gles;
663 glActiveTexture:=GetProcAddress('glActiveTexture'); if @glActiveTexture=nil then Exit('Error loading GL ES 2.0: Function not found "glActiveTexture"');
664 glAttachShader:=GetProcAddress('glAttachShader'); if @glAttachShader=nil then Exit('Error loading GL ES 2.0: Function not found "glAttachShader"');
665 glBindAttribLocation:=GetProcAddress('glBindAttribLocation'); if @glBindAttribLocation=nil then Exit('Error loading GL ES 2.0: Function not found "glBindAttribLocation"');
666 glBindBuffer:=GetProcAddress('glBindBuffer'); if @glBindBuffer=nil then Exit('Error loading GL ES 2.0: Function not found "glBindBuffer"');
667 glBindFramebuffer:=GetProcAddress('glBindFramebuffer'); if @glBindFramebuffer=nil then Exit('Error loading GL ES 2.0: Function not found "glBindFramebuffer"');
668 glBindRenderbuffer:=GetProcAddress('glBindRenderbuffer'); if @glBindRenderbuffer=nil then Exit('Error loading GL ES 2.0: Function not found "glBindRenderbuffer"');
669 glBindTexture:=GetProcAddress('glBindTexture'); if @glBindTexture=nil then Exit('Error loading GL ES 2.0: Function not found "glBindTexture"');
670 glBlendColor:=GetProcAddress('glBlendColor'); if @glBlendColor=nil then Exit('Error loading GL ES 2.0: Function not found "glBlendColor"');
671 glBlendEquation:=GetProcAddress('glBlendEquation'); if @glBlendEquation=nil then Exit('Error loading GL ES 2.0: Function not found "glBlendEquation"');
672 glBlendEquationSeparate:=GetProcAddress('glBlendEquationSeparate'); if @glBlendEquationSeparate=nil then Exit('Error loading GL ES 2.0: Function not found "glBlendEquationSeparate"');
673 glBlendFunc:=GetProcAddress('glBlendFunc'); if @glBlendFunc=nil then Exit('Error loading GL ES 2.0: Function not found "glBlendFunc"');
674 glBlendFuncSeparate:=GetProcAddress('glBlendFuncSeparate'); if @glBlendFuncSeparate=nil then Exit('Error loading GL ES 2.0: Function not found "glBlendFuncSeparate"');
675 glBufferData:=GetProcAddress('glBufferData'); if @glBufferData=nil then Exit('Error loading GL ES 2.0: Function not found "glBufferData"');
676 glBufferSubData:=GetProcAddress('glBufferSubData'); if @glBufferSubData=nil then Exit('Error loading GL ES 2.0: Function not found "glBufferSubData"');
677 glCheckFramebufferStatus:=GetProcAddress('glCheckFramebufferStatus'); if @glCheckFramebufferStatus=nil then Exit('Error loading GL ES 2.0: Function not found "glCheckFramebufferStatus"');
678 glClear:=GetProcAddress('glClear'); if @glClear=nil then Exit('Error loading GL ES 2.0: Function not found "glClear"');
679 glClearColor:=GetProcAddress('glClearColor'); if @glClearColor=nil then Exit('Error loading GL ES 2.0: Function not found "glClearColor"');
680 if extrafunctions then begin
681  glClearDepthf:=GetProcAddress('glClearDepthf'); if @glClearDepthf=nil then Exit('Error loading GL ES 2.0: Function not found "glClearDepthf"');
682 end;
683 glClearStencil:=GetProcAddress('glClearStencil'); if @glClearStencil=nil then Exit('Error loading GL ES 2.0: Function not found "glClearStencil"');
684 glColorMask:=GetProcAddress('glColorMask'); if @glColorMask=nil then Exit('Error loading GL ES 2.0: Function not found "glColorMask"');
685 glCompileShader:=GetProcAddress('glCompileShader'); if @glCompileShader=nil then Exit('Error loading GL ES 2.0: Function not found "glCompileShader"');
686 glCompressedTexImage2D:=GetProcAddress('glCompressedTexImage2D'); if @glCompressedTexImage2D=nil then Exit('Error loading GL ES 2.0: Function not found "glCompressedTexImage2D"');
687 glCompressedTexSubImage2D:=GetProcAddress('glCompressedTexSubImage2D'); if @glCompressedTexSubImage2D=nil then Exit('Error loading GL ES 2.0: Function not found "glCompressedTexSubImage2D"');
688 glCopyTexImage2D:=GetProcAddress('glCopyTexImage2D'); if @glCopyTexImage2D=nil then Exit('Error loading GL ES 2.0: Function not found "glCopyTexImage2D"');
689 glCopyTexSubImage2D:=GetProcAddress('glCopyTexSubImage2D'); if @glCopyTexSubImage2D=nil then Exit('Error loading GL ES 2.0: Function not found "glCopyTexSubImage2D"');
690 glCreateProgram:=GetProcAddress('glCreateProgram'); if @glCreateProgram=nil then Exit('Error loading GL ES 2.0: Function not found "glCreateProgram"');
691 glCreateShader:=GetProcAddress('glCreateShader'); if @glCreateShader=nil then Exit('Error loading GL ES 2.0: Function not found "glCreateShader"');
692 glCullFace:=GetProcAddress('glCullFace'); if @glCullFace=nil then Exit('Error loading GL ES 2.0: Function not found "glCullFace"');
693 glDeleteBuffers:=GetProcAddress('glDeleteBuffers'); if @glDeleteBuffers=nil then Exit('Error loading GL ES 2.0: Function not found "glDeleteBuffers"');
694 glDeleteFramebuffers:=GetProcAddress('glDeleteFramebuffers'); if @glDeleteFramebuffers=nil then Exit('Error loading GL ES 2.0: Function not found "glDeleteFramebuffers"');
695 glDeleteProgram:=GetProcAddress('glDeleteProgram'); if @glDeleteProgram=nil then Exit('Error loading GL ES 2.0: Function not found "glDeleteProgram"');
696 glDeleteRenderbuffers:=GetProcAddress('glDeleteRenderbuffers'); if @glDeleteRenderbuffers=nil then Exit('Error loading GL ES 2.0: Function not found "glDeleteRenderbuffers"');
697 glDeleteShader:=GetProcAddress('glDeleteShader'); if @glDeleteShader=nil then Exit('Error loading GL ES 2.0: Function not found "glDeleteShader"');
698 glDeleteTextures:=GetProcAddress('glDeleteTextures'); if @glDeleteTextures=nil then Exit('Error loading GL ES 2.0: Function not found "glDeleteTextures"');
699 glDepthFunc:=GetProcAddress('glDepthFunc'); if @glDepthFunc=nil then Exit('Error loading GL ES 2.0: Function not found "glDepthFunc"');
700 glDepthMask:=GetProcAddress('glDepthMask'); if @glDepthMask=nil then Exit('Error loading GL ES 2.0: Function not found "glDepthMask"');
701 if extrafunctions then begin
702  glDepthRangef:=GetProcAddress('glDepthRangef'); if @glDepthRangef=nil then Exit('Error loading GL ES 2.0: Function not found "glDepthRangef"');
703 end;
704 glDetachShader:=GetProcAddress('glDetachShader'); if @glDetachShader=nil then Exit('Error loading GL ES 2.0: Function not found "glDetachShader"');
705 glDisable:=GetProcAddress('glDisable'); if @glDisable=nil then Exit('Error loading GL ES 2.0: Function not found "glDisable"');
706 glDisableVertexAttribArray:=GetProcAddress('glDisableVertexAttribArray'); if @glDisableVertexAttribArray=nil then Exit('Error loading GL ES 2.0: Function not found "glDisableVertexAttribArray"');
707 glDrawArrays:=GetProcAddress('glDrawArrays'); if @glDrawArrays=nil then Exit('Error loading GL ES 2.0: Function not found "glDrawArrays"');
708 glDrawElements:=GetProcAddress('glDrawElements'); if @glDrawElements=nil then Exit('Error loading GL ES 2.0: Function not found "glDrawElements"');
709 glEnable:=GetProcAddress('glEnable'); if @glEnable=nil then Exit('Error loading GL ES 2.0: Function not found "glEnable"');
710 glEnableVertexAttribArray:=GetProcAddress('glEnableVertexAttribArray'); if @glEnableVertexAttribArray=nil then Exit('Error loading GL ES 2.0: Function not found "glEnableVertexAttribArray"');
711 glFinish:=GetProcAddress('glFinish'); if @glFinish=nil then Exit('Error loading GL ES 2.0: Function not found "glFinish"');
712 glFlush:=GetProcAddress('glFlush'); if @glFlush=nil then Exit('Error loading GL ES 2.0: Function not found "glFlush"');
713 glFramebufferRenderbuffer:=GetProcAddress('glFramebufferRenderbuffer'); if @glFramebufferRenderbuffer=nil then Exit('Error loading GL ES 2.0: Function not found "glFramebufferRenderbuffer"');
714 glFramebufferTexture2D:=GetProcAddress('glFramebufferTexture2D'); if @glFramebufferTexture2D=nil then Exit('Error loading GL ES 2.0: Function not found "glFramebufferTexture2D"');
715 glFrontFace:=GetProcAddress('glFrontFace'); if @glFrontFace=nil then Exit('Error loading GL ES 2.0: Function not found "glFrontFace"');
716 glGenBuffers:=GetProcAddress('glGenBuffers'); if @glGenBuffers=nil then Exit('Error loading GL ES 2.0: Function not found "glGenBuffers"');
717 glGenerateMipmap:=GetProcAddress('glGenerateMipmap'); if @glGenerateMipmap=nil then Exit('Error loading GL ES 2.0: Function not found "glGenerateMipmap"');
718 glGenFramebuffers:=GetProcAddress('glGenFramebuffers'); if @glGenFramebuffers=nil then Exit('Error loading GL ES 2.0: Function not found "glGenFramebuffers"');
719 glGenRenderbuffers:=GetProcAddress('glGenRenderbuffers'); if @glGenRenderbuffers=nil then Exit('Error loading GL ES 2.0: Function not found "glGenRenderbuffers"');
720 glGenTextures:=GetProcAddress('glGenTextures'); if @glGenTextures=nil then Exit('Error loading GL ES 2.0: Function not found "glGenTextures"');
721 glGetActiveAttrib:=GetProcAddress('glGetActiveAttrib'); if @glGetActiveAttrib=nil then Exit('Error loading GL ES 2.0: Function not found "glGetActiveAttrib"');
722 glGetActiveUniform:=GetProcAddress('glGetActiveUniform'); if @glGetActiveUniform=nil then Exit('Error loading GL ES 2.0: Function not found "glGetActiveUniform"');
723 glGetAttachedShaders:=GetProcAddress('glGetAttachedShaders'); if @glGetAttachedShaders=nil then Exit('Error loading GL ES 2.0: Function not found "glGetAttachedShaders"');
724 glGetAttribLocation:=GetProcAddress('glGetAttribLocation'); if @glGetAttribLocation=nil then Exit('Error loading GL ES 2.0: Function not found "glGetAttribLocation"');
725 glGetBooleanv:=GetProcAddress('glGetBooleanv'); if @glGetBooleanv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetBooleanv"');
726 glGetBufferParameteriv:=GetProcAddress('glGetBufferParameteriv'); if @glGetBufferParameteriv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetBufferParameteriv"');
727 glGetError:=GetProcAddress('glGetError'); if @glGetError=nil then Exit('Error loading GL ES 2.0: Function not found "glGetError"');
728 glGetFloatv:=GetProcAddress('glGetFloatv'); if @glGetFloatv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetFloatv"');
729 glGetFramebufferAttachmentParameteriv:=GetProcAddress('glGetFramebufferAttachmentParameteriv'); if @glGetFramebufferAttachmentParameteriv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetFramebufferAttachmentParameteriv"');
730 glGetIntegerv:=GetProcAddress('glGetIntegerv'); if @glGetIntegerv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetIntegerv"');
731 glGetProgramiv:=GetProcAddress('glGetProgramiv'); if @glGetProgramiv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetProgramiv"');
732 glGetProgramInfoLog:=GetProcAddress('glGetProgramInfoLog'); if @glGetProgramInfoLog=nil then Exit('Error loading GL ES 2.0: Function not found "glGetProgramInfoLog"');
733 glGetRenderbufferParameteriv:=GetProcAddress('glGetRenderbufferParameteriv'); if @glGetRenderbufferParameteriv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetRenderbufferParameteriv"');
734 glGetShaderiv:=GetProcAddress('glGetShaderiv'); if @glGetShaderiv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetShaderiv"');
735 glGetShaderInfoLog:=GetProcAddress('glGetShaderInfoLog'); if @glGetShaderInfoLog=nil then Exit('Error loading GL ES 2.0: Function not found "glGetShaderInfoLog"');
736 if extrafunctions then begin
737  glGetShaderPrecisionFormat:=GetProcAddress('glGetShaderPrecisionFormat'); if @glGetShaderPrecisionFormat=nil then Exit('Error loading GL ES 2.0: Function not found "glGetShaderPrecisionFormat"');
738 end;
739 glGetShaderSource:=GetProcAddress('glGetShaderSource'); if @glGetShaderSource=nil then Exit('Error loading GL ES 2.0: Function not found "glGetShaderSource"');
740 glGetString:=GetProcAddress('glGetString'); if @glGetString=nil then Exit('Error loading GL ES 2.0: Function not found "glGetString"');
741 glGetTexParameterfv:=GetProcAddress('glGetTexParameterfv'); if @glGetTexParameterfv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetTexParameterfv"');
742 glGetTexParameteriv:=GetProcAddress('glGetTexParameteriv'); if @glGetTexParameteriv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetTexParameteriv"');
743 glGetUniformfv:=GetProcAddress('glGetUniformfv'); if @glGetUniformfv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetUniformfv"');
744 glGetUniformiv:=GetProcAddress('glGetUniformiv'); if @glGetUniformiv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetUniformiv"');
745 glGetUniformLocation:=GetProcAddress('glGetUniformLocation'); if @glGetUniformLocation=nil then Exit('Error loading GL ES 2.0: Function not found "glGetUniformLocation"');
746 glGetVertexAttribfv:=GetProcAddress('glGetVertexAttribfv'); if @glGetVertexAttribfv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetVertexAttribfv"');
747 glGetVertexAttribiv:=GetProcAddress('glGetVertexAttribiv'); if @glGetVertexAttribiv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetVertexAttribiv"');
748 glGetVertexAttribPointerv:=GetProcAddress('glGetVertexAttribPointerv'); if @glGetVertexAttribPointerv=nil then Exit('Error loading GL ES 2.0: Function not found "glGetVertexAttribPointerv"');
749 glHint:=GetProcAddress('glHint'); if @glHint=nil then Exit('Error loading GL ES 2.0: Function not found "glHint"');
750 glIsBuffer:=GetProcAddress('glIsBuffer'); if @glIsBuffer=nil then Exit('Error loading GL ES 2.0: Function not found "glIsBuffer"');
751 glIsEnabled:=GetProcAddress('glIsEnabled'); if @glIsEnabled=nil then Exit('Error loading GL ES 2.0: Function not found "glIsEnabled"');
752 glIsFramebuffer:=GetProcAddress('glIsFramebuffer'); if @glIsFramebuffer=nil then Exit('Error loading GL ES 2.0: Function not found "glIsFramebuffer"');
753 glIsProgram:=GetProcAddress('glIsProgram'); if @glIsProgram=nil then Exit('Error loading GL ES 2.0: Function not found "glIsProgram"');
754 glIsRenderbuffer:=GetProcAddress('glIsRenderbuffer'); if @glIsRenderbuffer=nil then Exit('Error loading GL ES 2.0: Function not found "glIsRenderbuffer"');
755 glIsShader:=GetProcAddress('glIsShader'); if @glIsShader=nil then Exit('Error loading GL ES 2.0: Function not found "glIsShader"');
756 glIsTexture:=GetProcAddress('glIsTexture'); if @glIsTexture=nil then Exit('Error loading GL ES 2.0: Function not found "glIsTexture"');
757 glLineWidth:=GetProcAddress('glLineWidth'); if @glLineWidth=nil then Exit('Error loading GL ES 2.0: Function not found "glLineWidth"');
758 glLinkProgram:=GetProcAddress('glLinkProgram'); if @glLinkProgram=nil then Exit('Error loading GL ES 2.0: Function not found "glLinkProgram"');
759 glPixelStorei:=GetProcAddress('glPixelStorei'); if @glPixelStorei=nil then Exit('Error loading GL ES 2.0: Function not found "glPixelStorei"');
760 glPolygonOffset:=GetProcAddress('glPolygonOffset'); if @glPolygonOffset=nil then Exit('Error loading GL ES 2.0: Function not found "glPolygonOffset"');
761 glReadPixels:=GetProcAddress('glReadPixels'); if @glReadPixels=nil then Exit('Error loading GL ES 2.0: Function not found "glReadPixels"');
762 if extrafunctions then begin
763  glReleaseShaderCompiler:=GetProcAddress('glReleaseShaderCompiler'); if @glReleaseShaderCompiler=nil then Exit('Error loading GL ES 2.0: Function not found "glReleaseShaderCompiler"');
764 end;
765 glRenderbufferStorage:=GetProcAddress('glRenderbufferStorage'); if @glRenderbufferStorage=nil then Exit('Error loading GL ES 2.0: Function not found "glRenderbufferStorage"');
766 glSampleCoverage:=GetProcAddress('glSampleCoverage'); if @glSampleCoverage=nil then Exit('Error loading GL ES 2.0: Function not found "glSampleCoverage"');
767 glScissor:=GetProcAddress('glScissor'); if @glScissor=nil then Exit('Error loading GL ES 2.0: Function not found "glScissor"');
768 if extrafunctions then begin
769  glShaderBinary:=GetProcAddress('glShaderBinary'); if @glShaderBinary=nil then Exit('Error loading GL ES 2.0: Function not found "glShaderBinary"');
770 end;
771 glShaderSource:=GetProcAddress('glShaderSource'); if @glShaderSource=nil then Exit('Error loading GL ES 2.0: Function not found "glShaderSource"');
772 glStencilFunc:=GetProcAddress('glStencilFunc'); if @glStencilFunc=nil then Exit('Error loading GL ES 2.0: Function not found "glStencilFunc"');
773 glStencilFuncSeparate:=GetProcAddress('glStencilFuncSeparate'); if @glStencilFuncSeparate=nil then Exit('Error loading GL ES 2.0: Function not found "glStencilFuncSeparate"');
774 glStencilMask:=GetProcAddress('glStencilMask'); if @glStencilMask=nil then Exit('Error loading GL ES 2.0: Function not found "glStencilMask"');
775 glStencilMaskSeparate:=GetProcAddress('glStencilMaskSeparate'); if @glStencilMaskSeparate=nil then Exit('Error loading GL ES 2.0: Function not found "glStencilMaskSeparate"');
776 glStencilOp:=GetProcAddress('glStencilOp'); if @glStencilOp=nil then Exit('Error loading GL ES 2.0: Function not found "glStencilOp"');
777 glStencilOpSeparate:=GetProcAddress('glStencilOpSeparate'); if @glStencilOpSeparate=nil then Exit('Error loading GL ES 2.0: Function not found "glStencilOpSeparate"');
778 glTexImage2D:=GetProcAddress('glTexImage2D'); if @glTexImage2D=nil then Exit('Error loading GL ES 2.0: Function not found "glTexImage2D"');
779 glTexParameterf:=GetProcAddress('glTexParameterf'); if @glTexParameterf=nil then Exit('Error loading GL ES 2.0: Function not found "glTexParameterf"');
780 glTexParameterfv:=GetProcAddress('glTexParameterfv'); if @glTexParameterfv=nil then Exit('Error loading GL ES 2.0: Function not found "glTexParameterfv"');
781 glTexParameteri:=GetProcAddress('glTexParameteri'); if @glTexParameteri=nil then Exit('Error loading GL ES 2.0: Function not found "glTexParameteri"');
782 glTexParameteriv:=GetProcAddress('glTexParameteriv'); if @glTexParameteriv=nil then Exit('Error loading GL ES 2.0: Function not found "glTexParameteriv"');
783 glTexSubImage2D:=GetProcAddress('glTexSubImage2D'); if @glTexSubImage2D=nil then Exit('Error loading GL ES 2.0: Function not found "glTexSubImage2D"');
784 glUniform1f:=GetProcAddress('glUniform1f'); if @glUniform1f=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform1f"');
785 glUniform1fv:=GetProcAddress('glUniform1fv'); if @glUniform1fv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform1fv"');
786 glUniform1i:=GetProcAddress('glUniform1i'); if @glUniform1i=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform1i"');
787 glUniform1iv:=GetProcAddress('glUniform1iv'); if @glUniform1iv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform1iv"');
788 glUniform2f:=GetProcAddress('glUniform2f'); if @glUniform2f=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform2f"');
789 glUniform2fv:=GetProcAddress('glUniform2fv'); if @glUniform2fv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform2fv"');
790 glUniform2i:=GetProcAddress('glUniform2i'); if @glUniform2i=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform2i"');
791 glUniform2iv:=GetProcAddress('glUniform2iv'); if @glUniform2iv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform2iv"');
792 glUniform3f:=GetProcAddress('glUniform3f'); if @glUniform3f=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform3f"');
793 glUniform3fv:=GetProcAddress('glUniform3fv'); if @glUniform3fv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform3fv"');
794 glUniform3i:=GetProcAddress('glUniform3i'); if @glUniform3i=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform3i"');
795 glUniform3iv:=GetProcAddress('glUniform3iv'); if @glUniform3iv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform3iv"');
796 glUniform4f:=GetProcAddress('glUniform4f'); if @glUniform4f=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform4f"');
797 glUniform4fv:=GetProcAddress('glUniform4fv'); if @glUniform4fv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform4fv"');
798 glUniform4i:=GetProcAddress('glUniform4i'); if @glUniform4i=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform4i"');
799 glUniform4iv:=GetProcAddress('glUniform4iv'); if @glUniform4iv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniform4iv"');
800 glUniformMatrix2fv:=GetProcAddress('glUniformMatrix2fv'); if @glUniformMatrix2fv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniformMatrix2fv"');
801 glUniformMatrix3fv:=GetProcAddress('glUniformMatrix3fv'); if @glUniformMatrix3fv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniformMatrix3fv"');
802 glUniformMatrix4fv:=GetProcAddress('glUniformMatrix4fv'); if @glUniformMatrix4fv=nil then Exit('Error loading GL ES 2.0: Function not found "glUniformMatrix4fv"');
803 glUseProgram:=GetProcAddress('glUseProgram'); if @glUseProgram=nil then Exit('Error loading GL ES 2.0: Function not found "glUseProgram"');
804 glValidateProgram:=GetProcAddress('glValidateProgram'); if @glValidateProgram=nil then Exit('Error loading GL ES 2.0: Function not found "glValidateProgram"');
805 glVertexAttrib1f:=GetProcAddress('glVertexAttrib1f'); if @glVertexAttrib1f=nil then Exit('Error loading GL ES 2.0: Function not found "glVertexAttrib1f"');
806 glVertexAttrib1fv:=GetProcAddress('glVertexAttrib1fv'); if @glVertexAttrib1fv=nil then Exit('Error …

Large files files are truncated, but you can click here to view the full file