automagically select best shadowmapping filter mode depending on hardware
[divverent/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 // disable data conversion warnings
25
26 #ifdef _MSC_VER
27 #pragma warning(disable : 4244)     // LordHavoc: MSVC++ 4 x86, double/float
28 #pragma warning(disable : 4305)         // LordHavoc: MSVC++ 6 x86, double/float
29 #endif
30
31
32 //====================================================
33
34 // wgl uses APIENTRY
35 #ifndef APIENTRY
36 #define APIENTRY
37 #endif
38
39 // for platforms (wgl) that do not use GLAPIENTRY
40 #ifndef GLAPIENTRY
41 #define GLAPIENTRY APIENTRY
42 #endif
43
44 #ifndef GL_PROJECTION
45 #include <stddef.h>
46
47 typedef unsigned int GLenum;
48 typedef unsigned char GLboolean;
49 typedef unsigned int GLbitfield;
50 typedef void GLvoid;
51 // 1-byte signed
52 typedef signed char GLbyte;
53 // 2-byte signed
54 typedef short GLshort;
55 // 4-byte signed
56 typedef int GLint;
57 // 1-byte unsigned
58 typedef unsigned char GLubyte;
59 // 2-byte unsigned
60 typedef unsigned short GLushort;
61 // 4-byte unsigned
62 typedef unsigned int GLuint;
63 // 4-byte signed
64 typedef int GLsizei;
65 // single precision float
66 typedef float GLfloat;
67 // single precision float in [0,1]
68 typedef float GLclampf;
69 // double precision float
70 typedef double GLdouble;
71 // double precision float in [0,1]
72 typedef double GLclampd;
73 // int whose size is the same as a pointer (?)
74 typedef ptrdiff_t GLintptrARB;
75 // int whose size is the same as a pointer (?)
76 typedef ptrdiff_t GLsizeiptrARB;
77
78 #define GL_MODELVIEW                            0x1700
79 #define GL_PROJECTION                           0x1701
80 #define GL_TEXTURE                              0x1702
81 #define GL_MATRIX_MODE                          0x0BA0
82 #define GL_MODELVIEW_MATRIX                     0x0BA6
83 #define GL_PROJECTION_MATRIX                    0x0BA7
84 #define GL_TEXTURE_MATRIX                       0x0BA8
85
86 #define GL_DONT_CARE                            0x1100
87 #define GL_FASTEST                                      0x1101
88 #define GL_NICEST                                       0x1102
89
90 #define GL_DEPTH_TEST                           0x0B71
91
92 #define GL_CULL_FACE                            0x0B44
93
94 #define GL_BLEND                                0x0BE2
95 #define GL_ALPHA_TEST                   0x0BC0
96
97 #define GL_ZERO                                 0x0
98 #define GL_ONE                                  0x1
99 #define GL_SRC_COLOR                            0x0300
100 #define GL_ONE_MINUS_SRC_COLOR                  0x0301
101 #define GL_DST_COLOR                            0x0306
102 #define GL_ONE_MINUS_DST_COLOR                  0x0307
103 #define GL_SRC_ALPHA                            0x0302
104 #define GL_ONE_MINUS_SRC_ALPHA                  0x0303
105 #define GL_DST_ALPHA                            0x0304
106 #define GL_ONE_MINUS_DST_ALPHA                  0x0305
107 #define GL_SRC_ALPHA_SATURATE                   0x0308
108 #define GL_CONSTANT_COLOR                       0x8001
109 #define GL_ONE_MINUS_CONSTANT_COLOR             0x8002
110 #define GL_CONSTANT_ALPHA                       0x8003
111 #define GL_ONE_MINUS_CONSTANT_ALPHA             0x8004
112
113 #define GL_TEXTURE_ENV                          0x2300
114 #define GL_TEXTURE_ENV_MODE                     0x2200
115 #define GL_TEXTURE_1D                           0x0DE0
116 #define GL_TEXTURE_2D                           0x0DE1
117 #define GL_TEXTURE_WRAP_S                       0x2802
118 #define GL_TEXTURE_WRAP_T                       0x2803
119 #define GL_TEXTURE_WRAP_R                       0x8072
120 #define GL_TEXTURE_BORDER_COLOR                 0x1004
121 #define GL_TEXTURE_MAG_FILTER                   0x2800
122 #define GL_TEXTURE_MIN_FILTER                   0x2801
123 #define GL_PACK_ALIGNMENT                       0x0D05
124 #define GL_UNPACK_ALIGNMENT                     0x0CF5
125 #define GL_TEXTURE_BINDING_1D                   0x8068
126 #define GL_TEXTURE_BINDING_2D                   0x8069
127
128 #define GL_NEAREST                              0x2600
129 #define GL_LINEAR                               0x2601
130 #define GL_NEAREST_MIPMAP_NEAREST               0x2700
131 #define GL_NEAREST_MIPMAP_LINEAR                0x2702
132 #define GL_LINEAR_MIPMAP_NEAREST                0x2701
133 #define GL_LINEAR_MIPMAP_LINEAR                 0x2703
134
135 #define GL_LINE                                 0x1B01
136 #define GL_FILL                                 0x1B02
137
138 #define GL_ADD                                  0x0104
139 #define GL_DECAL                                0x2101
140 #define GL_MODULATE                             0x2100
141
142 #define GL_REPEAT                               0x2901
143 #define GL_CLAMP                                0x2900
144
145 #define GL_POINTS                               0x0000
146 #define GL_LINES                                0x0001
147 #define GL_LINE_LOOP                    0x0002
148 #define GL_LINE_STRIP                   0x0003
149 #define GL_TRIANGLES                    0x0004
150 #define GL_TRIANGLE_STRIP               0x0005
151 #define GL_TRIANGLE_FAN                 0x0006
152 #define GL_QUADS                                0x0007
153 #define GL_QUAD_STRIP                   0x0008
154 #define GL_POLYGON                              0x0009
155
156 #define GL_FALSE                                0x0
157 #define GL_TRUE                                 0x1
158
159 #define GL_BYTE                                 0x1400
160 #define GL_UNSIGNED_BYTE                        0x1401
161 #define GL_SHORT                                0x1402
162 #define GL_UNSIGNED_SHORT                       0x1403
163 #define GL_INT                                  0x1404
164 #define GL_UNSIGNED_INT                         0x1405
165 #define GL_FLOAT                                0x1406
166 #define GL_DOUBLE                               0x140A
167 #define GL_2_BYTES                              0x1407
168 #define GL_3_BYTES                              0x1408
169 #define GL_4_BYTES                              0x1409
170
171 #define GL_VERTEX_ARRAY                         0x8074
172 #define GL_NORMAL_ARRAY                         0x8075
173 #define GL_COLOR_ARRAY                          0x8076
174 //#define GL_INDEX_ARRAY                                0x8077
175 #define GL_TEXTURE_COORD_ARRAY                  0x8078
176 //#define GL_EDGE_FLAG_ARRAY                    0x8079
177
178 #define GL_NONE                                 0
179 #define GL_FRONT_LEFT                   0x0400
180 #define GL_FRONT_RIGHT                  0x0401
181 #define GL_BACK_LEFT                    0x0402
182 #define GL_BACK_RIGHT                   0x0403
183 #define GL_FRONT                                0x0404
184 #define GL_BACK                                 0x0405
185 #define GL_LEFT                                 0x0406
186 #define GL_RIGHT                                0x0407
187 #define GL_FRONT_AND_BACK               0x0408
188 #define GL_AUX0                                 0x0409
189 #define GL_AUX1                                 0x040A
190 #define GL_AUX2                                 0x040B
191 #define GL_AUX3                                 0x040C
192
193 #define GL_VENDOR                               0x1F00
194 #define GL_RENDERER                             0x1F01
195 #define GL_VERSION                              0x1F02
196 #define GL_EXTENSIONS                           0x1F03
197
198 #define GL_NO_ERROR                             0x0
199 #define GL_INVALID_VALUE                        0x0501
200 #define GL_INVALID_ENUM                         0x0500
201 #define GL_INVALID_OPERATION                    0x0502
202 #define GL_STACK_OVERFLOW                       0x0503
203 #define GL_STACK_UNDERFLOW                      0x0504
204 #define GL_OUT_OF_MEMORY                        0x0505
205
206 #define GL_DITHER                               0x0BD0
207 #define GL_RGB                                  0x1907
208 #define GL_RGBA                                 0x1908
209
210 #define GL_MAX_TEXTURE_SIZE                     0x0D33
211
212 #define GL_NEVER                                0x0200
213 #define GL_LESS                                 0x0201
214 #define GL_EQUAL                                0x0202
215 #define GL_LEQUAL                               0x0203
216 #define GL_GREATER                              0x0204
217 #define GL_NOTEQUAL                             0x0205
218 #define GL_GEQUAL                               0x0206
219 #define GL_ALWAYS                               0x0207
220 #define GL_DEPTH_TEST                           0x0B71
221
222 #define GL_RED_SCALE                            0x0D14
223 #define GL_GREEN_SCALE                          0x0D18
224 #define GL_BLUE_SCALE                           0x0D1A
225 #define GL_ALPHA_SCALE                          0x0D1C
226
227 #define GL_DEPTH_BUFFER_BIT                     0x00000100
228 #define GL_ACCUM_BUFFER_BIT                     0x00000200
229 #define GL_STENCIL_BUFFER_BIT                   0x00000400
230 #define GL_COLOR_BUFFER_BIT                     0x00004000
231
232 #define GL_STENCIL_TEST                         0x0B90
233 #define GL_KEEP                                 0x1E00
234 #define GL_REPLACE                              0x1E01
235 #define GL_INCR                                 0x1E02
236 #define GL_DECR                                 0x1E03
237
238 #define GL_POLYGON_OFFSET_FACTOR          0x8038
239 #define GL_POLYGON_OFFSET_UNITS           0x2A00
240 #define GL_POLYGON_OFFSET_POINT           0x2A01
241 #define GL_POLYGON_OFFSET_LINE            0x2A02
242 #define GL_POLYGON_OFFSET_FILL            0x8037
243
244 #define GL_POINT_SMOOTH                         0x0B10
245 #define GL_LINE_SMOOTH                          0x0B20
246 #define GL_POLYGON_SMOOTH                       0x0B41
247
248 #define GL_POLYGON_STIPPLE                0x0B42
249
250 #define GL_CLIP_PLANE0                    0x3000
251 #define GL_CLIP_PLANE1                    0x3001
252 #define GL_CLIP_PLANE2                    0x3002
253 #define GL_CLIP_PLANE3                    0x3003
254 #define GL_CLIP_PLANE4                    0x3004
255 #define GL_CLIP_PLANE5                    0x3005
256
257 #define GL_DEPTH_COMPONENT                0x1902
258 #define GL_VIEWPORT                       0x0BA2
259 #define GL_DRAW_BUFFER                    0x0C01
260 #define GL_READ_BUFFER                    0x0C02
261 #define GL_LUMINANCE                      0x1909
262 #define GL_INTENSITY                      0x8049
263
264 #endif
265
266 //GL_EXT_texture_filter_anisotropic
267 extern int gl_support_anisotropy;
268 extern int gl_max_anisotropy;
269 #ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
270 #define GL_TEXTURE_MAX_ANISOTROPY_EXT       0x84FE
271 #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT   0x84FF
272 #endif
273
274 // GL_ARB_depth_texture
275 #ifndef GL_DEPTH_COMPONENT32_ARB
276 #define GL_DEPTH_COMPONENT16_ARB          0x81A5
277 #define GL_DEPTH_COMPONENT24_ARB          0x81A6
278 #define GL_DEPTH_COMPONENT32_ARB          0x81A7
279 #define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A
280 #define GL_DEPTH_TEXTURE_MODE_ARB         0x884B
281 #endif
282
283 // GL_ARB_shadow
284 extern int gl_support_arb_shadow;
285 #ifndef GL_TEXTURE_COMPARE_MODE_ARB
286 #define GL_TEXTURE_COMPARE_MODE_ARB       0x884C
287 #define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D
288 #define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E
289 #endif
290
291 extern int gl_max_texture_size;
292
293 // GL_ARB_multitexture
294 extern int gl_textureunits;
295 extern void (GLAPIENTRY *qglMultiTexCoord1f) (GLenum, GLfloat);
296 extern void (GLAPIENTRY *qglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
297 extern void (GLAPIENTRY *qglMultiTexCoord3f) (GLenum, GLfloat, GLfloat, GLfloat);
298 extern void (GLAPIENTRY *qglMultiTexCoord4f) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
299 extern void (GLAPIENTRY *qglActiveTexture) (GLenum);
300 extern void (GLAPIENTRY *qglClientActiveTexture) (GLenum);
301 #ifndef GL_ACTIVE_TEXTURE_ARB
302 #define GL_ACTIVE_TEXTURE_ARB                   0x84E0
303 #define GL_CLIENT_ACTIVE_TEXTURE_ARB    0x84E1
304 #define GL_MAX_TEXTURE_UNITS_ARB                0x84E2
305 #define GL_TEXTURE0_ARB                                 0x84C0
306 #define GL_TEXTURE1_ARB                                 0x84C1
307 #define GL_TEXTURE2_ARB                                 0x84C2
308 #define GL_TEXTURE3_ARB                                 0x84C3
309 #define GL_TEXTURE4_ARB                                 0x84C4
310 #define GL_TEXTURE5_ARB                                 0x84C5
311 #define GL_TEXTURE6_ARB                                 0x84C6
312 #define GL_TEXTURE7_ARB                                 0x84C7
313 #define GL_TEXTURE8_ARB                                 0x84C8
314 #define GL_TEXTURE9_ARB                                 0x84C9
315 #define GL_TEXTURE10_ARB                                0x84CA
316 #define GL_TEXTURE11_ARB                                0x84CB
317 #define GL_TEXTURE12_ARB                                0x84CC
318 #define GL_TEXTURE13_ARB                                0x84CD
319 #define GL_TEXTURE14_ARB                                0x84CE
320 #define GL_TEXTURE15_ARB                                0x84CF
321 #define GL_TEXTURE16_ARB                                0x84D0
322 #define GL_TEXTURE17_ARB                                0x84D1
323 #define GL_TEXTURE18_ARB                                0x84D2
324 #define GL_TEXTURE19_ARB                                0x84D3
325 #define GL_TEXTURE20_ARB                                0x84D4
326 #define GL_TEXTURE21_ARB                                0x84D5
327 #define GL_TEXTURE22_ARB                                0x84D6
328 #define GL_TEXTURE23_ARB                                0x84D7
329 #define GL_TEXTURE24_ARB                                0x84D8
330 #define GL_TEXTURE25_ARB                                0x84D9
331 #define GL_TEXTURE26_ARB                                0x84DA
332 #define GL_TEXTURE27_ARB                                0x84DB
333 #define GL_TEXTURE28_ARB                                0x84DC
334 #define GL_TEXTURE29_ARB                                0x84DD
335 #define GL_TEXTURE30_ARB                                0x84DE
336 #define GL_TEXTURE31_ARB                                0x84DF
337 #endif
338
339 // GL_EXT_compiled_vertex_array
340 extern int gl_supportslockarrays;
341 extern void (GLAPIENTRY *qglLockArraysEXT) (GLint first, GLint count);
342 extern void (GLAPIENTRY *qglUnlockArraysEXT) (void);
343
344 // GL_ARB_texture_env_combine
345 extern int gl_combine_extension;
346 #ifndef GL_COMBINE_ARB
347 #define GL_COMBINE_ARB                                  0x8570
348 #define GL_COMBINE_RGB_ARB                              0x8571
349 #define GL_COMBINE_ALPHA_ARB                    0x8572
350 #define GL_SOURCE0_RGB_ARB                              0x8580
351 #define GL_SOURCE1_RGB_ARB                              0x8581
352 #define GL_SOURCE2_RGB_ARB                              0x8582
353 #define GL_SOURCE0_ALPHA_ARB                    0x8588
354 #define GL_SOURCE1_ALPHA_ARB                    0x8589
355 #define GL_SOURCE2_ALPHA_ARB                    0x858A
356 #define GL_OPERAND0_RGB_ARB                             0x8590
357 #define GL_OPERAND1_RGB_ARB                             0x8591
358 #define GL_OPERAND2_RGB_ARB                             0x8592
359 #define GL_OPERAND0_ALPHA_ARB                   0x8598
360 #define GL_OPERAND1_ALPHA_ARB                   0x8599
361 #define GL_OPERAND2_ALPHA_ARB                   0x859A
362 #define GL_RGB_SCALE_ARB                                0x8573
363 #define GL_ADD_SIGNED_ARB                               0x8574
364 #define GL_INTERPOLATE_ARB                              0x8575
365 #define GL_SUBTRACT_ARB                                 0x84E7
366 #define GL_CONSTANT_ARB                                 0x8576
367 #define GL_PRIMARY_COLOR_ARB                    0x8577
368 #define GL_PREVIOUS_ARB                                 0x8578
369 #endif
370
371 #ifndef GL_MAX_ELEMENTS_VERTICES
372 #define GL_MAX_ELEMENTS_VERTICES                0x80E8
373 #endif
374 #ifndef GL_MAX_ELEMENTS_INDICES
375 #define GL_MAX_ELEMENTS_INDICES                 0x80E9
376 #endif
377
378
379 extern int gl_texture3d;
380 extern int gl_max_3d_texture_size;
381 #ifndef GL_TEXTURE_3D
382 #define GL_PACK_SKIP_IMAGES                     0x806B
383 #define GL_PACK_IMAGE_HEIGHT                    0x806C
384 #define GL_UNPACK_SKIP_IMAGES                   0x806D
385 #define GL_UNPACK_IMAGE_HEIGHT                  0x806E
386 #define GL_TEXTURE_3D                           0x806F
387 #define GL_PROXY_TEXTURE_3D                     0x8070
388 #define GL_TEXTURE_DEPTH                        0x8071
389 #define GL_TEXTURE_WRAP_R                       0x8072
390 #define GL_MAX_3D_TEXTURE_SIZE                  0x8073
391 #define GL_TEXTURE_BINDING_3D                   0x806A
392 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);
393 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);
394 extern void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
395 #endif
396
397 extern int gl_texturecubemap;
398 extern int gl_max_cube_map_texture_size;
399 #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
400 #define GL_NORMAL_MAP_ARB                           0x8511
401 #define GL_REFLECTION_MAP_ARB               0x8512
402 #define GL_TEXTURE_CUBE_MAP_ARB             0x8513
403 #define GL_TEXTURE_BINDING_CUBE_MAP_ARB     0x8514
404 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB     0x8515
405 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB     0x8516
406 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB     0x8517
407 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB     0x8518
408 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB     0x8519
409 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB     0x851A
410 #define GL_PROXY_TEXTURE_CUBE_MAP_ARB       0x851B
411 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB                0x851C
412 #endif
413
414 extern int gl_texturerectangle;
415 extern int gl_max_rectangle_texture_size;
416 #ifndef GL_TEXTURE_RECTANGLE_ARB
417 #define GL_TEXTURE_RECTANGLE_ARB            0x84F5
418 #define GL_TEXTURE_BINDING_RECTANGLE_ARB    0x84F6
419 #define GL_PROXY_TEXTURE_RECTANGLE_ARB      0x84F7
420 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB   0x84F8
421 #define GL_SAMPLER_2D_RECT_ARB              0x8B63
422 #define GL_SAMPLER_2D_RECT_SHADOW_ARB       0x8B64
423 #endif
424
425 extern int gl_depthtexture;
426 #ifndef GL_DEPTH_COMPONENT16_ARB
427 #define GL_DEPTH_COMPONENT16_ARB       0x81A5
428 #define GL_DEPTH_COMPONENT24_ARB       0x81A6
429 #define GL_DEPTH_COMPONENT32_ARB       0x81A7
430 #define GL_TEXTURE_DEPTH_SIZE_ARB      0x884A
431 #define GL_DEPTH_TEXTURE_MODE_ARB      0x884B
432 #endif
433
434
435 extern int gl_dot3arb;
436 #ifndef GL_DOT3_RGB_ARB
437 #define GL_DOT3_RGB_ARB                         0x86AE
438 #define GL_DOT3_RGBA_ARB                                0x86AF
439 #endif
440
441 /*
442 // uncomment if this is actually needed by anyone
443 extern int gl_dot3ext;
444 #ifndef GL_DOT3_RGB_EXT
445 #define GL_DOT3_RGB_EXT                         0x8740
446 #define GL_DOT3_RGBA_EXT                        0x8741
447 #endif
448 */
449
450 #ifndef GL_SCISSOR_TEST
451 #define GL_SCISSOR_TEST                         0x0C11
452 #define GL_SCISSOR_BOX                          0x0C10
453 #endif
454
455 // GL_SGIS_texture_edge_clamp or GL_EXT_texture_edge_clamp
456 extern int gl_support_clamptoedge;
457 #ifndef GL_CLAMP_TO_EDGE
458 #define GL_CLAMP_TO_EDGE 0x812F
459 #endif
460
461 //GL_ATI_separate_stencil
462 extern int gl_support_separatestencil;
463 #ifndef GL_STENCIL_BACK_FUNC
464 #define GL_STENCIL_BACK_FUNC              0x8800
465 #define GL_STENCIL_BACK_FAIL              0x8801
466 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
467 #define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
468 #endif
469 extern void (GLAPIENTRY *qglStencilOpSeparate)(GLenum, GLenum, GLenum, GLenum);
470 extern void (GLAPIENTRY *qglStencilFuncSeparate)(GLenum, GLenum, GLint, GLuint);
471
472 //GL_EXT_stencil_two_side
473 #define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910
474 #define GL_ACTIVE_STENCIL_FACE_EXT        0x8911
475 extern void (GLAPIENTRY *qglActiveStencilFaceEXT)(GLenum);
476 extern int gl_support_stenciltwoside;
477
478 //GL_EXT_blend_minmax
479 extern int gl_support_ext_blend_minmax;
480 #ifndef GL_FUNC_ADD_EXT
481 #define GL_FUNC_ADD_EXT                   0x8006 // also supplied by GL_EXT_blend_subtract
482 #define GL_MIN_EXT                        0x8007
483 #define GL_MAX_EXT                        0x8008
484 #define GL_BLEND_EQUATION_EXT             0x8009 // also supplied by GL_EXT_blend_subtract
485 extern void (GLAPIENTRY *qglBlendEquationEXT)(GLenum); // also supplied by GL_EXT_blend_subtract
486 #endif
487
488 //GL_EXT_blend_subtract
489 extern int gl_support_ext_blend_subtract;
490 #ifndef GL_FUNC_SUBTRACT_EXT
491 #define GL_FUNC_SUBTRACT_EXT              0x800A
492 #define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
493 #endif
494
495 //GL_ARB_texture_non_power_of_two
496 extern int gl_support_arb_texture_non_power_of_two;
497
498 //GL_ARB_vertex_buffer_object
499 extern int gl_support_arb_vertex_buffer_object;
500 #ifndef GL_ARRAY_BUFFER_ARB
501 #define GL_ARRAY_BUFFER_ARB               0x8892
502 #define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893
503 #define GL_ARRAY_BUFFER_BINDING_ARB       0x8894
504 #define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
505 #define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
506 #define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
507 #define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
508 #define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
509 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
510 #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
511 #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
512 #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
513 #define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
514 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
515 #define GL_STREAM_DRAW_ARB                0x88E0
516 #define GL_STREAM_READ_ARB                0x88E1
517 #define GL_STREAM_COPY_ARB                0x88E2
518 #define GL_STATIC_DRAW_ARB                0x88E4
519 #define GL_STATIC_READ_ARB                0x88E5
520 #define GL_STATIC_COPY_ARB                0x88E6
521 #define GL_DYNAMIC_DRAW_ARB               0x88E8
522 #define GL_DYNAMIC_READ_ARB               0x88E9
523 #define GL_DYNAMIC_COPY_ARB               0x88EA
524 #define GL_READ_ONLY_ARB                  0x88B8
525 #define GL_WRITE_ONLY_ARB                 0x88B9
526 #define GL_READ_WRITE_ARB                 0x88BA
527 #define GL_BUFFER_SIZE_ARB                0x8764
528 #define GL_BUFFER_USAGE_ARB               0x8765
529 #define GL_BUFFER_ACCESS_ARB              0x88BB
530 #define GL_BUFFER_MAPPED_ARB              0x88BC
531 #define GL_BUFFER_MAP_POINTER_ARB         0x88BD
532 #endif
533 extern void (GLAPIENTRY *qglBindBufferARB) (GLenum target, GLuint buffer);
534 extern void (GLAPIENTRY *qglDeleteBuffersARB) (GLsizei n, const GLuint *buffers);
535 extern void (GLAPIENTRY *qglGenBuffersARB) (GLsizei n, GLuint *buffers);
536 extern GLboolean (GLAPIENTRY *qglIsBufferARB) (GLuint buffer);
537 extern GLvoid* (GLAPIENTRY *qglMapBufferARB) (GLenum target, GLenum access);
538 extern GLboolean (GLAPIENTRY *qglUnmapBufferARB) (GLenum target);
539 extern void (GLAPIENTRY *qglBufferDataARB) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
540 extern void (GLAPIENTRY *qglBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
541
542 //GL_EXT_framebuffer_object
543 extern int gl_support_ext_framebuffer_object;
544 #ifndef GL_FRAMEBUFFER_EXT
545 #define GL_FRAMEBUFFER_EXT                                   0x8D40
546 #define GL_RENDERBUFFER_EXT                                  0x8D41
547 #define GL_STENCIL_INDEX1_EXT                                0x8D46
548 #define GL_STENCIL_INDEX4_EXT                                0x8D47
549 #define GL_STENCIL_INDEX8_EXT                                0x8D48
550 #define GL_STENCIL_INDEX16_EXT                               0x8D49
551 #define GL_RENDERBUFFER_WIDTH_EXT                            0x8D42
552 #define GL_RENDERBUFFER_HEIGHT_EXT                           0x8D43
553 #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT                  0x8D44
554 #define GL_RENDERBUFFER_RED_SIZE_EXT                         0x8D50
555 #define GL_RENDERBUFFER_GREEN_SIZE_EXT                       0x8D51
556 #define GL_RENDERBUFFER_BLUE_SIZE_EXT                        0x8D52
557 #define GL_RENDERBUFFER_ALPHA_SIZE_EXT                       0x8D53
558 #define GL_RENDERBUFFER_DEPTH_SIZE_EXT                       0x8D54
559 #define GL_RENDERBUFFER_STENCIL_SIZE_EXT                     0x8D55
560 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT            0x8CD0
561 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT            0x8CD1
562 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT          0x8CD2
563 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT  0x8CD3
564 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT     0x8CD4
565 #define GL_COLOR_ATTACHMENT0_EXT                             0x8CE0
566 #define GL_COLOR_ATTACHMENT1_EXT                             0x8CE1
567 #define GL_COLOR_ATTACHMENT2_EXT                             0x8CE2
568 #define GL_COLOR_ATTACHMENT3_EXT                             0x8CE3
569 #define GL_COLOR_ATTACHMENT4_EXT                             0x8CE4
570 #define GL_COLOR_ATTACHMENT5_EXT                             0x8CE5
571 #define GL_COLOR_ATTACHMENT6_EXT                             0x8CE6
572 #define GL_COLOR_ATTACHMENT7_EXT                             0x8CE7
573 #define GL_COLOR_ATTACHMENT8_EXT                             0x8CE8
574 #define GL_COLOR_ATTACHMENT9_EXT                             0x8CE9
575 #define GL_COLOR_ATTACHMENT10_EXT                            0x8CEA
576 #define GL_COLOR_ATTACHMENT11_EXT                            0x8CEB
577 #define GL_COLOR_ATTACHMENT12_EXT                            0x8CEC
578 #define GL_COLOR_ATTACHMENT13_EXT                            0x8CED
579 #define GL_COLOR_ATTACHMENT14_EXT                            0x8CEE
580 #define GL_COLOR_ATTACHMENT15_EXT                            0x8CEF
581 #define GL_DEPTH_ATTACHMENT_EXT                              0x8D00
582 #define GL_STENCIL_ATTACHMENT_EXT                            0x8D20
583 #define GL_FRAMEBUFFER_COMPLETE_EXT                          0x8CD5
584 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT             0x8CD6
585 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT     0x8CD7
586 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT             0x8CD9
587 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT                0x8CDA
588 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT            0x8CDB
589 #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT            0x8CDC
590 #define GL_FRAMEBUFFER_UNSUPPORTED_EXT                       0x8CDD
591 #define GL_FRAMEBUFFER_BINDING_EXT                           0x8CA6
592 #define GL_RENDERBUFFER_BINDING_EXT                          0x8CA7
593 #define GL_MAX_COLOR_ATTACHMENTS_EXT                         0x8CDF
594 #define GL_MAX_RENDERBUFFER_SIZE_EXT                         0x84E8
595 #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT                 0x0506
596 #endif
597 extern GLboolean (GLAPIENTRY *qglIsRenderbufferEXT)(GLuint renderbuffer);
598 extern void (GLAPIENTRY *qglBindRenderbufferEXT)(GLenum target, GLuint renderbuffer);
599 extern void (GLAPIENTRY *qglDeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers);
600 extern void (GLAPIENTRY *qglGenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers);
601 extern void (GLAPIENTRY *qglRenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
602 extern void (GLAPIENTRY *qglGetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params);
603 extern GLboolean (GLAPIENTRY *qglIsFramebufferEXT)(GLuint framebuffer);
604 extern void (GLAPIENTRY *qglBindFramebufferEXT)(GLenum target, GLuint framebuffer);
605 extern void (GLAPIENTRY *qglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
606 extern void (GLAPIENTRY *qglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
607 extern GLenum (GLAPIENTRY *qglCheckFramebufferStatusEXT)(GLenum target);
608 extern void (GLAPIENTRY *qglFramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
609 extern void (GLAPIENTRY *qglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
610 extern void (GLAPIENTRY *qglFramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
611 extern void (GLAPIENTRY *qglFramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
612 extern void (GLAPIENTRY *qglGetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
613 extern void (GLAPIENTRY *qglGenerateMipmapEXT)(GLenum target);
614
615 extern void (GLAPIENTRY *qglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
616
617 extern void (GLAPIENTRY *qglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
618
619 extern void (GLAPIENTRY *qglClear)(GLbitfield mask);
620
621 extern void (GLAPIENTRY *qglAlphaFunc)(GLenum func, GLclampf ref);
622 extern void (GLAPIENTRY *qglBlendFunc)(GLenum sfactor, GLenum dfactor);
623 extern void (GLAPIENTRY *qglCullFace)(GLenum mode);
624
625 extern void (GLAPIENTRY *qglDrawBuffer)(GLenum mode);
626 extern void (GLAPIENTRY *qglReadBuffer)(GLenum mode);
627 extern void (GLAPIENTRY *qglEnable)(GLenum cap);
628 extern void (GLAPIENTRY *qglDisable)(GLenum cap);
629 extern GLboolean (GLAPIENTRY *qglIsEnabled)(GLenum cap);
630
631 extern void (GLAPIENTRY *qglEnableClientState)(GLenum cap);
632 extern void (GLAPIENTRY *qglDisableClientState)(GLenum cap);
633
634 extern void (GLAPIENTRY *qglGetBooleanv)(GLenum pname, GLboolean *params);
635 extern void (GLAPIENTRY *qglGetDoublev)(GLenum pname, GLdouble *params);
636 extern void (GLAPIENTRY *qglGetFloatv)(GLenum pname, GLfloat *params);
637 extern void (GLAPIENTRY *qglGetIntegerv)(GLenum pname, GLint *params);
638
639 extern GLenum (GLAPIENTRY *qglGetError)(void);
640 extern const GLubyte* (GLAPIENTRY *qglGetString)(GLenum name);
641 extern void (GLAPIENTRY *qglFinish)(void);
642 extern void (GLAPIENTRY *qglFlush)(void);
643
644 extern void (GLAPIENTRY *qglClearDepth)(GLclampd depth);
645 extern void (GLAPIENTRY *qglDepthFunc)(GLenum func);
646 extern void (GLAPIENTRY *qglDepthMask)(GLboolean flag);
647 extern void (GLAPIENTRY *qglDepthRange)(GLclampd near_val, GLclampd far_val);
648 extern void (GLAPIENTRY *qglColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
649
650 extern void (GLAPIENTRY *qglDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
651 extern void (GLAPIENTRY *qglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
652 extern void (GLAPIENTRY *qglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
653 extern void (GLAPIENTRY *qglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr);
654 extern void (GLAPIENTRY *qglColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
655 extern void (GLAPIENTRY *qglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
656 extern void (GLAPIENTRY *qglArrayElement)(GLint i);
657
658 extern void (GLAPIENTRY *qglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
659 extern void (GLAPIENTRY *qglTexCoord1f)(GLfloat s);
660 extern void (GLAPIENTRY *qglTexCoord2f)(GLfloat s, GLfloat t);
661 extern void (GLAPIENTRY *qglTexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
662 extern void (GLAPIENTRY *qglTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
663 extern void (GLAPIENTRY *qglVertex2f)(GLfloat x, GLfloat y);
664 extern void (GLAPIENTRY *qglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
665 extern void (GLAPIENTRY *qglBegin)(GLenum mode);
666 extern void (GLAPIENTRY *qglEnd)(void);
667
668 extern void (GLAPIENTRY *qglMatrixMode)(GLenum mode);
669 extern void (GLAPIENTRY *qglOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
670 extern void (GLAPIENTRY *qglFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
671 extern void (GLAPIENTRY *qglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
672 extern void (GLAPIENTRY *qglPushMatrix)(void);
673 extern void (GLAPIENTRY *qglPopMatrix)(void);
674 extern void (GLAPIENTRY *qglLoadIdentity)(void);
675 extern void (GLAPIENTRY *qglLoadMatrixd)(const GLdouble *m);
676 extern void (GLAPIENTRY *qglLoadMatrixf)(const GLfloat *m);
677 extern void (GLAPIENTRY *qglMultMatrixd)(const GLdouble *m);
678 extern void (GLAPIENTRY *qglMultMatrixf)(const GLfloat *m);
679 extern void (GLAPIENTRY *qglRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
680 extern void (GLAPIENTRY *qglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
681 extern void (GLAPIENTRY *qglScaled)(GLdouble x, GLdouble y, GLdouble z);
682 extern void (GLAPIENTRY *qglScalef)(GLfloat x, GLfloat y, GLfloat z);
683 extern void (GLAPIENTRY *qglTranslated)(GLdouble x, GLdouble y, GLdouble z);
684 extern void (GLAPIENTRY *qglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
685
686 extern void (GLAPIENTRY *qglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
687
688 extern void (GLAPIENTRY *qglStencilFunc)(GLenum func, GLint ref, GLuint mask);
689 extern void (GLAPIENTRY *qglStencilMask)(GLuint mask);
690 extern void (GLAPIENTRY *qglStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
691 extern void (GLAPIENTRY *qglClearStencil)(GLint s);
692
693 extern void (GLAPIENTRY *qglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
694 extern void (GLAPIENTRY *qglTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
695 extern void (GLAPIENTRY *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
696 extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
697 extern void (GLAPIENTRY *qglTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
698 extern void (GLAPIENTRY *qglTexParameteri)(GLenum target, GLenum pname, GLint param);
699 extern void (GLAPIENTRY *qglHint)(GLenum target, GLenum mode);
700
701 extern void (GLAPIENTRY *qglGenTextures)(GLsizei n, GLuint *textures);
702 extern void (GLAPIENTRY *qglDeleteTextures)(GLsizei n, const GLuint *textures);
703 extern void (GLAPIENTRY *qglBindTexture)(GLenum target, GLuint texture);
704 //extern void (GLAPIENTRY *qglPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
705 //extern GLboolean (GLAPIENTRY *qglAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
706 extern GLboolean (GLAPIENTRY *qglIsTexture)(GLuint texture);
707 extern void (GLAPIENTRY *qglPixelStoref)(GLenum pname, GLfloat param);
708 extern void (GLAPIENTRY *qglPixelStorei)(GLenum pname, GLint param);
709
710 extern void (GLAPIENTRY *qglTexImage1D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
711 extern void (GLAPIENTRY *qglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
712 extern void (GLAPIENTRY *qglTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
713 extern void (GLAPIENTRY *qglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
714 extern void (GLAPIENTRY *qglCopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
715 extern void (GLAPIENTRY *qglCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
716 extern void (GLAPIENTRY *qglCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
717 extern void (GLAPIENTRY *qglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
718
719 extern void (GLAPIENTRY *qglPolygonOffset)(GLfloat factor, GLfloat units);
720 extern void (GLAPIENTRY *qglPolygonMode)(GLenum face, GLenum mode);
721
722 extern void (GLAPIENTRY *qglClipPlane)(GLenum plane, const GLdouble *equation);
723 extern void (GLAPIENTRY *qglGetClipPlane)(GLenum plane, GLdouble *equation);
724
725 //[515]: added on 29.07.2005
726 extern void (GLAPIENTRY *qglLineWidth)(GLfloat width);
727 extern void (GLAPIENTRY *qglPointSize)(GLfloat size);
728
729 // GL_ARB_shader_objects
730 extern int gl_support_shader_objects;
731 #ifndef GL_PROGRAM_OBJECT_ARB
732 // 1-byte character string
733 typedef char GLcharARB;
734 // 4-byte integer handle to a shader object or program object
735 typedef unsigned int GLhandleARB;
736 #endif
737 extern void (GLAPIENTRY *qglDeleteObjectARB)(GLhandleARB obj);
738 extern GLhandleARB (GLAPIENTRY *qglGetHandleARB)(GLenum pname);
739 extern void (GLAPIENTRY *qglDetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj);
740 extern GLhandleARB (GLAPIENTRY *qglCreateShaderObjectARB)(GLenum shaderType);
741 extern void (GLAPIENTRY *qglShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length);
742 extern void (GLAPIENTRY *qglCompileShaderARB)(GLhandleARB shaderObj);
743 extern GLhandleARB (GLAPIENTRY *qglCreateProgramObjectARB)(void);
744 extern void (GLAPIENTRY *qglAttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj);
745 extern void (GLAPIENTRY *qglLinkProgramARB)(GLhandleARB programObj);
746 extern void (GLAPIENTRY *qglUseProgramObjectARB)(GLhandleARB programObj);
747 extern void (GLAPIENTRY *qglValidateProgramARB)(GLhandleARB programObj);
748 extern void (GLAPIENTRY *qglUniform1fARB)(GLint location, GLfloat v0);
749 extern void (GLAPIENTRY *qglUniform2fARB)(GLint location, GLfloat v0, GLfloat v1);
750 extern void (GLAPIENTRY *qglUniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
751 extern void (GLAPIENTRY *qglUniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
752 extern void (GLAPIENTRY *qglUniform1iARB)(GLint location, GLint v0);
753 extern void (GLAPIENTRY *qglUniform2iARB)(GLint location, GLint v0, GLint v1);
754 extern void (GLAPIENTRY *qglUniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2);
755 extern void (GLAPIENTRY *qglUniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
756 extern void (GLAPIENTRY *qglUniform1fvARB)(GLint location, GLsizei count, const GLfloat *value);
757 extern void (GLAPIENTRY *qglUniform2fvARB)(GLint location, GLsizei count, const GLfloat *value);
758 extern void (GLAPIENTRY *qglUniform3fvARB)(GLint location, GLsizei count, const GLfloat *value);
759 extern void (GLAPIENTRY *qglUniform4fvARB)(GLint location, GLsizei count, const GLfloat *value);
760 extern void (GLAPIENTRY *qglUniform1ivARB)(GLint location, GLsizei count, const GLint *value);
761 extern void (GLAPIENTRY *qglUniform2ivARB)(GLint location, GLsizei count, const GLint *value);
762 extern void (GLAPIENTRY *qglUniform3ivARB)(GLint location, GLsizei count, const GLint *value);
763 extern void (GLAPIENTRY *qglUniform4ivARB)(GLint location, GLsizei count, const GLint *value);
764 extern void (GLAPIENTRY *qglUniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
765 extern void (GLAPIENTRY *qglUniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
766 extern void (GLAPIENTRY *qglUniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
767 extern void (GLAPIENTRY *qglGetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat *params);
768 extern void (GLAPIENTRY *qglGetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint *params);
769 extern void (GLAPIENTRY *qglGetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
770 extern void (GLAPIENTRY *qglGetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
771 extern GLint (GLAPIENTRY *qglGetUniformLocationARB)(GLhandleARB programObj, const GLcharARB *name);
772 extern void (GLAPIENTRY *qglGetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
773 extern void (GLAPIENTRY *qglGetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat *params);
774 extern void (GLAPIENTRY *qglGetUniformivARB)(GLhandleARB programObj, GLint location, GLint *params);
775 extern void (GLAPIENTRY *qglGetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
776 extern void (GLAPIENTRY *qglPolygonStipple)(const GLubyte *mask);
777 #ifndef GL_PROGRAM_OBJECT_ARB
778 #define GL_PROGRAM_OBJECT_ARB                                   0x8B40
779 #define GL_OBJECT_TYPE_ARB                                              0x8B4E
780 #define GL_OBJECT_SUBTYPE_ARB                                   0x8B4F
781 #define GL_OBJECT_DELETE_STATUS_ARB                             0x8B80
782 #define GL_OBJECT_COMPILE_STATUS_ARB                    0x8B81
783 #define GL_OBJECT_LINK_STATUS_ARB                               0x8B82
784 #define GL_OBJECT_VALIDATE_STATUS_ARB                   0x8B83
785 #define GL_OBJECT_INFO_LOG_LENGTH_ARB                   0x8B84
786 #define GL_OBJECT_ATTACHED_OBJECTS_ARB                  0x8B85
787 #define GL_OBJECT_ACTIVE_UNIFORMS_ARB                   0x8B86
788 #define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
789 #define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB              0x8B88
790 #define GL_SHADER_OBJECT_ARB                                    0x8B48
791 #define GL_FLOAT                                                                0x1406
792 #define GL_FLOAT_VEC2_ARB                                               0x8B50
793 #define GL_FLOAT_VEC3_ARB                                               0x8B51
794 #define GL_FLOAT_VEC4_ARB                                               0x8B52
795 #define GL_INT                                                                  0x1404
796 #define GL_INT_VEC2_ARB                                                 0x8B53
797 #define GL_INT_VEC3_ARB                                                 0x8B54
798 #define GL_INT_VEC4_ARB                                                 0x8B55
799 #define GL_BOOL_ARB                                                             0x8B56
800 #define GL_BOOL_VEC2_ARB                                                0x8B57
801 #define GL_BOOL_VEC3_ARB                                                0x8B58
802 #define GL_BOOL_VEC4_ARB                                                0x8B59
803 #define GL_FLOAT_MAT2_ARB                                               0x8B5A
804 #define GL_FLOAT_MAT3_ARB                                               0x8B5B
805 #define GL_FLOAT_MAT4_ARB                                               0x8B5C
806 #define GL_SAMPLER_1D_ARB                                               0x8B5D
807 #define GL_SAMPLER_2D_ARB                                               0x8B5E
808 #define GL_SAMPLER_3D_ARB                                               0x8B5F
809 #define GL_SAMPLER_CUBE_ARB                                             0x8B60
810 #define GL_SAMPLER_1D_SHADOW_ARB                                0x8B61
811 #define GL_SAMPLER_2D_SHADOW_ARB                                0x8B62
812 #define GL_SAMPLER_2D_RECT_ARB                                  0x8B63
813 #define GL_SAMPLER_2D_RECT_SHADOW_ARB                   0x8B64
814 #endif
815
816 // GL_ARB_vertex_shader
817 extern int gl_support_vertex_shader;
818 //extern void (GLAPIENTRY *qglVertexAttrib1fARB)(GLuint index, GLfloat v0);
819 //extern void (GLAPIENTRY *qglVertexAttrib1sARB)(GLuint index, GLshort v0);
820 //extern void (GLAPIENTRY *qglVertexAttrib1dARB)(GLuint index, GLdouble v0);
821 //extern void (GLAPIENTRY *qglVertexAttrib2fARB)(GLuint index, GLfloat v0, GLfloat v1);
822 //extern void (GLAPIENTRY *qglVertexAttrib2sARB)(GLuint index, GLshort v0, GLshort v1);
823 //extern void (GLAPIENTRY *qglVertexAttrib2dARB)(GLuint index, GLdouble v0, GLdouble v1);
824 //extern void (GLAPIENTRY *qglVertexAttrib3fARB)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2);
825 //extern void (GLAPIENTRY *qglVertexAttrib3sARB)(GLuint index, GLshort v0, GLshort v1, GLshort v2);
826 //extern void (GLAPIENTRY *qglVertexAttrib3dARB)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2);
827 //extern void (GLAPIENTRY *qglVertexAttrib4fARB)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
828 //extern void (GLAPIENTRY *qglVertexAttrib4sARB)(GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3);
829 //extern void (GLAPIENTRY *qglVertexAttrib4dARB)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
830 //extern void (GLAPIENTRY *qglVertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
831 //extern void (GLAPIENTRY *qglVertexAttrib1fvARB)(GLuint index, const GLfloat *v);
832 //extern void (GLAPIENTRY *qglVertexAttrib1svARB)(GLuint index, const GLshort *v);
833 //extern void (GLAPIENTRY *qglVertexAttrib1dvARB)(GLuint index, const GLdouble *v);
834 //extern void (GLAPIENTRY *qglVertexAttrib2fvARB)(GLuint index, const GLfloat *v);
835 //extern void (GLAPIENTRY *qglVertexAttrib2svARB)(GLuint index, const GLshort *v);
836 //extern void (GLAPIENTRY *qglVertexAttrib2dvARB)(GLuint index, const GLdouble *v);
837 //extern void (GLAPIENTRY *qglVertexAttrib3fvARB)(GLuint index, const GLfloat *v);
838 //extern void (GLAPIENTRY *qglVertexAttrib3svARB)(GLuint index, const GLshort *v);
839 //extern void (GLAPIENTRY *qglVertexAttrib3dvARB)(GLuint index, const GLdouble *v);
840 //extern void (GLAPIENTRY *qglVertexAttrib4fvARB)(GLuint index, const GLfloat *v);
841 //extern void (GLAPIENTRY *qglVertexAttrib4svARB)(GLuint index, const GLshort *v);
842 //extern void (GLAPIENTRY *qglVertexAttrib4dvARB)(GLuint index, const GLdouble *v);
843 //extern void (GLAPIENTRY *qglVertexAttrib4ivARB)(GLuint index, const GLint *v);
844 //extern void (GLAPIENTRY *qglVertexAttrib4bvARB)(GLuint index, const GLbyte *v);
845 //extern void (GLAPIENTRY *qglVertexAttrib4ubvARB)(GLuint index, const GLubyte *v);
846 //extern void (GLAPIENTRY *qglVertexAttrib4usvARB)(GLuint index, const GLushort *v);
847 //extern void (GLAPIENTRY *qglVertexAttrib4uivARB)(GLuint index, const GLuint *v);
848 //extern void (GLAPIENTRY *qglVertexAttrib4NbvARB)(GLuint index, const GLbyte *v);
849 //extern void (GLAPIENTRY *qglVertexAttrib4NsvARB)(GLuint index, const GLshort *v);
850 //extern void (GLAPIENTRY *qglVertexAttrib4NivARB)(GLuint index, const GLint *v);
851 //extern void (GLAPIENTRY *qglVertexAttrib4NubvARB)(GLuint index, const GLubyte *v);
852 //extern void (GLAPIENTRY *qglVertexAttrib4NusvARB)(GLuint index, const GLushort *v);
853 //extern void (GLAPIENTRY *qglVertexAttrib4NuivARB)(GLuint index, const GLuint *v);
854 extern void (GLAPIENTRY *qglVertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
855 extern void (GLAPIENTRY *qglEnableVertexAttribArrayARB)(GLuint index);
856 extern void (GLAPIENTRY *qglDisableVertexAttribArrayARB)(GLuint index);
857 extern void (GLAPIENTRY *qglBindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB *name);
858 extern void (GLAPIENTRY *qglGetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
859 extern GLint (GLAPIENTRY *qglGetAttribLocationARB)(GLhandleARB programObj, const GLcharARB *name);
860 //extern void (GLAPIENTRY *qglGetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params);
861 //extern void (GLAPIENTRY *qglGetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params);
862 //extern void (GLAPIENTRY *qglGetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params);
863 //extern void (GLAPIENTRY *qglGetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer);
864 #ifndef GL_VERTEX_SHADER_ARB
865 #define GL_VERTEX_SHADER_ARB                                            0x8B31
866 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB            0x8B4A
867 #define GL_MAX_VARYING_FLOATS_ARB                                       0x8B4B
868 #define GL_MAX_VERTEX_ATTRIBS_ARB                                       0x8869
869 #define GL_MAX_TEXTURE_IMAGE_UNITS_ARB                          0x8872
870 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB           0x8B4C
871 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB         0x8B4D
872 #define GL_MAX_TEXTURE_COORDS_ARB                                       0x8871
873 #define GL_VERTEX_PROGRAM_POINT_SIZE_ARB                        0x8642
874 #define GL_VERTEX_PROGRAM_TWO_SIDE_ARB                          0x8643
875 #define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB                         0x8B89
876 #define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB       0x8B8A
877 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB                      0x8622
878 #define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB                         0x8623
879 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB                       0x8624
880 #define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB                         0x8625
881 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB           0x886A
882 #define GL_CURRENT_VERTEX_ATTRIB_ARB                            0x8626
883 #define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB                      0x8645
884 #define GL_FLOAT                                                                        0x1406
885 #define GL_FLOAT_VEC2_ARB                                                       0x8B50
886 #define GL_FLOAT_VEC3_ARB                                                       0x8B51
887 #define GL_FLOAT_VEC4_ARB                                                       0x8B52
888 #define GL_FLOAT_MAT2_ARB                                                       0x8B5A
889 #define GL_FLOAT_MAT3_ARB                                                       0x8B5B
890 #define GL_FLOAT_MAT4_ARB                                                       0x8B5C
891 #endif
892
893 // GL_ARB_fragment_shader
894 extern int gl_support_fragment_shader;
895 #ifndef GL_FRAGMENT_SHADER_ARB
896 #define GL_FRAGMENT_SHADER_ARB                                          0x8B30
897 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB          0x8B49
898 #define GL_MAX_TEXTURE_COORDS_ARB                                       0x8871
899 #define GL_MAX_TEXTURE_IMAGE_UNITS_ARB                          0x8872
900 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB          0x8B8B
901 #endif
902
903 // GL_ARB_shading_language_100
904 extern int gl_support_shading_language_100;
905 #ifndef GL_SHADING_LANGUAGE_VERSION_ARB
906 #define GL_SHADING_LANGUAGE_VERSION_ARB                         0x8B8C
907 #endif
908
909 // GL_ARB_texture_compression
910 extern int gl_support_texture_compression;
911 extern void (GLAPIENTRY *qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
912 extern void (GLAPIENTRY *qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border,  GLsizei imageSize, const void *data);
913 extern void (GLAPIENTRY *qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
914 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);
915 extern void (GLAPIENTRY *qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
916 extern void (GLAPIENTRY *qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
917 extern void (GLAPIENTRY *qglGetCompressedTexImageARB)(GLenum target, GLint lod, void *img);
918 #ifndef GL_COMPRESSED_RGB_ARB
919 #define GL_COMPRESSED_ALPHA_ARB                                         0x84E9
920 #define GL_COMPRESSED_LUMINANCE_ARB                                     0x84EA
921 #define GL_COMPRESSED_LUMINANCE_ALPHA_ARB                       0x84EB
922 #define GL_COMPRESSED_INTENSITY_ARB                                     0x84EC
923 #define GL_COMPRESSED_RGB_ARB                                           0x84ED
924 #define GL_COMPRESSED_RGBA_ARB                                          0x84EE
925 #define GL_TEXTURE_COMPRESSION_HINT_ARB                         0x84EF
926 #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB            0x86A0
927 #define GL_TEXTURE_COMPRESSED_ARB                                       0x86A1
928 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB           0x86A2
929 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB                       0x86A3
930 #endif
931
932 // GL_ARB_occlusion_query
933 extern int gl_support_arb_occlusion_query;
934 extern void (GLAPIENTRY *qglGenQueriesARB)(GLsizei n, GLuint *ids);
935 extern void (GLAPIENTRY *qglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
936 extern GLboolean (GLAPIENTRY *qglIsQueryARB)(GLuint qid);
937 extern void (GLAPIENTRY *qglBeginQueryARB)(GLenum target, GLuint qid);
938 extern void (GLAPIENTRY *qglEndQueryARB)(GLenum target);
939 extern void (GLAPIENTRY *qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params);
940 extern void (GLAPIENTRY *qglGetQueryObjectivARB)(GLuint qid, GLenum pname, GLint *params);
941 extern void (GLAPIENTRY *qglGetQueryObjectuivARB)(GLuint qid, GLenum pname, GLuint *params);
942 #ifndef GL_SAMPLES_PASSED_ARB
943 #define GL_SAMPLES_PASSED_ARB                             0x8914
944 #define GL_QUERY_COUNTER_BITS_ARB                         0x8864
945 #define GL_CURRENT_QUERY_ARB                              0x8865
946 #define GL_QUERY_RESULT_ARB                               0x8866
947 #define GL_QUERY_RESULT_AVAILABLE_ARB                     0x8867
948 #endif
949
950 // GL_EXT_bgr
951 #define GL_BGR                                  0x80E0
952
953 // GL_EXT_bgra
954 #define GL_BGRA                                 0x80E1
955
956 // GL_EXT_texture
957 #define GL_LUMINANCE_ALPHA                0x190A
958 #define GL_LUMINANCE16_ALPHA16            0x8048
959
960 //GL_AMD_texture_texture4
961 extern int gl_support_amd_texture_texture4;
962
963 //GL_ARB_texture_gather
964 extern int gl_support_arb_texture_gather;
965
966 #define DEBUGGL
967
968 #ifdef DEBUGGL
969 #define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);errornumber = qglGetError();if (errornumber) GL_PrintError(errornumber, __FILE__, __LINE__);}}
970 extern int errornumber;
971 void GL_PrintError(int errornumber, char *filename, int linenumber);
972 #else
973 #define CHECKGLERROR
974 #endif
975
976 #endif
977