// disable data conversion warnings
#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 : 4244) // LordHavoc: MSVC++ 4 x86, double/float
+//#pragma warning(disable : 4305) // LordHavoc: MSVC++ 6 x86, double/float
+//#pragma warning(disable : 4706) // LordHavoc: MSVC++ 2008 x86, assignment within conditional expression
+//#pragma warning(disable : 4127) // LordHavoc: MSVC++ 2008 x86, conditional expression is constant
+//#pragma warning(disable : 4100) // LordHavoc: MSVC++ 2008 x86, unreferenced formal parameter
+//#pragma warning(disable : 4055) // LordHavoc: MSVC++ 2008 x86, 'type cast' from data pointer to function pointer
+//#pragma warning(disable : 4054) // LordHavoc: MSVC++ 2008 x86, 'type cast' from function pointer to data pointer
#endif
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_TEXTURE_BINDING_1D 0x8068
#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
#define GL_NEAREST 0x2600
#define GL_LINEAR 0x2601
#define GL_OUT_OF_MEMORY 0x0505
#define GL_DITHER 0x0BD0
+#define GL_ALPHA 0x1906
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_TEXTURE31_ARB 0x84DF
#endif
-// GL_EXT_compiled_vertex_array
-extern void (GLAPIENTRY *qglLockArraysEXT) (GLint first, GLint count);
-extern void (GLAPIENTRY *qglUnlockArraysEXT) (void);
-
// GL_ARB_texture_env_combine
#ifndef GL_COMBINE_ARB
#define GL_COMBINE_ARB 0x8570
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
#endif
-#ifndef GL_TEXTURE_RECTANGLE_ARB
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#endif
-
#ifndef GL_DEPTH_COMPONENT16_ARB
#define GL_DEPTH_COMPONENT16_ARB 0x81A5
#define GL_DEPTH_COMPONENT24_ARB 0x81A6
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 *qglDrawArrays)(GLenum mode, GLint first, GLsizei count);
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 *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 *qglColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
extern void (GLAPIENTRY *qglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
extern void (GLAPIENTRY *qglTexCoord1f)(GLfloat s);
extern void (GLAPIENTRY *qglTexCoord2f)(GLfloat s, GLfloat t);
extern void (GLAPIENTRY *qglTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
extern void (GLAPIENTRY *qglVertex2f)(GLfloat x, GLfloat y);
extern void (GLAPIENTRY *qglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
+extern void (GLAPIENTRY *qglVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
extern void (GLAPIENTRY *qglBegin)(GLenum mode);
extern void (GLAPIENTRY *qglEnd)(void);
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 *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 *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 *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 *qglTranslatef)(GLfloat x, GLfloat y, GLfloat 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 *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);
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 *qglGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+extern void (GLAPIENTRY *qglGetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
+extern void (GLAPIENTRY *qglGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+extern void (GLAPIENTRY *qglGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+extern void (GLAPIENTRY *qglGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
extern void (GLAPIENTRY *qglHint)(GLenum target, GLenum mode);
extern void (GLAPIENTRY *qglGenTextures)(GLsizei n, 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 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 *qglPolygonOffset)(GLfloat factor, GLfloat units);
extern void (GLAPIENTRY *qglPolygonMode)(GLenum face, GLenum mode);
-extern void (GLAPIENTRY *qglClipPlane)(GLenum plane, const GLdouble *equation);
-extern void (GLAPIENTRY *qglGetClipPlane)(GLenum plane, GLdouble *equation);
+//extern void (GLAPIENTRY *qglClipPlane)(GLenum plane, const GLdouble *equation);
+//extern void (GLAPIENTRY *qglGetClipPlane)(GLenum plane, GLdouble *equation);
//[515]: added on 29.07.2005
extern void (GLAPIENTRY *qglLineWidth)(GLfloat width);
#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
#endif
+// GL_EXT_texture_compression_s3tc
+#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
// GL_ARB_occlusion_query
extern void (GLAPIENTRY *qglGenQueriesARB)(GLsizei n, GLuint *ids);
extern void (GLAPIENTRY *qglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
#define DEBUGGL
#ifdef DEBUGGL
-#define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);errornumber = qglGetError();if (errornumber) GL_PrintError(errornumber, __FILE__, __LINE__);}}
+#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__);}}
extern int errornumber;
-void GL_PrintError(int errornumber, char *filename, int linenumber);
+void GL_PrintError(int errornumber, const char *filename, int linenumber);
#else
#define CHECKGLERROR
#endif