PageRenderTime 64ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/gles_header.pas

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