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