]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - glquake.h
added GL_ARB_shader_objects, GL_ARB_shading_language_100, GL_ARB_vertex_shader, GL_AR...
[xonotic/darkplaces.git] / glquake.h
index e2832595759be17e6791cf3066d37efd2f46bd84..71a1f2905053573ddfdd8b823c0d08b2bb922b15 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -26,16 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #ifdef _MSC_VER
 #pragma warning(disable : 4244)     // LordHavoc: MSVC++ 4 x86, double/float
 #pragma warning(disable : 4305)                // LordHavoc: MSVC++ 6 x86, double/float
-#pragma warning(disable : 4018)                // LordHavoc: MSVC++ 4 x86, signed/unsigned mismatch
 #endif
 
-#ifdef _WIN32
-#include <windows.h>
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-#endif
-
-//#include <GL/gl.h>
 
 //====================================================
 
@@ -113,9 +105,13 @@ typedef double GLclampd;
 #define GL_TEXTURE_2D                          0x0DE1
 #define GL_TEXTURE_WRAP_S                      0x2802
 #define GL_TEXTURE_WRAP_T                      0x2803
+#define GL_TEXTURE_WRAP_R                      0x8072
+#define GL_TEXTURE_BORDER_COLOR                        0x1004
 #define GL_TEXTURE_MAG_FILTER                  0x2800
 #define GL_TEXTURE_MIN_FILTER                  0x2801
 #define GL_UNPACK_ALIGNMENT                    0x0CF5
+#define GL_TEXTURE_BINDING_1D                   0x8068
+#define GL_TEXTURE_BINDING_2D                   0x8069
 
 #define GL_NEAREST                             0x2600
 #define GL_LINEAR                              0x2601
@@ -124,13 +120,28 @@ typedef double GLclampd;
 #define GL_LINEAR_MIPMAP_NEAREST               0x2701
 #define GL_LINEAR_MIPMAP_LINEAR                        0x2703
 
+extern int gl_support_anisotropy;
+extern int gl_max_anisotropy;
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT          0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT      0x84FF
+
+#define GL_ADD                                 0x0104
 #define GL_DECAL                               0x2101
 #define GL_MODULATE                            0x2100
 
 #define GL_REPEAT                              0x2901
 #define GL_CLAMP                               0x2900
 
-#define GL_TRIANGLES                           0x0004
+#define GL_POINTS                              0x0000
+#define GL_LINES                               0x0001
+#define GL_LINE_LOOP                   0x0002
+#define GL_LINE_STRIP                  0x0003
+#define GL_TRIANGLES                   0x0004
+#define GL_TRIANGLE_STRIP              0x0005
+#define GL_TRIANGLE_FAN                        0x0006
+#define GL_QUADS                               0x0007
+#define GL_QUAD_STRIP                  0x0008
+#define GL_POLYGON                             0x0009
 
 #define GL_FALSE                               0x0
 #define GL_TRUE                                        0x1
@@ -201,11 +212,18 @@ typedef double GLclampd;
 #define GL_REPLACE                             0x1E01
 #define GL_INCR                                        0x1E02
 #define GL_DECR                                        0x1E03
