GL_EXT_texture_filter_anisotropic support (thanks zinx!)
[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 #pragma warning(disable : 4018)         // LordHavoc: MSVC++ 4 x86, signed/unsigned mismatch
30 #endif
31
32
33 //====================================================
34
35 // wgl uses APIENTRY
36 #ifndef APIENTRY
37 #define APIENTRY
38 #endif
39
40 // for platforms (wgl) that do not use GLAPIENTRY
41 #ifndef GLAPIENTRY
42 #define GLAPIENTRY APIENTRY
43 #endif
44
45 #ifndef GL_PROJECTION
46 typedef unsigned int GLenum;
47 typedef unsigned char GLboolean;
48 typedef unsigned int GLbitfield;
49 typedef void GLvoid;
50 // 1-byte signed
51 typedef signed char GLbyte;
52 // 2-byte signed
53 typedef short GLshort;
54 // 4-byte signed
55 typedef int GLint;
56 // 1-byte unsigned
57 typedef unsigned char GLubyte;
58 // 2-byte unsigned
59 typedef unsigned short GLushort;
60 // 4-byte unsigned
61 typedef unsigned int GLuint;
62 // 4-byte signed
63 typedef int GLsizei;
64 // single precision float
65 typedef float GLfloat;
66 // single precision float in [0,1]
67 typedef float GLclampf;
68 // double precision float
69 typedef double GLdouble;
70 // double precision float in [0,1]
71 typedef double GLclampd;
72
73 #define GL_MODELVIEW                            0x1700
74 #define GL_PROJECTION                           0x1701
75 #define GL_TEXTURE                              0x1702
76 #define GL_MATRIX_MODE                          0x0BA0
77 #define GL_MODELVIEW_MATRIX                     0x0BA6
78 #define GL_PROJECTION_MATRIX                    0x0BA7
79 #define GL_TEXTURE_MATRIX                       0x0BA8
80
81 #define GL_DEPTH_TEST                           0x0B71
82
83 #define GL_CULL_FACE                            0x0B44
84
85 #define GL_BLEND                                0x0BE2
86
87 #define GL_ZERO                                 0x0
88 #define GL_ONE                                  0x1
89 #define GL_SRC_COLOR                            0x0300
90 #define GL_ONE_MINUS_SRC_COLOR                  0x0301
91 #define GL_DST_COLOR                            0x0306
92 #define GL_ONE_MINUS_DST_COLOR                  0x0307
93 #define GL_SRC_ALPHA                            0x0302
94 #define GL_ONE_MINUS_SRC_ALPHA                  0x0303
95 #define GL_DST_ALPHA                            0x0304
96 #define GL_ONE_MINUS_DST_ALPHA                  0x0305
97 #define GL_SRC_ALPHA_SATURATE                   0x0308
98 #define GL_CONSTANT_COLOR                       0x8001
99 #define GL_ONE_MINUS_CONSTANT_COLOR             0x8002
100 #define GL_CONSTANT_ALPHA                       0x8003
101 #define GL_ONE_MINUS_CONSTANT_ALPHA             0x8004
102
103 #define GL_TEXTURE_ENV                          0x2300
104 #define GL_TEXTURE_ENV_MODE                     0x2200
105 #define GL_TEXTURE_1D                           0x0DE0
106 #define GL_TEXTURE_2D                           0x0DE1
107 #define GL_TEXTURE_WRAP_S                       0x2802
108 #define GL_TEXTURE_WRAP_T                       0x2803
109 #define GL_TEXTURE_WRAP_R                       0x8072
110 #define GL_TEXTURE_BORDER_COLOR                 0x1004
111 #define GL_TEXTURE_MAG_FILTER                   0x2800
112 #define GL_TEXTURE_MIN_FILTER                   0x2801
113 #define GL_UNPACK_ALIGNMENT                     0x0CF5
114 #define GL_TEXTURE_BINDING_1D                   0x8068
115 #define GL_TEXTURE_BINDING_2D                   0x8069
116
117 #define GL_NEAREST                              0x2600
118 #define GL_LINEAR                               0x2601
119 #define GL_NEAREST_MIPMAP_NEAREST               0x2700
120 #define GL_NEAREST_MIPMAP_LINEAR                0x2702
121 #define GL_LINEAR_MIPMAP_NEAREST                0x2701
122 #define GL_LINEAR_MIPMAP_LINEAR                 0x2703
123
124 extern int gl_support_anisotropy;
125 #define GL_TEXTURE_MAX_ANISOTROPY_EXT           0x84FE
126 #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT       0x84FF
127
128 #define GL_DECAL                                0x2101
129 #define GL_MODULATE                             0x2100
130
131 #define GL_REPEAT                               0x2901
132 #define GL_CLAMP                                0x2900
133
134 #define GL_TRIANGLES                            0x0004
135
136 #define GL_FALSE                                0x0
137 #define GL_TRUE                                 0x1
138
139 #define GL_BYTE                                 0x1400
140 #define GL_UNSIGNED_BYTE                        0x1401
141 #define GL_SHORT                                0x1402
142 #define GL_UNSIGNED_SHORT                       0x1403
143 #define GL_INT                                  0x1404
144 #define GL_UNSIGNED_INT                         0x1405
145 #define GL_FLOAT                                0x1406
146 #define GL_DOUBLE                               0x140A
147 #define GL_2_BYTES                              0x1407
148 #define GL_3_BYTES                              0x1408
149 #define GL_4_BYTES                              0x1409
150
151 #define GL_VERTEX_ARRAY                         0x8074
152 #define GL_NORMAL_ARRAY                         0x8075
153 #define GL_COLOR_ARRAY                          0x8076
154 //#define GL_INDEX_ARRAY                                0x8077
155 #define GL_TEXTURE_COORD_ARRAY                  0x8078
156 //#define GL_EDGE_FLAG_ARRAY                    0x8079
157
158 #define GL_FRONT                                0x0404
159 #define GL_BACK                                 0x0405
160
161 #define GL_VENDOR                               0x1F00
162 #define GL_RENDERER                             0x1F01
163 #define GL_VERSION                              0x1F02
164 #define GL_EXTENSIONS                           0x1F03
165
166 #define GL_NO_ERROR                             0x0
167 #define GL_INVALID_VALUE                        0x0501
168 #define GL_INVALID_ENUM                         0x0500
169 #define GL_INVALID_OPERATION                    0x0502
170 #define GL_STACK_OVERFLOW                       0x0503
171 #define GL_STACK_UNDERFLOW                      0x0504
172 #define GL_OUT_OF_MEMORY                        0x0505
173
174 #define GL_DITHER                               0x0BD0
175 #define GL_RGB                                  0x1907
176 #define GL_RGBA                                 0x1908
177
178 #define GL_MAX_TEXTURE_SIZE                     0x0D33
179
180 #define GL_NEVER                                0x0200
181 #define GL_LESS                                 0x0201
182 #define GL_EQUAL                                0x0202
183 #define GL_LEQUAL                               0x0203
184 #define GL_GREATER                              0x0204
185 #define GL_NOTEQUAL                             0x0205
186 #define GL_GEQUAL                               0x0206
187 #define GL_ALWAYS                               0x0207
188 #define GL_DEPTH_TEST                           0x0B71
189
190 #define GL_RED_SCALE                            0x0D14
191 #define GL_GREEN_SCALE                          0x0D18
192 #define GL_BLUE_SCALE                           0x0D1A
193 #define GL_ALPHA_SCALE                          0x0D1C
194
195 #define GL_DEPTH_BUFFER_BIT                     0x00000100
196 #define GL_ACCUM_BUFFER_BIT                     0x00000200
197 #define GL_STENCIL_BUFFER_BIT                   0x00000400
198 #define GL_COLOR_BUFFER_BIT                     0x00004000
199
200 #define GL_STENCIL_TEST                         0x0B90
201 #define GL_KEEP                                 0x1E00
202 #define GL_REPLACE                              0x1E01
203 #define GL_INCR                                 0x1E02
204 #define GL_DECR                                 0x1E03
205
206 #define GL_POLYGON_OFFSET_FACTOR          0x8038
207 #define GL_POLYGON_OFFSET_UNITS           0x2A00
208 #define GL_POLYGON_OFFSET_POINT           0x2A01
209 #define GL_POLYGON_OFFSET_LINE            0x2A02
210 #define GL_POLYGON_OFFSET_FILL            0x8037
211 #endif
212
213 // GL_ARB_multitexture
214 extern int gl_textureunits;
215 extern void (GLAPIENTRY *qglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
216 extern void (GLAPIENTRY *qglMultiTexCoord3f) (GLenum, GLfloat, GLfloat, GLfloat);
217 extern void (GLAPIENTRY *qglActiveTexture) (GLenum);
218 extern void (GLAPIENTRY *qglClientActiveTexture) (GLenum);
219 #ifndef GL_ACTIVE_TEXTURE_ARB
220 #define GL_ACTIVE_TEXTURE_ARB                   0x84E0
221 #define GL_CLIENT_ACTIVE_TEXTURE_ARB    0x84E1
222 #define GL_MAX_TEXTURE_UNITS_ARB                0x84E2
223 #define GL_TEXTURE0_ARB                                 0x84C0
224 #define GL_TEXTURE1_ARB                                 0x84C1
225 #define GL_TEXTURE2_ARB                                 0x84C2
226 #define GL_TEXTURE3_ARB                                 0x84C3
227 #define GL_TEXTURE4_ARB                                 0x84C4
228 #define GL_TEXTURE5_ARB                                 0x84C5
229 #define GL_TEXTURE6_ARB                                 0x84C6
230 #define GL_TEXTURE7_ARB                                 0x84C7
231 #define GL_TEXTURE8_ARB                                 0x84C8
232 #define GL_TEXTURE9_ARB                                 0x84C9
233 #define GL_TEXTURE10_ARB                                0x84CA
234 #define GL_TEXTURE11_ARB                                0x84CB
235 #define GL_TEXTURE12_ARB                                0x84CC
236 #define GL_TEXTURE13_ARB                                0x84CD
237 #define GL_TEXTURE14_ARB                                0x84CE
238 #define GL_TEXTURE15_ARB                                0x84CF
239 #define GL_TEXTURE16_ARB                                0x84D0
240 #define GL_TEXTURE17_ARB                                0x84D1
241 #define GL_TEXTURE18_ARB                                0x84D2
242 #define GL_TEXTURE19_ARB                                0x84D3
243 #define GL_TEXTURE20_ARB                                0x84D4
244 #define GL_TEXTURE21_ARB                                0x84D5
245 #define GL_TEXTURE22_ARB                                0x84D6
246 #define GL_TEXTURE23_ARB                                0x84D7
247 #define GL_TEXTURE24_ARB                                0x84D8
248 #define GL_TEXTURE25_ARB                                0x84D9
249 #define GL_TEXTURE26_ARB                                0x84DA
250 #define GL_TEXTURE27_ARB                                0x84DB
251 #define GL_TEXTURE28_ARB                                0x84DC
252 #define GL_TEXTURE29_ARB                                0x84DD
253 #define GL_TEXTURE30_ARB                                0x84DE
254 #define GL_TEXTURE31_ARB                                0x84DF
255 #endif
256
257 // GL_EXT_compiled_vertex_array
258 extern int gl_supportslockarrays;
259 extern void (GLAPIENTRY *qglLockArraysEXT) (GLint first, GLint count);
260 extern void (GLAPIENTRY *qglUnlockArraysEXT) (void);
261
262 // GL_ARB_texture_env_combine
263 extern int gl_combine_extension;
264 #ifndef GL_COMBINE_ARB
265 #define GL_COMBINE_ARB                                  0x8570
266 #define GL_COMBINE_RGB_ARB                              0x8571
267 #define GL_COMBINE_ALPHA_ARB                    0x8572
268 #define GL_SOURCE0_RGB_ARB                              0x8580
269 #define GL_SOURCE1_RGB_ARB                              0x8581
270 #define GL_SOURCE2_RGB_ARB                              0x8582
271 #define GL_SOURCE0_ALPHA_ARB                    0x8588
272 #define GL_SOURCE1_ALPHA_ARB                    0x8589
273 #define GL_SOURCE2_ALPHA_ARB                    0x858A
274 #define GL_OPERAND0_RGB_ARB                             0x8590
275 #define GL_OPERAND1_RGB_ARB                             0x8591
276 #define GL_OPERAND2_RGB_ARB                             0x8592
277 #define GL_OPERAND0_ALPHA_ARB                   0x8598
278 #define GL_OPERAND1_ALPHA_ARB                   0x8599
279 #define GL_OPERAND2_ALPHA_ARB                   0x859A
280 #define GL_RGB_SCALE_ARB                                0x8573
281 #define GL_ADD_SIGNED_ARB                               0x8574
282 #define GL_INTERPOLATE_ARB                              0x8575
283 #define GL_SUBTRACT_ARB                                 0x84E7
284 #define GL_CONSTANT_ARB                                 0x8576
285 #define GL_PRIMARY_COLOR_ARB                    0x8577
286 #define GL_PREVIOUS_ARB                                 0x8578
287 #endif
288
289 #ifndef GL_MAX_ELEMENTS_VERTICES
290 #define GL_MAX_ELEMENTS_VERTICES                0x80E8
291 #endif
292 #ifndef GL_MAX_ELEMENTS_INDICES
293 #define GL_MAX_ELEMENTS_INDICES                 0x80E9
294 #endif
295
296 extern cvar_t gl_combine;
297
298 extern int gl_texture3d;
299 #ifndef GL_TEXTURE_3D
300 #define GL_PACK_SKIP_IMAGES                     0x806B
301 #define GL_PACK_IMAGE_HEIGHT                    0x806C
302 #define GL_UNPACK_SKIP_IMAGES                   0x806D
303 #define GL_UNPACK_IMAGE_HEIGHT                  0x806E
304 #define GL_TEXTURE_3D                           0x806F
305 #define GL_PROXY_TEXTURE_3D                     0x8070
306 #define GL_TEXTURE_DEPTH                        0x8071
307 #define GL_TEXTURE_WRAP_R                       0x8072
308 #define GL_MAX_3D_TEXTURE_SIZE                  0x8073
309 #define GL_TEXTURE_BINDING_3D                   0x806A
310 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);
311 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);
312 extern void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
313 #endif
314
315 extern int gl_texturecubemap;
316 #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
317 #define GL_NORMAL_MAP_ARB                           0x8511
318 #define GL_REFLECTION_MAP_ARB               0x8512
319 #define GL_TEXTURE_CUBE_MAP_ARB             0x8513
320 #define GL_TEXTURE_BINDING_CUBE_MAP_ARB     0x8514
321 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB     0x8515
322 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB     0x8516
323 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB     0x8517
324 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB     0x8518
325 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB     0x8519
326 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB     0x851A
327 #define GL_PROXY_TEXTURE_CUBE_MAP_ARB       0x851B
328 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB                0x851C
329 #endif
330
331 extern int gl_dot3arb;
332 #ifndef GL_DOT3_RGB_ARB
333 #define GL_DOT3_RGB_ARB                         0x86AE
334 #define GL_DOT3_RGBA_ARB                                0x86AF
335 #endif
336
337 /*
338 // uncomment if this is actually needed by anyone
339 extern int gl_dot3ext;
340 #ifndef GL_DOT3_RGB_EXT
341 #define GL_DOT3_RGB_EXT                         0x8740
342 #define GL_DOT3_RGBA_EXT                        0x8741
343 #endif
344 */
345
346 #ifndef GL_SCISSOR_TEST
347 #define GL_SCISSOR_TEST                         0x0C11
348 #define GL_SCISSOR_BOX                          0x0C10
349 #endif
350
351 // GL_SGIS_texture_edge_clamp or GL_EXT_texture_edge_clamp
352 extern int gl_support_clamptoedge;
353 #ifndef GL_CLAMP_TO_EDGE
354 #define GL_CLAMP_TO_EDGE 0x812F
355 #endif
356
357 //GL_NV_vertex_array_range
358 extern GLvoid *(GLAPIENTRY *qglAllocateMemoryNV)(GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
359 extern GLvoid (GLAPIENTRY *qglFreeMemoryNV)(GLvoid *pointer);
360 extern GLvoid (GLAPIENTRY *qglVertexArrayRangeNV)(GLsizei length, GLvoid *pointer);
361 extern GLvoid (GLAPIENTRY *qglFlushVertexArrayRangeNV)(GLvoid);
362 #define GL_VERTEX_ARRAY_RANGE_NV 0x851D
363 #define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
364 #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
365 #define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
366 extern int gl_support_var;
367
368 //GL_NV_vertex_array_range2
369 #define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
370 extern int gl_support_var2;
371
372
373 extern void (GLAPIENTRY *qglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
374
375 extern void (GLAPIENTRY *qglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
376
377 extern void (GLAPIENTRY *qglClear)(GLbitfield mask);
378
379 //extern void (GLAPIENTRY *qglAlphaFunc)(GLenum func, GLclampf ref);
380 extern void (GLAPIENTRY *qglBlendFunc)(GLenum sfactor, GLenum dfactor);
381 extern void (GLAPIENTRY *qglCullFace)(GLenum mode);
382
383 //extern void (GLAPIENTRY *qglDrawBuffer)(GLenum mode);
384 //extern void (GLAPIENTRY *qglReadBuffer)(GLenum mode);
385 extern void (GLAPIENTRY *qglEnable)(GLenum cap);
386 extern void (GLAPIENTRY *qglDisable)(GLenum cap);
387 extern GLboolean (GLAPIENTRY *qglIsEnabled)(GLenum cap);
388
389 extern void (GLAPIENTRY *qglEnableClientState)(GLenum cap);
390 extern void (GLAPIENTRY *qglDisableClientState)(GLenum cap);
391
392 //extern void (GLAPIENTRY *qglGetBooleanv)(GLenum pname, GLboolean *params);
393 //extern void (GLAPIENTRY *qglGetDoublev)(GLenum pname, GLdouble *params);
394 //extern void (GLAPIENTRY *qglGetFloatv)(GLenum pname, GLfloat *params);
395 extern void (GLAPIENTRY *qglGetIntegerv)(GLenum pname, GLint *params);
396
397 extern GLenum (GLAPIENTRY *qglGetError)(void);
398 extern const GLubyte* (GLAPIENTRY *qglGetString)(GLenum name);
399 extern void (GLAPIENTRY *qglFinish)(void);
400 extern void (GLAPIENTRY *qglFlush)(void);
401
402 extern void (GLAPIENTRY *qglClearDepth)(GLclampd depth);
403 extern void (GLAPIENTRY *qglDepthFunc)(GLenum func);
404 extern void (GLAPIENTRY *qglDepthMask)(GLboolean flag);
405 extern void (GLAPIENTRY *qglDepthRange)(GLclampd near_val, GLclampd far_val);
406 extern void (GLAPIENTRY *qglColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
407
408 extern void (GLAPIENTRY *qglDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
409 extern void (GLAPIENTRY *qglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
410 extern void (GLAPIENTRY *qglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
411 extern void (GLAPIENTRY *qglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr);
412 extern void (GLAPIENTRY *qglColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
413 extern void (GLAPIENTRY *qglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
414 extern void (GLAPIENTRY *qglArrayElement)(GLint i);
415
416 extern void (GLAPIENTRY *qglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
417 extern void (GLAPIENTRY *qglTexCoord2f)(GLfloat s, GLfloat t);
418 extern void (GLAPIENTRY *qglTexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
419 extern void (GLAPIENTRY *qglVertex2f)(GLfloat x, GLfloat y);
420 extern void (GLAPIENTRY *qglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
421 extern void (GLAPIENTRY *qglBegin)(GLenum mode);
422 extern void (GLAPIENTRY *qglEnd)(void);
423
424 extern void (GLAPIENTRY *qglMatrixMode)(GLenum mode);
425 extern void (GLAPIENTRY *qglOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
426 extern void (GLAPIENTRY *qglFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
427 extern void (GLAPIENTRY *qglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
428 //extern void (GLAPIENTRY *qglPushMatrix)(void);
429 //extern void (GLAPIENTRY *qglPopMatrix)(void);
430 extern void (GLAPIENTRY *qglLoadIdentity)(void);
431 //extern void (GLAPIENTRY *qglLoadMatrixd)(const GLdouble *m);
432 extern void (GLAPIENTRY *qglLoadMatrixf)(const GLfloat *m);
433 //extern void (GLAPIENTRY *qglMultMatrixd)(const GLdouble *m);
434 //extern void (GLAPIENTRY *qglMultMatrixf)(const GLfloat *m);
435 //extern void (GLAPIENTRY *qglRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
436 //extern void (GLAPIENTRY *qglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
437 //extern void (GLAPIENTRY *qglScaled)(GLdouble x, GLdouble y, GLdouble z);
438 //extern void (GLAPIENTRY *qglScalef)(GLfloat x, GLfloat y, GLfloat z);
439 //extern void (GLAPIENTRY *qglTranslated)(GLdouble x, GLdouble y, GLdouble z);
440 //extern void (GLAPIENTRY *qglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
441
442 extern void (GLAPIENTRY *qglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
443
444 extern void (GLAPIENTRY *qglStencilFunc)(GLenum func, GLint ref, GLuint mask);
445 extern void (GLAPIENTRY *qglStencilMask)(GLuint mask);
446 extern void (GLAPIENTRY *qglStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
447 extern void (GLAPIENTRY *qglClearStencil)(GLint s);
448
449 //extern void (GLAPIENTRY *qglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
450 extern void (GLAPIENTRY *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
451 extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
452 //extern void (GLAPIENTRY *qglTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
453 extern void (GLAPIENTRY *qglTexParameteri)(GLenum target, GLenum pname, GLint param);
454
455 extern void (GLAPIENTRY *qglGenTextures)(GLsizei n, GLuint *textures);
456 extern void (GLAPIENTRY *qglDeleteTextures)(GLsizei n, const GLuint *textures);
457 extern void (GLAPIENTRY *qglBindTexture)(GLenum target, GLuint texture);
458 //extern void (GLAPIENTRY *qglPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
459 //extern GLboolean (GLAPIENTRY *qglAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
460 extern GLboolean (GLAPIENTRY *qglIsTexture)(GLuint texture);
461 //extern void (GLAPIENTRY *qglPixelStoref)(GLenum pname, GLfloat param);
462 extern void (GLAPIENTRY *qglPixelStorei)(GLenum pname, GLint param);
463
464 extern void (GLAPIENTRY *qglTexImage1D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
465 extern void (GLAPIENTRY *qglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
466 extern void (GLAPIENTRY *qglTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
467 extern void (GLAPIENTRY *qglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
468 extern void (GLAPIENTRY *qglCopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
469 extern void (GLAPIENTRY *qglCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
470 extern void (GLAPIENTRY *qglCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
471 extern void (GLAPIENTRY *qglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
472
473 extern void (GLAPIENTRY *qglPolygonOffset)(GLfloat factor, GLfloat units);
474
475 #if WIN32
476 extern int (WINAPI *qwglChoosePixelFormat)(HDC, CONST PIXELFORMATDESCRIPTOR *);
477 extern int (WINAPI *qwglDescribePixelFormat)(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
478 //extern int (WINAPI *qwglGetPixelFormat)(HDC);
479 extern BOOL (WINAPI *qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
480 extern BOOL (WINAPI *qwglSwapBuffers)(HDC);
481 extern HGLRC (WINAPI *qwglCreateContext)(HDC);
482 extern BOOL (WINAPI *qwglDeleteContext)(HGLRC);
483 extern PROC (WINAPI *qwglGetProcAddress)(LPCSTR);
484 extern BOOL (WINAPI *qwglMakeCurrent)(HDC, HGLRC);
485 extern BOOL (WINAPI *qwglSwapIntervalEXT)(int interval);
486 #endif
487
488 #define DEBUGGL
489
490 #ifdef DEBUGGL
491 #define CHECKGLERROR {if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);if (gl_paranoid.integer && (errornumber = qglGetError())) GL_PrintError(errornumber, __FILE__, __LINE__);}
492 extern int errornumber;
493 void GL_PrintError(int errornumber, char *filename, int linenumber);
494 #else
495 #define CHECKGLERROR
496 #endif
497
498 #endif
499