]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - glquake.h
1375c8e60dc15b464bd3f4d01d09fd66de9ee8ca
[xonotic/darkplaces.git] / glquake.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 #ifndef GLQUAKE_H
22 #define GLQUAKE_H
23
24 #ifdef USE_GLES2
25 #ifdef __IPHONEOS__
26 #include <OpenGLES/ES2/gl.h>
27 #else
28 #include <SDL_opengles2.h>
29 #endif
30 // used in R_SetupShader_Generic calls, not actually passed to GL
31 #ifndef GL_MODULATE
32 #define GL_MODULATE                             0x2100
33 #define GL_DECAL                          0x2101
34 #define GL_ADD                            0x0104
35 #endif
36 #endif
37
38 // disable data conversion warnings
39
40 #ifdef _MSC_VER
41 #pragma warning(disable : 4310) // LordHavoc: MSVC++ 2008 x86: cast truncates constant value
42 #pragma warning(disable : 4245) // LordHavoc: MSVC++ 2008 x86: 'initializing' : conversion from 'int' to 'unsigned char', signed/unsigned mismatch
43 #pragma warning(disable : 4204) // LordHavoc: MSVC++ 2008 x86: nonstandard extension used : non-constant aggregate initializer
44 //#pragma warning(disable : 4267) // LordHavoc: MSVC++ 2008 x64, conversion from 'size_t' to 'int', possible loss of data
45 //#pragma warning(disable : 4244)     // LordHavoc: MSVC++ 4 x86, double/float
46 //#pragma warning(disable : 4305)               // LordHavoc: MSVC++ 6 x86, double/float
47 //#pragma warning(disable : 4706)               // LordHavoc: MSVC++ 2008 x86, assignment within conditional expression
48 //#pragma warning(disable : 4127)               // LordHavoc: MSVC++ 2008 x86, conditional expression is constant
49 //#pragma warning(disable : 4100)               // LordHavoc: MSVC++ 2008 x86, unreferenced formal parameter
50 //#pragma warning(disable : 4055)               // LordHavoc: MSVC++ 2008 x86, 'type cast' from data pointer   to function pointer
51 //#pragma warning(disable : 4054)               // LordHavoc: MSVC++ 2008 x86, 'type cast' from function pointer   to data pointer
52 #endif
53
54
55 //====================================================
56
57 #ifndef USE_GLES2
58 // wgl uses APIENTRY
59 #ifndef APIENTRY
60 #define APIENTRY
61 #endif
62
63 // for platforms (wgl) that do not use GLAPIENTRY
64 #ifndef GLAPIENTRY
65 #define GLAPIENTRY APIENTRY
66 #endif
67
68 #ifndef GL_PROJECTION
69 #include <stddef.h>
70
71 typedef unsigned int GLenum;
72 typedef unsigned char GLboolean;
73 typedef unsigned int GLbitfield;
74 typedef void GLvoid;
75 // 1-byte signed
76 typedef signed char GLbyte;
77 // 2-byte signed
78 typedef short GLshort;
79 // 4-byte signed
80 typedef int GLint;
81 // 1-byte unsigned
82 typedef unsigned char GLubyte;
83 // 2-byte unsigned
84 typedef unsigned short GLushort;
85 // 4-byte unsigned
86 typedef unsigned int GLuint;
87 // 4-byte signed
88 typedef int GLsizei;
89 // single precision float
90 typedef float GLfloat;
91 // single precision float in [0,1]
92 typedef float GLclampf;
93 // double precision float
94 typedef double GLdouble;
95 // double precision float in [0,1]
96 typedef double GLclampd;
97 // int whose size is the same as a pointer (?)
98 typedef ptrdiff_t GLintptrARB;
99 // int whose size is the same as a pointer (?)
100 typedef ptrdiff_t GLsizeiptrARB;
101
102 #define GL_STEREO                                       0x0C33
103
104 #define GL_MODELVIEW                            0x1700
105 #define GL_PROJECTION                           0x1701
106 #define GL_TEXTURE                              0x1702
107 #define GL_MATRIX_MODE                          0x0BA0
108 #define GL_MODELVIEW_MATRIX                     0x0BA6
109 #define GL_PROJECTION_MATRIX                    0x0BA7
110 #define GL_TEXTURE_MATRIX                       0x0BA8
111
112 #define GL_DONT_CARE                            0x1100
113 #define GL_FASTEST                                      0x1101
114 #define GL_NICEST                                       0x1102
115
116 #define GL_DEPTH_TEST                           0x0B71
117
118 #define GL_CULL_FACE                            0x0B44
119
120 #define GL_BLEND                                0x0BE2
121 #define GL_ALPHA_TEST                   0x0BC0
122
123 #define GL_ZERO                                 0x0
124 #define GL_ONE                                  0x1
125 #define GL_SRC_COLOR                            0x0300
126 #define GL_ONE_MINUS_SRC_COLOR                  0x0301
127 #define GL_DST_COLOR                            0x0306
128 #define GL_ONE_MINUS_DST_COLOR                  0x0307
129 #define GL_SRC_ALPHA                            0x0302
130 #define GL_ONE_MINUS_SRC_ALPHA                  0x0303
131 #define GL_DST_ALPHA                            0x0304
132 #define GL_ONE_MINUS_DST_ALPHA                  0x0305
133 #define GL_SRC_ALPHA_SATURATE                   0x0308
134 #define GL_CONSTANT_COLOR                       0x8001
135 #define GL_ONE_MINUS_CONSTANT_COLOR             0x8002
136 #define GL_CONSTANT_ALPHA                       0x8003
137 #define GL_ONE_MINUS_CONSTANT_ALPHA             0x8004
138
139 #define GL_TEXTURE_ENV                          0x2300
140 #define GL_TEXTURE_ENV_MODE                     0x2200
141 #define GL_TEXTURE_1D                           0x0DE0
142 #define GL_TEXTURE_2D                           0x0DE1
143 #define GL_TEXTURE_WRAP_S                       0x2802
144 #define GL_TEXTURE_WRAP_T                       0x2803
145 #define GL_TEXTURE_WRAP_R                       0x8072
146 #define GL_TEXTURE_BORDER_COLOR                 0x1004
147 #define GL_TEXTURE_MAG_FILTER                   0x2800
148 #define GL_TEXTURE_MIN_FILTER                   0x2801
149 #define GL_PACK_ALIGNMENT                       0x0D05
150 #define GL_UNPACK_ALIGNMENT                     0x0CF5
151 #define GL_TEXTURE_BINDING_1D                   0x8068
152 #define GL_TEXTURE_BINDING_2D                   0x8069
153 #define GL_TEXTURE_INTERNAL_FORMAT              0x1003
154 #define GL_TEXTURE_MIN_LOD                      0x813A
155 #define GL_TEXTURE_MAX_LOD                      0x813B
156 #define GL_TEXTURE_BASE_LEVEL                   0x813C
157 #define GL_TEXTURE_MAX_LEVEL                    0x813D
158
159 #define GL_NEAREST                              0x2600
160 #define GL_LINEAR                               0x2601
161 #define GL_NEAREST_MIPMAP_NEAREST               0x2700
162 #define GL_NEAREST_MIPMAP_LINEAR                0x2702
163 #define GL_LINEAR_MIPMAP_NEAREST                0x2701
164 #define GL_LINEAR_MIPMAP_LINEAR                 0x2703
165
166 #define GL_LINE                                 0x1B01
167 #define GL_FILL                                 0x1B02
168
169 #define GL_ADD                                  0x0104
170 #define GL_DECAL                                0x2101
171 #define GL_MODULATE                             0x2100
172
173 #define GL_REPEAT                               0x2901
174 #define GL_CLAMP                                0x2900
175
176 #define GL_POINTS                               0x0000
177 #define GL_LINES                                0x0001
178 #define GL_LINE_LOOP                    0x0002
179 #define GL_LINE_STRIP                   0x0003
180 #define GL_TRIANGLES                    0x0004
181 #define GL_TRIANGLE_STRIP               0x0005
182 #define GL_TRIANGLE_FAN                 0x0006
183 #define GL_QUADS                                0x0007
184 #define GL_QUAD_STRIP                   0x0008
185 #define GL_POLYGON                              0x0009
186
187 #define GL_FALSE                                0x0
188 #define GL_TRUE                                 0x1
189
190 #define GL_BYTE                                 0x1400
191 #define GL_UNSIGNED_BYTE                        0x1401
192 #define GL_SHORT                                0x1402
193 #define GL_UNSIGNED_SHORT                       0x1403
194 #define GL_INT                                  0x1404
195 #define GL_UNSIGNED_INT                         0x1405
196 #define GL_FLOAT                                0x1406
197 #define GL_DOUBLE                               0x140A
198 #define GL_2_BYTES                              0x1407
199 #define GL_3_BYTES                              0x1408
200 #define GL_4_BYTES                              0x1409
201
202 #define GL_VERTEX_ARRAY                         0x8074
203 #define GL_NORMAL_ARRAY                         0x8075
204 #define GL_COLOR_ARRAY                          0x8076
205 //#define GL_INDEX_ARRAY                                0x8077
206 #define GL_TEXTURE_COORD_ARRAY                  0x8078
207 //#define GL_EDGE_FLAG_ARRAY                    0x8079
208
209 #define GL_NONE                                 0
210 #define GL_FRONT_LEFT                   0x0400
211 #define GL_FRONT_RIGHT                  0x0401
212 #define GL_BACK_LEFT                    0x0402
213 #define GL_BACK_RIGHT                   0x0403
214 #define GL_FRONT                                0x0404
215 #define GL_BACK                                 0x0405
216 #define GL_LEFT                                 0x0406
217 #define GL_RIGHT                                0x0407
218 #define GL_FRONT_AND_BACK               0x0408
219 #define GL_AUX0                                 0x0409
220 #define GL_AUX1                                 0x040A
221 #define GL_AUX2                                 0x040B
222 #define GL_AUX3                                 0x040C
223
224 #define GL_VENDOR                               0x1F00
225 #define GL_RENDERER                             0x1F01
226 #define GL_VERSION                              0x1F02
227 #define GL_EXTENSIONS                           0x1F03
228
229 #define GL_NO_ERROR                             0x0
230 #define GL_INVALID_VALUE                        0x0501
231 #define GL_INVALID_ENUM                         0x0500
232 #define GL_INVALID_OPERATION                    0x0502
233 #define GL_STACK_OVERFLOW                       0x0503
234 #define GL_STACK_UNDERFLOW                      0x0504
235 #define GL_OUT_OF_MEMORY                        0x0505
236
237 #define GL_DITHER                               0x0BD0
238 #define GL_ALPHA                                0x1906
239 #define GL_RGB                                  0x1907
240 #define GL_RGBA                                 0x1908
241
242 #define GL_MAX_TEXTURE_SIZE                     0x0D33
243
244 #define GL_NEVER                                0x0200
245 #define GL_LESS                                 0x0201
246 #define GL_EQUAL                                0x0202
247 #define GL_LEQUAL                               0x0203
248 #define GL_GREATER                              0x0204
249 #define GL_NOTEQUAL                             0x0205
250 #define GL_GEQUAL                               0x0206
251 #define GL_ALWAYS                               0x0207
252 #define GL_DEPTH_TEST                           0x0B71
253
254 #define GL_RED_SCALE                            0x0D14
255 #define GL_GREEN_SCALE                          0x0D18
256 #define GL_BLUE_SCALE                           0x0D1A
257 #define GL_ALPHA_SCALE                          0x0D1C
258
259 #define GL_DEPTH_BUFFER_BIT                     0x00000100
260 #define GL_ACCUM_BUFFER_BIT                     0x00000200
261 #define GL_STENCIL_BUFFER_BIT                   0x00000400
262 #define GL_COLOR_BUFFER_BIT                     0x00004000
263
264 #define GL_STENCIL_TEST                         0x0B90
265 #define GL_KEEP                                 0x1E00
266 #define GL_REPLACE                              0x1E01
267 #define GL_INCR                                 0x1E02
268 #define GL_DECR                                 0x1E03
269
270 #define GL_POLYGON_OFFSET_FACTOR          0x8038
271 #define GL_POLYGON_OFFSET_UNITS           0x2A00
272 #define GL_POLYGON_OFFSET_POINT           0x2A01
273 #define GL_POLYGON_OFFSET_LINE            0x2A02
274 #define GL_POLYGON_OFFSET_FILL            0x8037
275
276 #define GL_POINT_SMOOTH                         0x0B10
277 #define GL_LINE_SMOOTH                          0x0B20
278 #define GL_POLYGON_SMOOTH                       0x0B41
279
280 #define GL_POLYGON_STIPPLE                0x0B42
281
282 #define GL_CLIP_PLANE0                    0x3000
283 #define GL_CLIP_PLANE1                    0x3001
284 #define GL_CLIP_PLANE2                    0x3002
285 #define GL_CLIP_PLANE3                    0x3003
286 #define GL_CLIP_PLANE4                    0x3004
287 #define GL_CLIP_PLANE5                    0x3005
288
289 #define GL_DEPTH_COMPONENT                0x1902
290 #define GL_VIEWPORT                       0x0BA2
291 #define GL_DRAW_BUFFER                    0x0C01
292 #define GL_READ_BUFFER                    0x0C02
293 #define GL_LUMINANCE                      0x1909
294 #define GL_INTENSITY                      0x8049
295
296 #endif
297
298 //GL_EXT_texture_filter_anisotropic
299 #ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
300 #define GL_TEXTURE_MAX_ANISOTROPY_EXT       0x84FE
301 #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT   0x84FF
302 #endif
303
304 // GL_ARB_depth_texture
305 #ifndef GL_DEPTH_COMPONENT32_ARB
306 #define GL_DEPTH_COMPONENT16_ARB          0x81A5
307 #define GL_DEPTH_COMPONENT24_ARB          0x81A6
308 #define GL_DEPTH_COMPONENT32_ARB          0x81A7
309 #define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A
310 #define GL_DEPTH_TEXTURE_MODE_ARB         0x884B
311 #endif
312
313 // GL_ARB_shadow
314 #ifndef GL_TEXTURE_COMPARE_MODE_ARB
315 #define GL_TEXTURE_COMPARE_MODE_ARB       0x884C
316 #define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D
317 #define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E
318 #endif
319
320 // GL_ARB_multitexture
321 extern void (GLAPIENTRY *qglMultiTexCoord1f) (GLenum, GLfloat);
322 extern void (GLAPIENTRY *qglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
323 extern void (GLAPIENTRY *qglMultiTexCoord3f) (GLenum, GLfloat, GLfloat, GLfloat);
324 extern void (GLAPIENTRY *qglMultiTexCoord4f) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
325 extern void (GLAPIENTRY *qglActiveTexture) (GLenum);
326 extern void (GLAPIENTRY *qglClientActiveTexture) (GLenum);
327 #ifndef GL_ACTIVE_TEXTURE
328 #define GL_ACTIVE_TEXTURE                       0x84E0
329 #define GL_CLIENT_ACTIVE_TEXTURE        0x84E1
330 #define GL_MAX_TEXTURE_UNITS            0x84E2
331 #define GL_TEXTURE0                                     0x84C0
332 #define GL_TEXTURE1                                     0x84C1
333 #define GL_TEXTURE2                                     0x84C2
334 #define GL_TEXTURE3                                     0x84C3
335 #define GL_TEXTURE4                                     0x84C4
336 #define GL_TEXTURE5                                     0x84C5
337 #define GL_TEXTURE6                                     0x84C6
338 #define GL_TEXTURE7                                     0x84C7
339 #define GL_TEXTURE8                                     0x84C8
340 #define GL_TEXTURE9                                     0x84C9
341 #define GL_TEXTURE10                            0x84CA
342 #define GL_TEXTURE11                            0x84CB
343 #define GL_TEXTURE12                            0x84CC
344 #define GL_TEXTURE13                            0x84CD
345 #define GL_TEXTURE14                            0x84CE
346 #define GL_TEXTURE15                            0x84CF
347 #define GL_TEXTURE16                            0x84D0
348 #define GL_TEXTURE17                            0x84D1
349 #define GL_TEXTURE18                            0x84D2
350 #define GL_TEXTURE19                            0x84D3
351 #define GL_TEXTURE20                            0x84D4
352 #define GL_TEXTURE21                            0x84D5
353 #define GL_TEXTURE22                            0x84D6
354 #define GL_TEXTURE23                            0x84D7
355 #define GL_TEXTURE24                            0x84D8
356 #define GL_TEXTURE25                            0x84D9
357 #define GL_TEXTURE26                            0x84DA
358 #define GL_TEXTURE27                            0x84DB
359 #define GL_TEXTURE28                            0x84DC
360 #define GL_TEXTURE29                            0x84DD
361 #define GL_TEXTURE30                            0x84DE
362 #define GL_TEXTURE31                            0x84DF
363 #endif
364
365 // GL_ARB_texture_env_combine
366 #ifndef GL_COMBINE
367 #define GL_COMBINE                                      0x8570
368 #define GL_COMBINE_RGB                          0x8571
369 #define GL_COMBINE_ALPHA                        0x8572
370 #define GL_SOURCE0_RGB                          0x8580
371 #define GL_SOURCE1_RGB                          0x8581
372 #define GL_SOURCE2_RGB                          0x8582
373 #define GL_SOURCE0_ALPHA                        0x8588
374 #define GL_SOURCE1_ALPHA                        0x8589
375 #define GL_SOURCE2_ALPHA                        0x858A
376 #define GL_OPERAND0_RGB                         0x8590
377 #define GL_OPERAND1_RGB                         0x8591
378 #define GL_OPERAND2_RGB                         0x8592
379 #define GL_OPERAND0_ALPHA                       0x8598
380 #define GL_OPERAND1_ALPHA                       0x8599
381 #define GL_OPERAND2_ALPHA                       0x859A
382 #define GL_RGB_SCALE                            0x8573
383 #define GL_ADD_SIGNED                           0x8574
384 #define GL_INTERPOLATE                          0x8575
385 #define GL_SUBTRACT                                     0x84E7
386 #define GL_CONSTANT                                     0x8576
387 #define GL_PRIMARY_COLOR                        0x8577
388 #define GL_PREVIOUS                                     0x8578
389 #endif
390
391 #ifndef GL_MAX_ELEMENTS_VERTICES
392 #define GL_MAX_ELEMENTS_VERTICES                0x80E8
393 #endif
394 #ifndef GL_MAX_ELEMENTS_INDICES
395 #define GL_MAX_ELEMENTS_INDICES                 0x80E9
396 #endif
397
398
399 #ifndef GL_TEXTURE_3D
400 #define GL_PACK_SKIP_IMAGES                     0x806B
401 #define GL_PACK_IMAGE_HEIGHT                    0x806C
402 #define GL_UNPACK_SKIP_IMAGES                   0x806D
403 #define GL_UNPACK_IMAGE_HEIGHT                  0x806E
404 #define GL_TEXTURE_3D                           0x806F
405 #define GL_PROXY_TEXTURE_3D                     0x8070
406 #define GL_TEXTURE_DEPTH                        0x8071
407 #define GL_TEXTURE_WRAP_R                       0x8072
408 #define GL_MAX_3D_TEXTURE_SIZE                  0x8073
409 #define GL_TEXTURE_BINDING_3D                   0x806A
410 extern void (GLAPIENTRY *qglTexImage3D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
411 extern void (GLAPIENTRY *qglTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
412 extern void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
413 #endif
414
415 #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X
416 #define GL_NORMAL_MAP                       0x8511
417 #define GL_REFLECTION_MAP                   0x8512
418 #define GL_TEXTURE_CUBE_MAP                 0x8513
419 #define GL_TEXTURE_BINDING_CUBE_MAP         0x8514
420 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X     0x8515
421 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X     0x8516
422 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y     0x8517
423 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y     0x8518
424 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z     0x8519
425 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z     0x851A
426 #define GL_PROXY_TEXTURE_CUBE_MAP           0x851B
427 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE            0x851C
428 #endif
429
430 #ifndef GL_DEPTH_COMPONENT16_ARB
431 #define GL_DEPTH_COMPONENT16_ARB       0x81A5
432 #define GL_DEPTH_COMPONENT24_ARB       0x81A6
433 #define GL_DEPTH_COMPONENT32_ARB       0x81A7
434 #define GL_TEXTURE_DEPTH_SIZE_ARB      0x884A
435 #define GL_DEPTH_TEXTURE_MODE_ARB      0x884B
436 #endif
437
438 #ifndef GL_SCISSOR_TEST
439 #define GL_SCISSOR_TEST                         0x0C11
440 #define GL_SCISSOR_BOX                          0x0C10
441 #endif
442
443 // GL_SGIS_texture_edge_clamp or GL_EXT_texture_edge_clamp
444 #ifndef GL_CLAMP_TO_EDGE
445 #define GL_CLAMP_TO_EDGE 0x812F
446 #endif
447
448 //GL_ATI_separate_stencil
449 #ifndef GL_STENCIL_BACK_FUNC
450 #define GL_STENCIL_BACK_FUNC              0x8800
451 #define GL_STENCIL_BACK_FAIL              0x8801
452 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
453 #define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
454 #endif
455 extern void (GLAPIENTRY *qglStencilOpSeparate)(GLenum, GLenum, GLenum, GLenum);
456 extern void (GLAPIENTRY *qglStencilFuncSeparate)(GLenum, GLenum, GLint, GLuint);
457
458 //GL_EXT_stencil_two_side
459 #define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910
460 #define GL_ACTIVE_STENCIL_FACE_EXT        0x8911
461 extern void (GLAPIENTRY *qglActiveStencilFaceEXT)(GLenum);
462
463 //GL_EXT_blend_minmax
464 #ifndef GL_FUNC_ADD
465 #define GL_FUNC_ADD                   0x8006 // also supplied by GL_blend_subtract
466 #define GL_MIN                        0x8007
467 #define GL_MAX                        0x8008
468 #define GL_BLEND_EQUATION             0x8009 // also supplied by GL_blend_subtract
469 extern void (GLAPIENTRY *qglBlendEquationEXT)(GLenum); // also supplied by GL_blend_subtract
470 #endif
471
472 //GL_EXT_blend_subtract
473 #ifndef GL_FUNC_SUBTRACT
474 #define GL_FUNC_SUBTRACT              0x800A
475 #define GL_FUNC_REVERSE_SUBTRACT      0x800B
476 extern void (GLAPIENTRY *qglBlendEquationEXT)(GLenum); // also supplied by GL_blend_subtract
477 #endif
478
479 //GL_ARB_texture_non_power_of_two
480
481 //GL_ARB_vertex_buffer_object
482 #ifndef GL_ARRAY_BUFFER
483 #define GL_ARRAY_BUFFER               0x8892
484 #define GL_ELEMENT_ARRAY_BUFFER       0x8893
485 #define GL_ARRAY_BUFFER_BINDING       0x8894
486 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
487 #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
488 #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
489 #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
490 #define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
491 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
492 #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
493 #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
494 #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
495 #define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
496 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
497 #define GL_STREAM_DRAW                0x88E0
498 #define GL_STREAM_READ                0x88E1
499 #define GL_STREAM_COPY                0x88E2
500 #define GL_STATIC_DRAW                0x88E4
501 #define GL_STATIC_READ                0x88E5
502 #define GL_STATIC_COPY                0x88E6
503 #define GL_DYNAMIC_DRAW               0x88E8
504 #define GL_DYNAMIC_READ               0x88E9
505 #define GL_DYNAMIC_COPY               0x88EA
506 #define GL_READ_ONLY                  0x88B8
507 #define GL_WRITE_ONLY                 0x88B9
508 #define GL_READ_WRITE                 0x88BA
509 #define GL_BUFFER_SIZE                0x8764
510 #define GL_BUFFER_USAGE               0x8765
511 #define GL_BUFFER_ACCESS              0x88BB
512 #define GL_BUFFER_MAPPED              0x88BC
513 #define GL_BUFFER_MAP_POINTER         0x88BD
514 #endif
515 extern void (GLAPIENTRY *qglBindBufferARB) (GLenum target, GLuint buffer);
516 extern void (GLAPIENTRY *qglDeleteBuffersARB) (GLsizei n, const GLuint *buffers);
517 extern void (GLAPIENTRY *qglGenBuffersARB) (GLsizei n, GLuint *buffers);
518 extern GLboolean (GLAPIENTRY *qglIsBufferARB) (GLuint buffer);
519 extern GLvoid* (GLAPIENTRY *qglMapBufferARB) (GLenum target, GLenum access);
520 extern GLboolean (GLAPIENTRY *qglUnmapBufferARB) (GLenum target);
521 extern void (GLAPIENTRY *qglBufferDataARB) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
522 extern void (GLAPIENTRY *qglBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
523
524 //GL_ARB_framebuffer_object
525 // (slight differences from GL_EXT_framebuffer_object as this integrates GL_EXT_packed_depth_stencil)
526 #ifndef GL_FRAMEBUFFER
527 #define GL_FRAMEBUFFER                     0x8D40
528 #define GL_READ_FRAMEBUFFER                0x8CA8
529 #define GL_DRAW_FRAMEBUFFER                0x8CA9
530 #define GL_RENDERBUFFER                    0x8D41
531 #define GL_STENCIL_INDEX1                  0x8D46
532 #define GL_STENCIL_INDEX4                  0x8D47
533 #define GL_STENCIL_INDEX8                  0x8D48
534 #define GL_STENCIL_INDEX16                 0x8D49
535 #define GL_RENDERBUFFER_WIDTH              0x8D42
536 #define GL_RENDERBUFFER_HEIGHT             0x8D43
537 #define GL_RENDERBUFFER_INTERNAL_FORMAT    0x8D44
538 #define GL_RENDERBUFFER_RED_SIZE           0x8D50
539 #define GL_RENDERBUFFER_GREEN_SIZE         0x8D51
540 #define GL_RENDERBUFFER_BLUE_SIZE          0x8D52
541 #define GL_RENDERBUFFER_ALPHA_SIZE         0x8D53
542 #define GL_RENDERBUFFER_DEPTH_SIZE         0x8D54
543 #define GL_RENDERBUFFER_STENCIL_SIZE       0x8D55
544 #define GL_RENDERBUFFER_SAMPLES            0x8CAB
545 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE            0x8CD0
546 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME            0x8CD1
547 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL          0x8CD2
548 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE  0x8CD3
549 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER          0x8CD4
550 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING         0x8210
551 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE         0x8211
552 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE               0x8212
553 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE             0x8213
554 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE              0x8214
555 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE             0x8215
556 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE             0x8216
557 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE           0x8217
558 #define GL_SRGB                                          0x8C40
559 #define GL_UNSIGNED_NORMALIZED                           0x8C17
560 #define GL_FRAMEBUFFER_DEFAULT                           0x8218
561 #define GL_INDEX                                         0x8222
562 #define GL_COLOR_ATTACHMENT0                0x8CE0
563 #define GL_COLOR_ATTACHMENT1                0x8CE1
564 #define GL_COLOR_ATTACHMENT2                0x8CE2
565 #define GL_COLOR_ATTACHMENT3                0x8CE3
566 #define GL_COLOR_ATTACHMENT4                0x8CE4
567 #define GL_COLOR_ATTACHMENT5                0x8CE5
568 #define GL_COLOR_ATTACHMENT6                0x8CE6
569 #define GL_COLOR_ATTACHMENT7                0x8CE7
570 #define GL_COLOR_ATTACHMENT8                0x8CE8
571 #define GL_COLOR_ATTACHMENT9                0x8CE9
572 #define GL_COLOR_ATTACHMENT10               0x8CEA
573 #define GL_COLOR_ATTACHMENT11               0x8CEB
574 #define GL_COLOR_ATTACHMENT12               0x8CEC
575 #define GL_COLOR_ATTACHMENT13               0x8CED
576 #define GL_COLOR_ATTACHMENT14               0x8CEE
577 #define GL_COLOR_ATTACHMENT15               0x8CEF
578 #define GL_DEPTH_ATTACHMENT                 0x8D00
579 #define GL_STENCIL_ATTACHMENT               0x8D20
580 #define GL_DEPTH_STENCIL_ATTACHMENT         0x821A
581 #define GL_MAX_SAMPLES                     0x8D57
582 #define GL_FRAMEBUFFER_COMPLETE                          0x8CD5
583 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT             0x8CD6
584 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT     0x8CD7
585 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER            0x8CDB
586 #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER            0x8CDC
587 #define GL_FRAMEBUFFER_UNSUPPORTED                       0x8CDD
588 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE            0x8D56
589 #define GL_FRAMEBUFFER_UNDEFINED                         0x8219
590 #define GL_FRAMEBUFFER_BINDING             0x8CA6 // alias DRAW_FRAMEBUFFER_BINDING
591 #define GL_DRAW_FRAMEBUFFER_BINDING        0x8CA6
592 #define GL_READ_FRAMEBUFFER_BINDING        0x8CAA
593 #define GL_RENDERBUFFER_BINDING            0x8CA7
594 #define GL_MAX_COLOR_ATTACHMENTS           0x8CDF
595 #define GL_MAX_RENDERBUFFER_SIZE           0x84E8
596 #define GL_INVALID_FRAMEBUFFER_OPERATION   0x0506
597 #define GL_DEPTH_STENCIL                              0x84F9
598 #define GL_UNSIGNED_INT_24_8                          0x84FA
599 #define GL_DEPTH24_STENCIL8                           0x88F0
600 #define GL_TEXTURE_STENCIL_SIZE                       0x88F1
601 #endif
602 extern GLboolean (GLAPIENTRY *qglIsRenderbuffer)(GLuint renderbuffer);
603 extern GLvoid (GLAPIENTRY *qglBindRenderbuffer)(GLenum target, GLuint renderbuffer);
604 extern GLvoid (GLAPIENTRY *qglDeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers);
605 extern GLvoid (GLAPIENTRY *qglGenRenderbuffers)(GLsizei n, GLuint *renderbuffers);
606 extern GLvoid (GLAPIENTRY *qglRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
607 extern GLvoid (GLAPIENTRY *qglRenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
608 extern GLvoid (GLAPIENTRY *qglGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params);
609 extern GLboolean (GLAPIENTRY *qglIsFramebuffer)(GLuint framebuffer);
610 extern GLvoid (GLAPIENTRY *qglBindFramebuffer)(GLenum target, GLuint framebuffer);
611 extern GLvoid (GLAPIENTRY *qglDeleteFramebuffers)(GLsizei n, const GLuint *framebuffers);
612 extern GLvoid (GLAPIENTRY *qglGenFramebuffers)(GLsizei n, GLuint *framebuffers);
613 extern GLenum (GLAPIENTRY *qglCheckFramebufferStatus)(GLenum target);
614 extern GLvoid (GLAPIENTRY *qglFramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
615 extern GLvoid (GLAPIENTRY *qglFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
616 extern GLvoid (GLAPIENTRY *qglFramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
617 extern GLvoid (GLAPIENTRY *qglFramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
618 extern GLvoid (GLAPIENTRY *qglFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
619 extern GLvoid (GLAPIENTRY *qglGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
620 extern GLvoid (GLAPIENTRY *qglBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
621 extern GLvoid (GLAPIENTRY *qglGenerateMipmap)(GLenum target);
622
623 // GL_ARB_draw_buffers
624 #ifndef GL_MAX_DRAW_BUFFERS_ARB
625 #define GL_MAX_DRAW_BUFFERS_ARB                              0x8824
626 #define GL_DRAW_BUFFER0_ARB                                  0x8825
627 #define GL_DRAW_BUFFER1_ARB                                  0x8826
628 #define GL_DRAW_BUFFER2_ARB                                  0x8827
629 #define GL_DRAW_BUFFER3_ARB                                  0x8828
630 #define GL_DRAW_BUFFER4_ARB                                  0x8829
631 #define GL_DRAW_BUFFER5_ARB                                  0x882A
632 #define GL_DRAW_BUFFER6_ARB                                  0x882B
633 #define GL_DRAW_BUFFER7_ARB                                  0x882C
634 #define GL_DRAW_BUFFER8_ARB                                  0x882D
635 #define GL_DRAW_BUFFER9_ARB                                  0x882E
636 #define GL_DRAW_BUFFER10_ARB                                 0x882F
637 #define GL_DRAW_BUFFER11_ARB                                 0x8830
638 #define GL_DRAW_BUFFER12_ARB                                 0x8831
639 #define GL_DRAW_BUFFER13_ARB                                 0x8832
640 #define GL_DRAW_BUFFER14_ARB                                 0x8833
641 #define GL_DRAW_BUFFER15_ARB                                 0x8834
642 #endif
643 extern void (GLAPIENTRY *qglDrawBuffersARB)(GLsizei n, const GLenum *bufs);
644
645 // GL_ARB_texture_float
646 #ifndef GL_RGBA32F_ARB
647 #define GL_RGBA32F_ARB                                       0x8814
648 #define GL_RGB32F_ARB                                        0x8815
649 #define GL_ALPHA32F_ARB                                      0x8816
650 #define GL_INTENSITY32F_ARB                                  0x8817
651 #define GL_LUMINANCE32F_ARB                                  0x8818
652 #define GL_LUMINANCE_ALPHA32F_ARB                            0x8819
653 #define GL_RGBA16F_ARB                                       0x881A
654 #define GL_RGB16F_ARB                                        0x881B
655 #define GL_ALPHA16F_ARB                                      0x881C
656 #define GL_INTENSITY16F_ARB                                  0x881D
657 #define GL_LUMINANCE16F_ARB                                  0x881E
658 #define GL_LUMINANCE_ALPHA16F_ARB                            0x881F
659 #endif
660
661 // GL_ARB_half_float_pixel
662 #ifndef GL_HALF_FLOAT_ARB
663 typedef unsigned short GLhalfARB;
664 #define GL_HALF_FLOAT_ARB                                    0x140B
665 #endif
666
667 // GL_EXT_texture_sRGB
668 #ifndef GL_SRGB_EXT
669 #define GL_SRGB_EXT                                          0x8C40
670 #define GL_SRGB8_EXT                                         0x8C41
671 #define GL_SRGB_ALPHA_EXT                                    0x8C42
672 #define GL_SRGB8_ALPHA8_EXT                                  0x8C43
673 #define GL_SLUMINANCE_ALPHA_EXT                              0x8C44
674 #define GL_SLUMINANCE8_ALPHA8_EXT                            0x8C45
675 #define GL_SLUMINANCE_EXT                                    0x8C46
676 #define GL_SLUMINANCE8_EXT                                   0x8C47
677 #define GL_COMPRESSED_SRGB_EXT                               0x8C48
678 #define GL_COMPRESSED_SRGB_ALPHA_EXT                         0x8C49
679 #define GL_COMPRESSED_SLUMINANCE_EXT                         0x8C4A
680 #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT                   0x8C4B
681 #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT                     0x8C4C
682 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT               0x8C4D
683 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT               0x8C4E
684 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT               0x8C4F
685 #endif
686
687 // GL_ARB_uniform_buffer_object
688 #ifndef GL_UNIFORM_BUFFER
689 #define GL_UNIFORM_BUFFER                                    0x8A11
690 #define GL_UNIFORM_BUFFER_BINDING                            0x8A28
691 #define GL_UNIFORM_BUFFER_START                              0x8A29
692 #define GL_UNIFORM_BUFFER_SIZE                               0x8A2A
693 #define GL_MAX_VERTEX_UNIFORM_BLOCKS                         0x8A2B
694 #define GL_MAX_GEOMETRY_UNIFORM_BLOCKS                       0x8A2C
695 #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS                       0x8A2D
696 #define GL_MAX_COMBINED_UNIFORM_BLOCKS                       0x8A2E
697 #define GL_MAX_UNIFORM_BUFFER_BINDINGS                       0x8A2F
698 #define GL_MAX_UNIFORM_BLOCK_SIZE                            0x8A30
699 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS            0x8A31
700 #define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS          0x8A32
701 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS          0x8A33
702 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT                   0x8A34
703 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH              0x8A35
704 #define GL_ACTIVE_UNIFORM_BLOCKS                             0x8A36
705 #define GL_UNIFORM_TYPE                                      0x8A37
706 #define GL_UNIFORM_SIZE                                      0x8A38
707 #define GL_UNIFORM_NAME_LENGTH                               0x8A39
708 #define GL_UNIFORM_BLOCK_INDEX                               0x8A3A
709 #define GL_UNIFORM_OFFSET                                    0x8A3B
710 #define GL_UNIFORM_ARRAY_STRIDE                              0x8A3C
711 #define GL_UNIFORM_MATRIX_STRIDE                             0x8A3D
712 #define GL_UNIFORM_IS_ROW_MAJOR                              0x8A3E
713 #define GL_UNIFORM_BLOCK_BINDING                             0x8A3F
714 #define GL_UNIFORM_BLOCK_DATA_SIZE                           0x8A40
715 #define GL_UNIFORM_BLOCK_NAME_LENGTH                         0x8A41
716 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS                     0x8A42
717 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES              0x8A43
718 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER         0x8A44
719 #define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER       0x8A45
720 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER       0x8A46
721 #define GL_INVALID_INDEX                                     0xFFFFFFFFu
722 #endif
723 extern void (GLAPIENTRY *qglGetUniformIndices)(GLuint program, GLsizei uniformCount, const char** uniformNames, GLuint* uniformIndices);
724 extern void (GLAPIENTRY *qglGetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
725 extern void (GLAPIENTRY *qglGetActiveUniformName)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, char* uniformName);
726 extern GLuint (GLAPIENTRY *qglGetUniformBlockIndex)(GLuint program, const char* uniformBlockName);
727 extern void (GLAPIENTRY *qglGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname,  GLint* params);
728 extern void (GLAPIENTRY *qglGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, char* uniformBlockName);
729 extern void (GLAPIENTRY *qglBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptrARB offset, GLsizeiptrARB size);
730 extern void (GLAPIENTRY *qglBindBufferBase)(GLenum target, GLuint index, GLuint buffer);
731 extern void (GLAPIENTRY *qglGetIntegeri_v)(GLenum target, GLuint index, GLint* data);
732 extern void (GLAPIENTRY *qglUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
733
734 extern void (GLAPIENTRY *qglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
735
736 extern void (GLAPIENTRY *qglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
737
738 extern void (GLAPIENTRY *qglClear)(GLbitfield mask);
739
740 extern void (GLAPIENTRY *qglAlphaFunc)(GLenum func, GLclampf ref);
741 extern void (GLAPIENTRY *qglBlendFunc)(GLenum sfactor, GLenum dfactor);
742 extern void (GLAPIENTRY *qglCullFace)(GLenum mode);
743
744 extern void (GLAPIENTRY *qglDrawBuffer)(GLenum mode);
745 extern void (GLAPIENTRY *qglReadBuffer)(GLenum mode);
746 extern void (GLAPIENTRY *qglEnable)(GLenum cap);
747 extern void (GLAPIENTRY *qglDisable)(GLenum cap);
748 extern GLboolean (GLAPIENTRY *qglIsEnabled)(GLenum cap);
749
750 extern void (GLAPIENTRY *qglEnableClientState)(GLenum cap);
751 extern void (GLAPIENTRY *qglDisableClientState)(GLenum cap);
752
753 extern void (GLAPIENTRY *qglGetBooleanv)(GLenum pname, GLboolean *params);
754 extern void (GLAPIENTRY *qglGetDoublev)(GLenum pname, GLdouble *params);
755 extern void (GLAPIENTRY *qglGetFloatv)(GLenum pname, GLfloat *params);
756 extern void (GLAPIENTRY *qglGetIntegerv)(GLenum pname, GLint *params);
757
758 extern GLenum (GLAPIENTRY *qglGetError)(void);
759 extern const GLubyte* (GLAPIENTRY *qglGetString)(GLenum name);
760 extern void (GLAPIENTRY *qglFinish)(void);
761 extern void (GLAPIENTRY *qglFlush)(void);
762
763 extern void (GLAPIENTRY *qglClearDepth)(GLclampd depth);
764 extern void (GLAPIENTRY *qglDepthFunc)(GLenum func);
765 extern void (GLAPIENTRY *qglDepthMask)(GLboolean flag);
766 extern void (GLAPIENTRY *qglDepthRange)(GLclampd near_val, GLclampd far_val);
767 extern void (GLAPIENTRY *qglDepthRangef)(GLclampf near_val, GLclampf far_val);
768 extern void (GLAPIENTRY *qglColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
769
770 extern void (GLAPIENTRY *qglDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
771 extern void (GLAPIENTRY *qglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
772 extern void (GLAPIENTRY *qglDrawArrays)(GLenum mode, GLint first, GLsizei count);
773 extern void (GLAPIENTRY *qglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
774 extern void (GLAPIENTRY *qglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr);
775 extern void (GLAPIENTRY *qglColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
776 extern void (GLAPIENTRY *qglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
777 extern void (GLAPIENTRY *qglArrayElement)(GLint i);
778
779 extern void (GLAPIENTRY *qglColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
780 extern void (GLAPIENTRY *qglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
781 extern void (GLAPIENTRY *qglTexCoord1f)(GLfloat s);
782 extern void (GLAPIENTRY *qglTexCoord2f)(GLfloat s, GLfloat t);
783 extern void (GLAPIENTRY *qglTexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
784 extern void (GLAPIENTRY *qglTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
785 extern void (GLAPIENTRY *qglVertex2f)(GLfloat x, GLfloat y);
786 extern void (GLAPIENTRY *qglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
787 extern void (GLAPIENTRY *qglVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
788 extern void (GLAPIENTRY *qglBegin)(GLenum mode);
789 extern void (GLAPIENTRY *qglEnd)(void);
790
791 extern void (GLAPIENTRY *qglMatrixMode)(GLenum mode);
792 //extern void (GLAPIENTRY *qglOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
793 //extern void (GLAPIENTRY *qglFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
794 extern void (GLAPIENTRY *qglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
795 //extern void (GLAPIENTRY *qglPushMatrix)(void);
796 //extern void (GLAPIENTRY *qglPopMatrix)(void);
797 extern void (GLAPIENTRY *qglLoadIdentity)(void);
798 //extern void (GLAPIENTRY *qglLoadMatrixd)(const GLdouble *m);
799 extern void (GLAPIENTRY *qglLoadMatrixf)(const GLfloat *m);
800 //extern void (GLAPIENTRY *qglMultMatrixd)(const GLdouble *m);
801 //extern void (GLAPIENTRY *qglMultMatrixf)(const GLfloat *m);
802 //extern void (GLAPIENTRY *qglRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
803 //extern void (GLAPIENTRY *qglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
804 //extern void (GLAPIENTRY *qglScaled)(GLdouble x, GLdouble y, GLdouble z);
805 //extern void (GLAPIENTRY *qglScalef)(GLfloat x, GLfloat y, GLfloat z);
806 //extern void (GLAPIENTRY *qglTranslated)(GLdouble x, GLdouble y, GLdouble z);
807 //extern void (GLAPIENTRY *qglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
808
809 extern void (GLAPIENTRY *qglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
810
811 extern void (GLAPIENTRY *qglStencilFunc)(GLenum func, GLint ref, GLuint mask);
812 extern void (GLAPIENTRY *qglStencilMask)(GLuint mask);
813 extern void (GLAPIENTRY *qglStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
814 extern void (GLAPIENTRY *qglClearStencil)(GLint s);
815
816 extern void (GLAPIENTRY *qglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
817 extern void (GLAPIENTRY *qglTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
818 extern void (GLAPIENTRY *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
819 extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
820 extern void (GLAPIENTRY *qglTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
821 extern void (GLAPIENTRY *qglTexParameteri)(GLenum target, GLenum pname, GLint param);
822 extern void (GLAPIENTRY *qglGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
823 extern void (GLAPIENTRY *qglGetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
824 extern void (GLAPIENTRY *qglGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
825 extern void (GLAPIENTRY *qglGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
826 extern void (GLAPIENTRY *qglGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
827 extern void (GLAPIENTRY *qglHint)(GLenum target, GLenum mode);
828
829 extern void (GLAPIENTRY *qglGenTextures)(GLsizei n, GLuint *textures);
830 extern void (GLAPIENTRY *qglDeleteTextures)(GLsizei n, const GLuint *textures);
831 extern void (GLAPIENTRY *qglBindTexture)(GLenum target, GLuint texture);
832 //extern void (GLAPIENTRY *qglPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
833 //extern GLboolean (GLAPIENTRY *qglAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
834 //extern GLboolean (GLAPIENTRY *qglIsTexture)(GLuint texture);
835 //extern void (GLAPIENTRY *qglPixelStoref)(GLenum pname, GLfloat param);
836 extern void (GLAPIENTRY *qglPixelStorei)(GLenum pname, GLint param);
837
838 //extern void (GLAPIENTRY *qglTexImage1D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
839 extern void (GLAPIENTRY *qglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
840 //extern void (GLAPIENTRY *qglTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
841 extern void (GLAPIENTRY *qglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
842 //extern void (GLAPIENTRY *qglCopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
843 extern void (GLAPIENTRY *qglCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
844 //extern void (GLAPIENTRY *qglCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
845 extern void (GLAPIENTRY *qglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
846
847 extern void (GLAPIENTRY *qglPolygonOffset)(GLfloat factor, GLfloat units);
848 extern void (GLAPIENTRY *qglPolygonMode)(GLenum face, GLenum mode);
849
850 //extern void (GLAPIENTRY *qglClipPlane)(GLenum plane, const GLdouble *equation);
851 //extern void (GLAPIENTRY *qglGetClipPlane)(GLenum plane, GLdouble *equation);
852
853 //[515]: added on 29.07.2005
854 extern void (GLAPIENTRY *qglLineWidth)(GLfloat width);
855 extern void (GLAPIENTRY *qglPointSize)(GLfloat size);
856
857 // GL 2.0 shader objects
858 #ifndef GL_PROGRAM_OBJECT
859 // 1-byte character string
860 typedef char GLchar;
861 #endif
862 extern void (GLAPIENTRY *qglDeleteShader)(GLuint obj);
863 extern void (GLAPIENTRY *qglDeleteProgram)(GLuint obj);
864 //extern GLuint (GLAPIENTRY *qglGetHandle)(GLenum pname);
865 extern void (GLAPIENTRY *qglDetachShader)(GLuint containerObj, GLuint attachedObj);
866 extern GLuint (GLAPIENTRY *qglCreateShader)(GLenum shaderType);
867 extern void (GLAPIENTRY *qglShaderSource)(GLuint shaderObj, GLsizei count, const GLchar **string, const GLint *length);
868 extern void (GLAPIENTRY *qglCompileShader)(GLuint shaderObj);
869 extern GLuint (GLAPIENTRY *qglCreateProgram)(void);
870 extern void (GLAPIENTRY *qglAttachShader)(GLuint containerObj, GLuint obj);
871 extern void (GLAPIENTRY *qglLinkProgram)(GLuint programObj);
872 extern void (GLAPIENTRY *qglUseProgram)(GLuint programObj);
873 extern void (GLAPIENTRY *qglValidateProgram)(GLuint programObj);
874 extern void (GLAPIENTRY *qglUniform1f)(GLint location, GLfloat v0);
875 extern void (GLAPIENTRY *qglUniform2f)(GLint location, GLfloat v0, GLfloat v1);
876 extern void (GLAPIENTRY *qglUniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
877 extern void (GLAPIENTRY *qglUniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
878 extern void (GLAPIENTRY *qglUniform1i)(GLint location, GLint v0);
879 extern void (GLAPIENTRY *qglUniform2i)(GLint location, GLint v0, GLint v1);
880 extern void (GLAPIENTRY *qglUniform3i)(GLint location, GLint v0, GLint v1, GLint v2);
881 extern void (GLAPIENTRY *qglUniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
882 extern void (GLAPIENTRY *qglUniform1fv)(GLint location, GLsizei count, const GLfloat *value);
883 extern void (GLAPIENTRY *qglUniform2fv)(GLint location, GLsizei count, const GLfloat *value);
884 extern void (GLAPIENTRY *qglUniform3fv)(GLint location, GLsizei count, const GLfloat *value);
885 extern void (GLAPIENTRY *qglUniform4fv)(GLint location, GLsizei count, const GLfloat *value);
886 extern void (GLAPIENTRY *qglUniform1iv)(GLint location, GLsizei count, const GLint *value);
887 extern void (GLAPIENTRY *qglUniform2iv)(GLint location, GLsizei count, const GLint *value);
888 extern void (GLAPIENTRY *qglUniform3iv)(GLint location, GLsizei count, const GLint *value);
889 extern void (GLAPIENTRY *qglUniform4iv)(GLint location, GLsizei count, const GLint *value);
890 extern void (GLAPIENTRY *qglUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
891 extern void (GLAPIENTRY *qglUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
892 extern void (GLAPIENTRY *qglUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
893 extern void (GLAPIENTRY *qglGetShaderiv)(GLuint obj, GLenum pname, GLint *params);
894 extern void (GLAPIENTRY *qglGetProgramiv)(GLuint obj, GLenum pname, GLint *params);
895 extern void (GLAPIENTRY *qglGetShaderInfoLog)(GLuint obj, GLsizei maxLength, GLsizei *length, GLchar *infoLog);
896 extern void (GLAPIENTRY *qglGetProgramInfoLog)(GLuint obj, GLsizei maxLength, GLsizei *length, GLchar *infoLog);
897 extern void (GLAPIENTRY *qglGetAttachedShaders)(GLuint containerObj, GLsizei maxCount, GLsizei *count, GLuint *obj);
898 extern GLint (GLAPIENTRY *qglGetUniformLocation)(GLuint programObj, const GLchar *name);
899 extern void (GLAPIENTRY *qglGetActiveUniform)(GLuint programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
900 extern void (GLAPIENTRY *qglGetUniformfv)(GLuint programObj, GLint location, GLfloat *params);
901 extern void (GLAPIENTRY *qglGetUniformiv)(GLuint programObj, GLint location, GLint *params);
902 extern void (GLAPIENTRY *qglGetShaderSource)(GLuint obj, GLsizei maxLength, GLsizei *length, GLchar *source);
903 extern void (GLAPIENTRY *qglPolygonStipple)(const GLubyte *mask);
904 #ifndef GL_PROGRAM_OBJECT
905 #define GL_PROGRAM_OBJECT                                       0x8B40
906 #define GL_DELETE_STATUS                                        0x8B80
907 #define GL_COMPILE_STATUS                                       0x8B81
908 #define GL_LINK_STATUS                                          0x8B82
909 #define GL_VALIDATE_STATUS                                      0x8B83
910 #define GL_INFO_LOG_LENGTH                                      0x8B84
911 #define GL_ATTACHED_SHADERS                                     0x8B85
912 #define GL_ACTIVE_UNIFORMS                                      0x8B86
913 #define GL_ACTIVE_UNIFORM_MAX_LENGTH            0x8B87
914 #define GL_SHADER_SOURCE_LENGTH                         0x8B88
915 #define GL_SHADER_OBJECT                                        0x8B48
916 #define GL_SHADER_TYPE                                          0x8B4F
917 #define GL_FLOAT                                                        0x1406
918 #define GL_FLOAT_VEC2                                           0x8B50
919 #define GL_FLOAT_VEC3                                           0x8B51
920 #define GL_FLOAT_VEC4                                           0x8B52
921 #define GL_INT                                                          0x1404
922 #define GL_INT_VEC2                                                     0x8B53
923 #define GL_INT_VEC3                                                     0x8B54
924 #define GL_INT_VEC4                                                     0x8B55
925 #define GL_BOOL                                                         0x8B56
926 #define GL_BOOL_VEC2                                            0x8B57
927 #define GL_BOOL_VEC3                                            0x8B58
928 #define GL_BOOL_VEC4                                            0x8B59
929 #define GL_FLOAT_MAT2                                           0x8B5A
930 #define GL_FLOAT_MAT3                                           0x8B5B
931 #define GL_FLOAT_MAT4                                           0x8B5C
932 #define GL_SAMPLER_1D                                           0x8B5D
933 #define GL_SAMPLER_2D                                           0x8B5E
934 #define GL_SAMPLER_3D                                           0x8B5F
935 #define GL_SAMPLER_CUBE                                         0x8B60
936 #define GL_SAMPLER_1D_SHADOW                            0x8B61
937 #define GL_SAMPLER_2D_SHADOW                            0x8B62
938 #define GL_SAMPLER_2D_RECT                                      0x8B63
939 #define GL_SAMPLER_2D_RECT_SHADOW                       0x8B64
940 #endif
941
942 // GL 2.0 vertex shader
943 extern void (GLAPIENTRY *qglVertexAttrib1f)(GLuint index, GLfloat v0);
944 extern void (GLAPIENTRY *qglVertexAttrib1s)(GLuint index, GLshort v0);
945 extern void (GLAPIENTRY *qglVertexAttrib1d)(GLuint index, GLdouble v0);
946 extern void (GLAPIENTRY *qglVertexAttrib2f)(GLuint index, GLfloat v0, GLfloat v1);
947 extern void (GLAPIENTRY *qglVertexAttrib2s)(GLuint index, GLshort v0, GLshort v1);
948 extern void (GLAPIENTRY *qglVertexAttrib2d)(GLuint index, GLdouble v0, GLdouble v1);
949 extern void (GLAPIENTRY *qglVertexAttrib3f)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2);
950 extern void (GLAPIENTRY *qglVertexAttrib3s)(GLuint index, GLshort v0, GLshort v1, GLshort v2);
951 extern void (GLAPIENTRY *qglVertexAttrib3d)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2);
952 extern void (GLAPIENTRY *qglVertexAttrib4f)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
953 extern void (GLAPIENTRY *qglVertexAttrib4s)(GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3);
954 extern void (GLAPIENTRY *qglVertexAttrib4d)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
955 extern void (GLAPIENTRY *qglVertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
956 extern void (GLAPIENTRY *qglVertexAttrib1fv)(GLuint index, const GLfloat *v);
957 extern void (GLAPIENTRY *qglVertexAttrib1sv)(GLuint index, const GLshort *v);
958 extern void (GLAPIENTRY *qglVertexAttrib1dv)(GLuint index, const GLdouble *v);
959 extern void (GLAPIENTRY *qglVertexAttrib2fv)(GLuint index, const GLfloat *v);
960 extern void (GLAPIENTRY *qglVertexAttrib2sv)(GLuint index, const GLshort *v);
961 extern void (GLAPIENTRY *qglVertexAttrib2dv)(GLuint index, const GLdouble *v);
962 extern void (GLAPIENTRY *qglVertexAttrib3fv)(GLuint index, const GLfloat *v);
963 extern void (GLAPIENTRY *qglVertexAttrib3sv)(GLuint index, const GLshort *v);
964 extern void (GLAPIENTRY *qglVertexAttrib3dv)(GLuint index, const GLdouble *v);
965 extern void (GLAPIENTRY *qglVertexAttrib4fv)(GLuint index, const GLfloat *v);
966 extern void (GLAPIENTRY *qglVertexAttrib4sv)(GLuint index, const GLshort *v);
967 extern void (GLAPIENTRY *qglVertexAttrib4dv)(GLuint index, const GLdouble *v);
968 extern void (GLAPIENTRY *qglVertexAttrib4iv)(GLuint index, const GLint *v);
969 extern void (GLAPIENTRY *qglVertexAttrib4bv)(GLuint index, const GLbyte *v);
970 extern void (GLAPIENTRY *qglVertexAttrib4ubv)(GLuint index, const GLubyte *v);
971 extern void (GLAPIENTRY *qglVertexAttrib4usv)(GLuint index, const GLushort *v);
972 extern void (GLAPIENTRY *qglVertexAttrib4uiv)(GLuint index, const GLuint *v);
973 extern void (GLAPIENTRY *qglVertexAttrib4Nbv)(GLuint index, const GLbyte *v);
974 extern void (GLAPIENTRY *qglVertexAttrib4Nsv)(GLuint index, const GLshort *v);
975 extern void (GLAPIENTRY *qglVertexAttrib4Niv)(GLuint index, const GLint *v);
976 extern void (GLAPIENTRY *qglVertexAttrib4Nubv)(GLuint index, const GLubyte *v);
977 extern void (GLAPIENTRY *qglVertexAttrib4Nusv)(GLuint index, const GLushort *v);
978 extern void (GLAPIENTRY *qglVertexAttrib4Nuiv)(GLuint index, const GLuint *v);
979 extern void (GLAPIENTRY *qglVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
980 extern void (GLAPIENTRY *qglEnableVertexAttribArray)(GLuint index);
981 extern void (GLAPIENTRY *qglDisableVertexAttribArray)(GLuint index);
982 extern void (GLAPIENTRY *qglBindAttribLocation)(GLuint programObj, GLuint index, const GLchar *name);
983 extern void (GLAPIENTRY *qglBindFragDataLocation)(GLuint programObj, GLuint index, const GLchar *name);
984 extern void (GLAPIENTRY *qglGetActiveAttrib)(GLuint programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
985 extern GLint (GLAPIENTRY *qglGetAttribLocation)(GLuint programObj, const GLchar *name);
986 extern void (GLAPIENTRY *qglGetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params);
987 extern void (GLAPIENTRY *qglGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params);
988 extern void (GLAPIENTRY *qglGetVertexAttribiv)(GLuint index, GLenum pname, GLint *params);
989 extern void (GLAPIENTRY *qglGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid **pointer);
990 #ifndef GL_VERTEX_SHADER
991 #define GL_VERTEX_SHADER                                                0x8B31
992 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS                0x8B4A
993 #define GL_MAX_VARYING_FLOATS                                   0x8B4B
994 #define GL_MAX_VERTEX_ATTRIBS                                   0x8869
995 #define GL_MAX_TEXTURE_IMAGE_UNITS                              0x8872
996 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS               0x8B4C
997 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS             0x8B4D
998 #define GL_MAX_TEXTURE_COORDS                                   0x8871
999 #define GL_VERTEX_PROGRAM_POINT_SIZE                    0x8642
1000 #define GL_VERTEX_PROGRAM_TWO_SIDE                              0x8643
1001 #define GL_ACTIVE_ATTRIBUTES                                    0x8B89
1002 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH                  0x8B8A
1003 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED                  0x8622
1004 #define GL_VERTEX_ATTRIB_ARRAY_SIZE                             0x8623
1005 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE                   0x8624
1006 #define GL_VERTEX_ATTRIB_ARRAY_TYPE                             0x8625
1007 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED               0x886A
1008 #define GL_CURRENT_VERTEX_ATTRIB                                0x8626
1009 #define GL_VERTEX_ATTRIB_ARRAY_POINTER                  0x8645
1010 #define GL_FLOAT                                                                0x1406
1011 #define GL_FLOAT_VEC2                                                   0x8B50
1012 #define GL_FLOAT_VEC3                                                   0x8B51
1013 #define GL_FLOAT_VEC4                                                   0x8B52
1014 #define GL_FLOAT_MAT2                                                   0x8B5A
1015 #define GL_FLOAT_MAT3                                                   0x8B5B
1016 #define GL_FLOAT_MAT4                                                   0x8B5C
1017 #endif
1018
1019 // GL 2.0 fragment shader
1020 #ifndef GL_FRAGMENT_SHADER
1021 #define GL_FRAGMENT_SHADER                                              0x8B30
1022 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS              0x8B49
1023 #define GL_MAX_TEXTURE_COORDS                                   0x8871
1024 #define GL_MAX_TEXTURE_IMAGE_UNITS                              0x8872
1025 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT              0x8B8B
1026 #endif
1027
1028 // GL 2.0 shading language 100
1029 #ifndef GL_SHADING_LANGUAGE_VERSION
1030 #define GL_SHADING_LANGUAGE_VERSION                             0x8B8C
1031 #endif
1032
1033 // GL_ARB_texture_compression
1034 extern void (GLAPIENTRY *qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
1035 extern void (GLAPIENTRY *qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,  GLsizei imageSize, const void *data);
1036 //extern void (GLAPIENTRY *qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
1037 extern void (GLAPIENTRY *qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
1038 extern void (GLAPIENTRY *qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
1039 //extern void (GLAPIENTRY *qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
1040 extern void (GLAPIENTRY *qglGetCompressedTexImageARB)(GLenum target, GLint lod, void *img);
1041 #ifndef GL_COMPRESSED_RGB_ARB
1042 #define GL_COMPRESSED_ALPHA_ARB                                         0x84E9
1043 #define GL_COMPRESSED_LUMINANCE_ARB                                     0x84EA
1044 #define GL_COMPRESSED_LUMINANCE_ALPHA_ARB                       0x84EB
1045 #define GL_COMPRESSED_INTENSITY_ARB                                     0x84EC
1046 #define GL_COMPRESSED_RGB_ARB                                           0x84ED
1047 #define GL_COMPRESSED_RGBA_ARB                                          0x84EE
1048 #define GL_TEXTURE_COMPRESSION_HINT_ARB                         0x84EF
1049 #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB            0x86A0
1050 #define GL_TEXTURE_COMPRESSED_ARB                                       0x86A1
1051 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB           0x86A2
1052 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB                       0x86A3
1053 #endif
1054
1055 // GL_EXT_texture_compression_s3tc
1056 #ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
1057 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                   0x83F0
1058 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                  0x83F1
1059 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT                  0x83F2
1060 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT                  0x83F3
1061 #endif
1062
1063 // GL_ARB_occlusion_query
1064 extern void (GLAPIENTRY *qglGenQueriesARB)(GLsizei n, GLuint *ids);
1065 extern void (GLAPIENTRY *qglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
1066 extern GLboolean (GLAPIENTRY *qglIsQueryARB)(GLuint qid);
1067 extern void (GLAPIENTRY *qglBeginQueryARB)(GLenum target, GLuint qid);
1068 extern void (GLAPIENTRY *qglEndQueryARB)(GLenum target);
1069 extern void (GLAPIENTRY *qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params);
1070 extern void (GLAPIENTRY *qglGetQueryObjectivARB)(GLuint qid, GLenum pname, GLint *params);
1071 extern void (GLAPIENTRY *qglGetQueryObjectuivARB)(GLuint qid, GLenum pname, GLuint *params);
1072 #ifndef GL_SAMPLES_PASSED_ARB
1073 #define GL_SAMPLES_PASSED_ARB                             0x8914
1074 #define GL_QUERY_COUNTER_BITS_ARB                         0x8864
1075 #define GL_CURRENT_QUERY_ARB                              0x8865
1076 #define GL_QUERY_RESULT_ARB                               0x8866
1077 #define GL_QUERY_RESULT_AVAILABLE_ARB                     0x8867
1078 #endif
1079
1080 // GL_ARB_query_buffer_object
1081 #ifndef GL_QUERY_BUFFER_ARB
1082 #define GL_QUERY_BUFFER_ARB                               0x9192
1083 #define GL_QUERY_BUFFER_BINDING_ARB                       0x9193
1084 #define GL_QUERY_RESULT_NO_WAIT_ARB                       0x9194
1085 #define GL_QUERY_BUFFER_BARRIER_BIT_ARB                   0x00008000
1086 #endif
1087
1088 // GL_EXT_bgr
1089 #define GL_BGR                                  0x80E0
1090
1091 // GL_EXT_bgra
1092 #define GL_BGRA                                 0x80E1
1093
1094 //GL_AMD_texture_texture4
1095
1096 //GL_ARB_texture_gather
1097
1098 //GL_ARB_multisample
1099 #define GL_MULTISAMPLE_ARB              0x809D
1100 #define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
1101 #define GL_SAMPLE_ALPHA_TO_ONE_ARB      0x809F
1102 #define GL_SAMPLE_COVERAGE_ARB          0x80A0
1103 #define GL_SAMPLE_BUFFERS_ARB           0x80A8
1104 #define GL_SAMPLES_ARB                  0x80A9
1105 #define GL_SAMPLE_COVERAGE_VALUE_ARB    0x80AA
1106 #define GL_SAMPLE_COVERAGE_INVERT_ARB   0x80AB
1107 #define GL_MULTISAMPLE_BIT_ARB          0x20000000
1108 extern void (GLAPIENTRY *qglSampleCoverageARB)(GLclampf value, GLboolean invert);
1109
1110 extern void (GLAPIENTRY *qglPointSize)(GLfloat size);
1111
1112 //GL_EXT_packed_depth_stencil
1113 #define GL_DEPTH_STENCIL_EXT            0x84F9
1114 #define GL_UNSIGNED_INT_24_8_EXT        0x84FA
1115 #define GL_DEPTH24_STENCIL8_EXT         0x88F0
1116
1117 //GL_EXT_blend_func_separate
1118 #ifndef GL_BLEND_DST_RGB
1119 #define GL_BLEND_DST_RGB                  0x80C8
1120 #define GL_BLEND_SRC_RGB                  0x80C9
1121 #define GL_BLEND_DST_ALPHA                0x80CA
1122 #define GL_BLEND_SRC_ALPHA                0x80CB
1123 #endif
1124 extern void (GLAPIENTRY *qglBlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
1125
1126 #endif
1127
1128 #define DEBUGGL
1129
1130 #ifdef DEBUGGL
1131 #ifdef USE_GLES2
1132 #define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);gl_errornumber = glGetError();if (gl_errornumber) GL_PrintError(gl_errornumber, __FILE__, __LINE__);}}
1133 #else
1134 #define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);gl_errornumber = qglGetError ? qglGetError() : 0;if (gl_errornumber) GL_PrintError(gl_errornumber, __FILE__, __LINE__);}}
1135 #endif
1136 extern int gl_errornumber;
1137 void GL_PrintError(int errornumber, const char *filename, int linenumber);
1138 #else
1139 #define CHECKGLERROR
1140 #endif
1141
1142 #ifdef USE_GLES2
1143 #define qglIsBufferARB glIsBuffer
1144 #define qglIsEnabled glIsEnabled
1145 #define qglIsFramebufferEXT glIsFramebuffer
1146 //#define qglIsQueryARB glIsQuery
1147 #define qglIsRenderbufferEXT glIsRenderbuffer
1148 //#define qglUnmapBufferARB glUnmapBuffer
1149 #define qglCheckFramebufferStatus glCheckFramebufferStatus
1150 #define qglGetError glGetError
1151 #define qglCreateProgram glCreateProgram
1152 #define qglCreateShader glCreateShader
1153 //#define qglGetHandleARB glGetHandle
1154 #define qglGetAttribLocation glGetAttribLocation
1155 #define qglGetUniformLocation glGetUniformLocation
1156 //#define qglMapBufferARB glMapBuffer
1157 #define qglGetString glGetString
1158 //#define qglActiveStencilFaceEXT glActiveStencilFace
1159 #define qglActiveTexture glActiveTexture
1160 #define qglAlphaFunc glAlphaFunc
1161 #define qglArrayElement glArrayElement
1162 #define qglAttachShader glAttachShader
1163 //#define qglBegin glBegin
1164 //#define qglBeginQueryARB glBeginQuery
1165 #define qglBindAttribLocation glBindAttribLocation
1166 //#define qglBindFragDataLocation glBindFragDataLocation
1167 #define qglBindBufferARB glBindBuffer
1168 #define qglBindFramebuffer glBindFramebuffer
1169 #define qglBindRenderbuffer glBindRenderbuffer
1170 #define qglBindTexture glBindTexture
1171 #define qglBlendEquationEXT glBlendEquation
1172 #define qglBlendFunc glBlendFunc
1173 #define qglBlendFuncSeparate glBlendFuncSeparate
1174 #define qglBufferDataARB glBufferData
1175 #define qglBufferSubDataARB glBufferSubData
1176 #define qglClear glClear
1177 #define qglClearColor glClearColor
1178 #define qglClearDepthf glClearDepthf
1179 #define qglClearStencil glClearStencil
1180 #define qglClientActiveTexture glClientActiveTexture
1181 #define qglColor4f glColor4f
1182 #define qglColor4ub glColor4ub
1183 #define qglColorMask glColorMask
1184 #define qglColorPointer glColorPointer
1185 #define qglCompileShader glCompileShader
1186 #define qglCompressedTexImage2DARB glCompressedTexImage2D
1187 #define qglCompressedTexImage3DARB glCompressedTexImage3D
1188 #define qglCompressedTexSubImage2DARB glCompressedTexSubImage2D
1189 #define qglCompressedTexSubImage3DARB glCompressedTexSubImage3D
1190 #define qglCopyTexImage2D glCopyTexImage2D
1191 #define qglCopyTexSubImage2D glCopyTexSubImage2D
1192 #define qglCopyTexSubImage3D glCopyTexSubImage3D
1193 #define qglCullFace glCullFace
1194 #define qglDeleteBuffersARB glDeleteBuffers
1195 #define qglDeleteFramebuffers glDeleteFramebuffers
1196 #define qglDeleteProgram glDeleteProgram
1197 #define qglDeleteShader glDeleteShader
1198 //#define qglDeleteQueriesARB glDeleteQueries
1199 #define qglDeleteRenderbuffers glDeleteRenderbuffers
1200 #define qglDeleteTextures glDeleteTextures
1201 #define qglDepthFunc glDepthFunc
1202 #define qglDepthMask glDepthMask
1203 #define qglDepthRangef glDepthRangef
1204 #define qglDetachShader glDetachShader
1205 #define qglDisable glDisable
1206 #define qglDisableClientState glDisableClientState
1207 #define qglDisableVertexAttribArray glDisableVertexAttribArray
1208 #define qglDrawArrays glDrawArrays
1209 //#define qglDrawBuffer glDrawBuffer
1210 //#define qglDrawBuffersARB glDrawBuffers
1211 #define qglDrawElements glDrawElements
1212 //#define qglDrawRangeElements glDrawRangeElements
1213 #define qglEnable glEnable
1214 #define qglEnableClientState glEnableClientState
1215 #define qglEnableVertexAttribArray glEnableVertexAttribArray
1216 //#define qglEnd glEnd
1217 //#define qglEndQueryARB glEndQuery
1218 #define qglFinish glFinish
1219 #define qglFlush glFlush
1220 #define qglFramebufferRenderbuffer glFramebufferRenderbuffer
1221 #define qglFramebufferTexture2D glFramebufferTexture2D
1222 #define qglFramebufferTexture3DEXT glFramebufferTexture3D
1223 #define qglGenBuffersARB glGenBuffers
1224 #define qglGenFramebuffers glGenFramebuffers
1225 //#define qglGenQueriesARB glGenQueries
1226 #define qglGenRenderbuffers glGenRenderbuffers
1227 #define qglGenTextures glGenTextures
1228 #define qglGenerateMipmapEXT glGenerateMipmap
1229 #define qglGetActiveAttrib glGetActiveAttrib
1230 #define qglGetActiveUniform glGetActiveUniform
1231 #define qglGetAttachedShaders glGetAttachedShaders
1232 #define qglGetBooleanv glGetBooleanv
1233 //#define qglGetCompressedTexImageARB glGetCompressedTexImage
1234 #define qglGetDoublev glGetDoublev
1235 #define qglGetFloatv glGetFloatv
1236 #define qglGetFramebufferAttachmentParameterivEXT glGetFramebufferAttachmentParameteriv
1237 #define qglGetProgramInfoLog glGetProgramInfoLog
1238 #define qglGetShaderInfoLog glGetShaderInfoLog
1239 #define qglGetIntegerv glGetIntegerv
1240 #define qglGetShaderiv glGetShaderiv
1241 #define qglGetProgramiv glGetProgramiv
1242 //#define qglGetQueryObjectivARB glGetQueryObjectiv
1243 //#define qglGetQueryObjectuivARB glGetQueryObjectuiv
1244 //#define qglGetQueryivARB glGetQueryiv
1245 #define qglGetRenderbufferParameterivEXT glGetRenderbufferParameteriv
1246 #define qglGetShaderSource glGetShaderSource
1247 #define qglGetTexImage glGetTexImage
1248 #define qglGetTexLevelParameterfv glGetTexLevelParameterfv
1249 #define qglGetTexLevelParameteriv glGetTexLevelParameteriv
1250 #define qglGetTexParameterfv glGetTexParameterfv
1251 #define qglGetTexParameteriv glGetTexParameteriv
1252 #define qglGetUniformfv glGetUniformfv
1253 #define qglGetUniformiv glGetUniformiv
1254 #define qglHint glHint
1255 #define qglLineWidth glLineWidth
1256 #define qglLinkProgram glLinkProgram
1257 #define qglLoadIdentity glLoadIdentity
1258 #define qglLoadMatrixf glLoadMatrixf
1259 #define qglMatrixMode glMatrixMode
1260 #define qglMultiTexCoord1f glMultiTexCoord1f
1261 #define qglMultiTexCoord2f glMultiTexCoord2f
1262 #define qglMultiTexCoord3f glMultiTexCoord3f
1263 #define qglMultiTexCoord4f glMultiTexCoord4f
1264 #define qglNormalPointer glNormalPointer
1265 #define qglPixelStorei glPixelStorei
1266 #define qglPointSize glPointSize
1267 //#define qglPolygonMode glPolygonMode
1268 #define qglPolygonOffset glPolygonOffset
1269 //#define qglPolygonStipple glPolygonStipple
1270 #define qglReadBuffer glReadBuffer
1271 #define qglReadPixels glReadPixels
1272 #define qglRenderbufferStorage glRenderbufferStorage
1273 #define qglScissor glScissor
1274 #define qglShaderSource glShaderSource
1275 #define qglStencilFunc glStencilFunc
1276 #define qglStencilFuncSeparate glStencilFuncSeparate
1277 #define qglStencilMask glStencilMask
1278 #define qglStencilOp glStencilOp
1279 #define qglStencilOpSeparate glStencilOpSeparate
1280 #define qglTexCoord1f glTexCoord1f
1281 #define qglTexCoord2f glTexCoord2f
1282 #define qglTexCoord3f glTexCoord3f
1283 #define qglTexCoord4f glTexCoord4f
1284 #define qglTexCoordPointer glTexCoordPointer
1285 #define qglTexEnvf glTexEnvf
1286 #define qglTexEnvfv glTexEnvfv
1287 #define qglTexEnvi glTexEnvi
1288 #define qglTexImage2D glTexImage2D
1289 #define qglTexImage3D glTexImage3D
1290 #define qglTexParameterf glTexParameterf
1291 #define qglTexParameterfv glTexParameterfv
1292 #define qglTexParameteri glTexParameteri
1293 #define qglTexSubImage2D glTexSubImage2D
1294 #define qglTexSubImage3D glTexSubImage3D
1295 #define qglUniform1f glUniform1f
1296 #define qglUniform1fv glUniform1fv
1297 #define qglUniform1i glUniform1i
1298 #define qglUniform1iv glUniform1iv
1299 #define qglUniform2f glUniform2f
1300 #define qglUniform2fv glUniform2fv
1301 #define qglUniform2i glUniform2i
1302 #define qglUniform2iv glUniform2iv
1303 #define qglUniform3f glUniform3f
1304 #define qglUniform3fv glUniform3fv
1305 #define qglUniform3i glUniform3i
1306 #define qglUniform3iv glUniform3iv
1307 #define qglUniform4f glUniform4f
1308 #define qglUniform4fv glUniform4fv
1309 #define qglUniform4i glUniform4i
1310 #define qglUniform4iv glUniform4iv
1311 #define qglUniformMatrix2fv glUniformMatrix2fv
1312 #define qglUniformMatrix3fv glUniformMatrix3fv
1313 #define qglUniformMatrix4fv glUniformMatrix4fv
1314 #define qglUseProgram glUseProgram
1315 #define qglValidateProgram glValidateProgram
1316 #define qglVertex2f glVertex2f
1317 #define qglVertex3f glVertex3f
1318 #define qglVertex4f glVertex4f
1319 #define qglVertexAttribPointer glVertexAttribPointer
1320 #define qglVertexPointer glVertexPointer
1321 #define qglViewport glViewport
1322 #define qglVertexAttrib1f glVertexAttrib1f
1323 //#define qglVertexAttrib1s glVertexAttrib1s
1324 //#define qglVertexAttrib1d glVertexAttrib1d
1325 #define qglVertexAttrib2f glVertexAttrib2f
1326 //#define qglVertexAttrib2s glVertexAttrib2s
1327 //#define qglVertexAttrib2d glVertexAttrib2d
1328 #define qglVertexAttrib3f glVertexAttrib3f
1329 //#define qglVertexAttrib3s glVertexAttrib3s
1330 //#define qglVertexAttrib3d glVertexAttrib3d
1331 #define qglVertexAttrib4f glVertexAttrib4f
1332 //#define qglVertexAttrib4s glVertexAttrib4s
1333 //#define qglVertexAttrib4d glVertexAttrib4d
1334 //#define qglVertexAttrib4Nub glVertexAttrib4Nub
1335 #define qglVertexAttrib1fv glVertexAttrib1fv
1336 //#define qglVertexAttrib1sv glVertexAttrib1sv
1337 //#define qglVertexAttrib1dv glVertexAttrib1dv
1338 #define qglVertexAttrib2fv glVertexAttrib2fv
1339 //#define qglVertexAttrib2sv glVertexAttrib2sv
1340 //#define qglVertexAttrib2dv glVertexAttrib2dv
1341 #define qglVertexAttrib3fv glVertexAttrib3fv
1342 //#define qglVertexAttrib3sv glVertexAttrib3sv
1343 //#define qglVertexAttrib3dv glVertexAttrib3dv
1344 #define qglVertexAttrib4fv glVertexAttrib4fv
1345 //#define qglVertexAttrib4sv glVertexAttrib4sv
1346 //#define qglVertexAttrib4dv glVertexAttrib4dv
1347 //#define qglVertexAttrib4iv glVertexAttrib4iv
1348 //#define qglVertexAttrib4bv glVertexAttrib4bv
1349 //#define qglVertexAttrib4ubv glVertexAttrib4ubv
1350 //#define qglVertexAttrib4usv glVertexAttrib4usv
1351 //#define qglVertexAttrib4uiv glVertexAttrib4uiv
1352 //#define qglVertexAttrib4Nbv glVertexAttrib4Nbv
1353 //#define qglVertexAttrib4Nsv glVertexAttrib4Nsv
1354 //#define qglVertexAttrib4Niv glVertexAttrib4Niv
1355 //#define qglVertexAttrib4Nubv glVertexAttrib4Nubv
1356 //#define qglVertexAttrib4Nusv glVertexAttrib4Nusv
1357 //#define qglVertexAttrib4Nuiv glVertexAttrib4Nuiv
1358 //#define qglGetVertexAttribdv glGetVertexAttribdv
1359 #define qglGetVertexAttribfv glGetVertexAttribfv
1360 #define qglGetVertexAttribiv glGetVertexAttribiv
1361 #define qglGetVertexAttribPointerv glGetVertexAttribPointerv
1362 #endif
1363
1364 #endif