+
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_POINT           0x2A01
+#define GL_POLYGON_OFFSET_LINE            0x2A02
+#define GL_POLYGON_OFFSET_FILL            0x8037
 #endif
 
 // GL_ARB_multitexture
 extern int gl_textureunits;
 extern void (GLAPIENTRY *qglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
+extern void (GLAPIENTRY *qglMultiTexCoord3f) (GLenum, GLfloat, GLfloat, GLfloat);
 extern void (GLAPIENTRY *qglActiveTexture) (GLenum);
 extern void (GLAPIENTRY *qglClientActiveTexture) (GLenum);
 #ifndef GL_ACTIVE_TEXTURE_ARB
@@ -285,13 +303,105 @@ extern int gl_combine_extension;
 #define GL_MAX_ELEMENTS_INDICES                        0x80E9
 #endif
 
-extern cvar_t gl_combine;
+
+extern int gl_textureshader;
+#ifndef GL_TEXTURE_SHADER_NV
+#define GL_TEXTURE_SHADER_NV                   0x86DE
+#define GL_SHADER_OPERATION_NV                 0x86DF
+#define GL_OFFSET_TEXTURE_MATRIX_NV            0x86E1
+#define GL_PREVIOUS_TEXTURE_INPUT_NV   0x86E4
+#define GL_OFFSET_TEXTURE_2D_NV                        0x86E8
+#define GL_DSDT_NV                                             0x86F5
+#define GL_DSDT8_NV                                            0x8709
+#endif
+
+extern int gl_texture3d;
+#ifndef GL_TEXTURE_3D
+#define GL_PACK_SKIP_IMAGES                    0x806B
+#define GL_PACK_IMAGE_HEIGHT                   0x806C
+#define GL_UNPACK_SKIP_IMAGES                  0x806D
+#define GL_UNPACK_IMAGE_HEIGHT                 0x806E
+#define GL_TEXTURE_3D                          0x806F
+#define GL_PROXY_TEXTURE_3D                    0x8070
+#define GL_TEXTURE_DEPTH                       0x8071
+#define GL_TEXTURE_WRAP_R                      0x8072
+#define GL_MAX_3D_TEXTURE_SIZE                 0x8073
+#define GL_TEXTURE_BINDING_3D                  0x806A
+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);
+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);
+extern void (GLAPIENTRY *qglCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+extern int gl_texturecubemap;
+#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
+#define GL_NORMAL_MAP_ARB                          0x8511
+#define GL_REFLECTION_MAP_ARB              0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB                    0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB            0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB     0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB     0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB     0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB     0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB     0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB     0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB      0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB               0x851C
+#endif
+
+extern int gl_dot3arb;
+#ifndef GL_DOT3_RGB_ARB
+#define GL_DOT3_RGB_ARB                                0x86AE
+#define GL_DOT3_RGBA_ARB                               0x86AF
+#endif
+
+/*
+// uncomment if this is actually needed by anyone
+extern int gl_dot3ext;
+#ifndef GL_DOT3_RGB_EXT
+#define GL_DOT3_RGB_EXT                                0x8740
+#define GL_DOT3_RGBA_EXT                       0x8741
+#endif
+*/
+
+#ifndef GL_SCISSOR_TEST
+#define GL_SCISSOR_TEST                                0x0C11
+#define GL_SCISSOR_BOX                         0x0C10
+#endif
+
+// GL_SGIS_texture_edge_clamp or GL_EXT_texture_edge_clamp
+extern int gl_support_clamptoedge;
+#ifndef GL_CLAMP_TO_EDGE
+#define GL_CLAMP_TO_EDGE 0x812F
+#endif
+
+//GL_NV_vertex_array_range
+extern GLvoid *(GLAPIENTRY *qglAllocateMemoryNV)(GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
+extern GLvoid (GLAPIENTRY *qglFreeMemoryNV)(GLvoid *pointer);
+extern GLvoid (GLAPIENTRY *qglVertexArrayRangeNV)(GLsizei length, GLvoid *pointer);
+extern GLvoid (GLAPIENTRY *qglFlushVertexArrayRangeNV)(GLvoid);
+#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
+extern int gl_support_var;
+
+//GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+extern int gl_support_var2;
+
+//GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT        0x8911
+extern void (GLAPIENTRY *qglActiveStencilFaceEXT)(GLenum);
+extern int gl_support_stenciltwoside;
+
+extern void (GLAPIENTRY *qglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
 
 extern void (GLAPIENTRY *qglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
 
 extern void (GLAPIENTRY *qglClear)(GLbitfield mask);
 
-//extern void (GLAPIENTRY *qglAlphaFunc)(GLenum func, GLclampf ref);
+extern void (GLAPIENTRY *qglAlphaFunc)(GLenum func, GLclampf ref);
 extern void (GLAPIENTRY *qglBlendFunc)(GLenum sfactor, GLenum dfactor);
 extern void (GLAPIENTRY *qglCullFace)(GLenum mode);
 
@@ -299,7 +409,7 @@ extern void (GLAPIENTRY *qglDrawBuffer)(GLenum mode);
 extern void (GLAPIENTRY *qglReadBuffer)(GLenum mode);
 extern void (GLAPIENTRY *qglEnable)(GLenum cap);
 extern void (GLAPIENTRY *qglDisable)(GLenum cap);
-//extern GLboolean GLAPIENTRY *qglIsEnabled)(GLenum cap);
+extern GLboolean (GLAPIENTRY *qglIsEnabled)(GLenum cap);
 
 extern void (GLAPIENTRY *qglEnableClientState)(GLenum cap);
 extern void (GLAPIENTRY *qglDisableClientState)(GLenum cap);
@@ -323,13 +433,14 @@ extern void (GLAPIENTRY *qglColorMask)(GLboolean red, GLboolean green, GLboolean
 extern void (GLAPIENTRY *qglDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
 extern void (GLAPIENTRY *qglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
 extern void (GLAPIENTRY *qglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
-//extern void (GLAPIENTRY *qglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr);
+extern void (GLAPIENTRY *qglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr);
 extern void (GLAPIENTRY *qglColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
 extern void (GLAPIENTRY *qglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
 extern void (GLAPIENTRY *qglArrayElement)(GLint i);
 
 extern void (GLAPIENTRY *qglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
 extern void (GLAPIENTRY *qglTexCoord2f)(GLfloat s, GLfloat t);
+extern void (GLAPIENTRY *qglTexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
 extern void (GLAPIENTRY *qglVertex2f)(GLfloat x, GLfloat y);
 extern void (GLAPIENTRY *qglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
 extern void (GLAPIENTRY *qglBegin)(GLenum mode);
@@ -339,18 +450,18 @@ extern void (GLAPIENTRY *qglMatrixMode)(GLenum mode);
 extern void (GLAPIENTRY *qglOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
 extern void (GLAPIENTRY *qglFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
 extern void (GLAPIENTRY *qglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
-//extern void (GLAPIENTRY *qglPushMatrix)(void);
-//extern void (GLAPIENTRY *qglPopMatrix)(void);
+extern void (GLAPIENTRY *qglPushMatrix)(void);
+extern void (GLAPIENTRY *qglPopMatrix)(void);
 extern void (GLAPIENTRY *qglLoadIdentity)(void);
 extern void (GLAPIENTRY *qglLoadMatrixd)(const GLdouble *m);
 extern void (GLAPIENTRY *qglLoadMatrixf)(const GLfloat *m);
-//extern void (GLAPIENTRY *qglMultMatrixd)(const GLdouble *m);
-//extern void (GLAPIENTRY *qglMultMatrixf)(const GLfloat *m);
-//extern void (GLAPIENTRY *qglRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+extern void (GLAPIENTRY *qglMultMatrixd)(const GLdouble *m);
+extern void (GLAPIENTRY *qglMultMatrixf)(const GLfloat *m);
+extern void (GLAPIENTRY *qglRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
 extern void (GLAPIENTRY *qglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-//extern void (GLAPIENTRY *qglScaled)(GLdouble x, GLdouble y, GLdouble z);
-//extern void (GLAPIENTRY *qglScalef)(GLfloat x, GLfloat y, GLfloat z);
-//extern void (GLAPIENTRY *qglTranslated)(GLdouble x, GLdouble y, GLdouble z);
+extern void (GLAPIENTRY *qglScaled)(GLdouble x, GLdouble y, GLdouble z);
+extern void (GLAPIENTRY *qglScalef)(GLfloat x, GLfloat y, GLfloat z);
+extern void (GLAPIENTRY *qglTranslated)(GLdouble x, GLdouble y, GLdouble z);
 extern void (GLAPIENTRY *qglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
 
 extern void (GLAPIENTRY *qglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
@@ -360,19 +471,33 @@ extern void (GLAPIENTRY *qglStencilMask)(GLuint mask);
 extern void (GLAPIENTRY *qglStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
 extern void (GLAPIENTRY *qglClearStencil)(GLint s);
 
-//extern void (GLAPIENTRY *qglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
+extern void (GLAPIENTRY *qglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
+extern void (GLAPIENTRY *qglTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
 extern void (GLAPIENTRY *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
-
-//extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+extern void (GLAPIENTRY *qglTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
 extern void (GLAPIENTRY *qglTexParameteri)(GLenum target, GLenum pname, GLint param);
 
-extern void (GLAPIENTRY *qglBindTexture)(GLenum target, GLuint texture);
-extern void (GLAPIENTRY *qglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
-extern void (GLAPIENTRY *qglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+extern void (GLAPIENTRY *qglGenTextures)(GLsizei n, GLuint *textures);
 extern void (GLAPIENTRY *qglDeleteTextures)(GLsizei n, const GLuint *textures);
+extern void (GLAPIENTRY *qglBindTexture)(GLenum target, GLuint texture);
+//extern void (GLAPIENTRY *qglPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
+//extern GLboolean (GLAPIENTRY *qglAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
+extern GLboolean (GLAPIENTRY *qglIsTexture)(GLuint texture);
 extern void (GLAPIENTRY *qglPixelStoref)(GLenum pname, GLfloat param);
 extern void (GLAPIENTRY *qglPixelStorei)(GLenum pname, GLint param);
 
+extern void (GLAPIENTRY *qglTexImage1D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+extern void (GLAPIENTRY *qglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+extern void (GLAPIENTRY *qglTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+extern void (GLAPIENTRY *qglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+extern void (GLAPIENTRY *qglCopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+extern void (GLAPIENTRY *qglCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+extern void (GLAPIENTRY *qglCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+extern void (GLAPIENTRY *qglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern void (GLAPIENTRY *qglPolygonOffset)(GLfloat factor, GLfloat units);
+
 #if WIN32
 extern int (WINAPI *qwglChoosePixelFormat)(HDC, CONST PIXELFORMATDESCRIPTOR *);
 extern int (WINAPI *qwglDescribePixelFormat)(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
@@ -386,10 +511,182 @@ extern BOOL (WINAPI *qwglMakeCurrent)(HDC, HGLRC);
 extern BOOL (WINAPI *qwglSwapIntervalEXT)(int interval);
 #endif
 
+#ifndef GL_PROGRAM_OBJECT_ARB
+// 1-byte character string
+typedef char GLcharARB;
+// 4-byte integer handle to a shader object or program object
+typedef int GLhandleARB;
+#endif
+
+extern void (GLAPIENTRY *qglDeleteObjectARB)(GLhandleARB obj);
+extern GLhandleARB (GLAPIENTRY *qglGetHandleARB)(GLenum pname);
+extern void (GLAPIENTRY *qglDetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj);
+extern GLhandleARB (GLAPIENTRY *qglCreateShaderObjectARB)(GLenum shaderType);
+extern void (GLAPIENTRY *qglShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length);
+extern void (GLAPIENTRY *qglCompileShaderARB)(GLhandleARB shaderObj);
+extern GLhandleARB (GLAPIENTRY *qglCreateProgramObjectARB)(void);
+extern void (GLAPIENTRY *qglAttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj);
+extern void (GLAPIENTRY *qglLinkProgramARB)(GLhandleARB programObj);
+extern void (GLAPIENTRY *qglUseProgramObjectARB)(GLhandleARB programObj);
+extern void (GLAPIENTRY *qglValidateProgramARB)(GLhandleARB programObj);
+extern void (GLAPIENTRY *qglUniform1fARB)(GLint location, GLfloat v0);
+extern void (GLAPIENTRY *qglUniform2fARB)(GLint location, GLfloat v0, GLfloat v1);
+extern void (GLAPIENTRY *qglUniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+extern void (GLAPIENTRY *qglUniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+extern void (GLAPIENTRY *qglUniform1iARB)(GLint location, GLint v0);
+extern void (GLAPIENTRY *qglUniform2iARB)(GLint location, GLint v0, GLint v1);
+extern void (GLAPIENTRY *qglUniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2);
+extern void (GLAPIENTRY *qglUniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+extern void (GLAPIENTRY *qglUniform1fvARB)(GLint location, GLsizei count, const GLfloat *value);
+extern void (GLAPIENTRY *qglUniform2fvARB)(GLint location, GLsizei count, const GLfloat *value);
+extern void (GLAPIENTRY *qglUniform3fvARB)(GLint location, GLsizei count, const GLfloat *value);
+extern void (GLAPIENTRY *qglUniform4fvARB)(GLint location, GLsizei count, const GLfloat *value);
+extern void (GLAPIENTRY *qglUniform1ivARB)(GLint location, GLsizei count, const GLint *value);
+extern void (GLAPIENTRY *qglUniform2ivARB)(GLint location, GLsizei count, const GLint *value);
+extern void (GLAPIENTRY *qglUniform3ivARB)(GLint location, GLsizei count, const GLint *value);
+extern void (GLAPIENTRY *qglUniform4ivARB)(GLint location, GLsizei count, const GLint *value);
+extern void (GLAPIENTRY *qglUniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (GLAPIENTRY *qglUniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (GLAPIENTRY *qglUniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (GLAPIENTRY *qglGetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat *params);
+extern void (GLAPIENTRY *qglGetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint *params);
+extern void (GLAPIENTRY *qglGetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+extern void (GLAPIENTRY *qglGetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+extern GLint (GLAPIENTRY *qglGetUniformLocationARB)(GLhandleARB programObj, const GLcharARB *name);
+extern void (GLAPIENTRY *qglGetActiveUniformARB)(GLhandleARB programObj, uint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+extern void (GLAPIENTRY *qglGetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat *params);
+extern void (GLAPIENTRY *qglGetUniformivARB)(GLhandleARB programObj, GLint location, GLint *params);
+extern void (GLAPIENTRY *qglGetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#ifndef GL_PROGRAM_OBJECT_ARB
+#define GL_PROGRAM_OBJECT_ARB                                  0x8B40
+#define GL_OBJECT_TYPE_ARB                                             0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB                                  0x8B4F
+#define GL_OBJECT_DELETE_STATUS_ARB                            0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB                   0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB                              0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB                  0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB                  0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB                 0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB                  0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB        0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB             0x8B88
+#define GL_SHADER_OBJECT_ARB                                   0x8B48
+#define GL_FLOAT                                                               0x1406
+#define GL_FLOAT_VEC2_ARB                                              0x8B50
+#define GL_FLOAT_VEC3_ARB                                              0x8B51
+#define GL_FLOAT_VEC4_ARB                                              0x8B52
+#define GL_INT                                                                 0x1404
+#define GL_INT_VEC2_ARB                                                        0x8B53
+#define GL_INT_VEC3_ARB                                                        0x8B54
+#define GL_INT_VEC4_ARB                                                        0x8B55
+#define GL_BOOL_ARB                                                            0x8B56
+#define GL_BOOL_VEC2_ARB                                               0x8B57
+#define GL_BOOL_VEC3_ARB                                               0x8B58
+#define GL_BOOL_VEC4_ARB                                               0x8B59
+#define GL_FLOAT_MAT2_ARB                                              0x8B5A
+#define GL_FLOAT_MAT3_ARB                                              0x8B5B
+#define GL_FLOAT_MAT4_ARB                                              0x8B5C
+#define GL_SAMPLER_1D_ARB                                              0x8B5D
+#define GL_SAMPLER_2D_ARB                                              0x8B5E
+#define GL_SAMPLER_3D_ARB                                              0x8B5F
+#define GL_SAMPLER_CUBE_ARB                                            0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB                               0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB                               0x8B62
+#define GL_SAMPLER_2D_RECT_ARB                                 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB                  0x8B64
+#endif
+
+//extern void (GLAPIENTRY *qglVertexAttrib1fARB)(GLuint index, GLfloat v0);
+//extern void (GLAPIENTRY *qglVertexAttrib1sARB)(GLuint index, GLshort v0);
+//extern void (GLAPIENTRY *qglVertexAttrib1dARB)(GLuint index, GLdouble v0);
+//extern void (GLAPIENTRY *qglVertexAttrib2fARB)(GLuint index, GLfloat v0, GLfloat v1);
+//extern void (GLAPIENTRY *qglVertexAttrib2sARB)(GLuint index, GLshort v0, GLshort v1);
+//extern void (GLAPIENTRY *qglVertexAttrib2dARB)(GLuint index, GLdouble v0, GLdouble v1);
+//extern void (GLAPIENTRY *qglVertexAttrib3fARB)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2);
+//extern void (GLAPIENTRY *qglVertexAttrib3sARB)(GLuint index, GLshort v0, GLshort v1, GLshort v2);
+//extern void (GLAPIENTRY *qglVertexAttrib3dARB)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2);
+//extern void (GLAPIENTRY *qglVertexAttrib4fARB)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+//extern void (GLAPIENTRY *qglVertexAttrib4sARB)(GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3);
+//extern void (GLAPIENTRY *qglVertexAttrib4dARB)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+//extern void (GLAPIENTRY *qglVertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+//extern void (GLAPIENTRY *qglVertexAttrib1fvARB)(GLuint index, const GLfloat *v);
+//extern void (GLAPIENTRY *qglVertexAttrib1svARB)(GLuint index, const GLshort *v);
+//extern void (GLAPIENTRY *qglVertexAttrib1dvARB)(GLuint index, const GLdouble *v);
+//extern void (GLAPIENTRY *qglVertexAttrib2fvARB)(GLuint index, const GLfloat *v);
+//extern void (GLAPIENTRY *qglVertexAttrib2svARB)(GLuint index, const GLshort *v);
+//extern void (GLAPIENTRY *qglVertexAttrib2dvARB)(GLuint index, const GLdouble *v);
+//extern void (GLAPIENTRY *qglVertexAttrib3fvARB)(GLuint index, const GLfloat *v);
+//extern void (GLAPIENTRY *qglVertexAttrib3svARB)(GLuint index, const GLshort *v);
+//extern void (GLAPIENTRY *qglVertexAttrib3dvARB)(GLuint index, const GLdouble *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4fvARB)(GLuint index, const GLfloat *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4svARB)(GLuint index, const GLshort *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4dvARB)(GLuint index, const GLdouble *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4ivARB)(GLuint index, const GLint *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4bvARB)(GLuint index, const GLbyte *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4ubvARB)(GLuint index, const GLubyte *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4usvARB)(GLuint index, const GLushort *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4uivARB)(GLuint index, const GLuint *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4NbvARB)(GLuint index, const GLbyte *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4NsvARB)(GLuint index, const GLshort *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4NivARB)(GLuint index, const GLint *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4NubvARB)(GLuint index, const GLubyte *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4NusvARB)(GLuint index, const GLushort *v);
+//extern void (GLAPIENTRY *qglVertexAttrib4NuivARB)(GLuint index, const GLuint *v);
+extern void (GLAPIENTRY *qglVertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+extern void (GLAPIENTRY *qglEnableVertexAttribArrayARB)(GLuint index);
+extern void (GLAPIENTRY *qglDisableVertexAttribArrayARB)(GLuint index);
+extern void (GLAPIENTRY *qglBindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB *name);
+extern void (GLAPIENTRY *qglGetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+extern GLint (GLAPIENTRY *qglGetAttribLocationARB)(GLhandleARB programObj, const GLcharARB *name);
+//extern void (GLAPIENTRY *qglGetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params);
+//extern void (GLAPIENTRY *qglGetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params);
+//extern void (GLAPIENTRY *qglGetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params);
+//extern void (GLAPIENTRY *qglGetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer);
+#ifndef GL_VERTEX_SHADER_ARB
+#define GL_VERTEX_SHADER_ARB                                           0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB           0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB                                      0x8B4B
+#define GL_MAX_VERTEX_ATTRIBS_ARB                                      0x8869
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB                         0x8872
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB          0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB                0x8B4D
+#define GL_MAX_TEXTURE_COORDS_ARB                                      0x8871
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB                       0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB                         0x8643
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB                                0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB      0x8B8A
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB                     0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB                                0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB                      0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB                                0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB          0x886A
+#define GL_CURRENT_VERTEX_ATTRIB_ARB                           0x8626
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB                     0x8645
+#define GL_FLOAT                                                                       0x1406
+#define GL_FLOAT_VEC2_ARB                                                      0x8B50
+#define GL_FLOAT_VEC3_ARB                                                      0x8B51
+#define GL_FLOAT_VEC4_ARB                                                      0x8B52
+#define GL_FLOAT_MAT2_ARB                                                      0x8B5A
+#define GL_FLOAT_MAT3_ARB                                                      0x8B5B
+#define GL_FLOAT_MAT4_ARB                                                      0x8B5C
+#endif
+
+#ifndef GL_FRAGMENT_SHADER_ARB
+#define GL_FRAGMENT_SHADER_ARB                                         0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB         0x8B49
+#define GL_MAX_TEXTURE_COORDS_ARB                                      0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB                         0x8872
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB         0x8B8B
+#endif
+
+#ifndef GL_SHADING_LANGUAGE_VERSION_ARB
+#define GL_SHADING_LANGUAGE_VERSION_ARB                                0x8B8C
+#endif
+
 #define DEBUGGL
 
 #ifdef DEBUGGL
-#define CHECKGLERROR if ((errornumber = qglGetError())) GL_PrintError(errornumber, __FILE__, __LINE__);
+#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__);}
 extern int errornumber;
 void GL_PrintError(int errornumber, char *filename, int linenumber);
 #else