]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - glquake.h
DP code cleanup, stage one - all headers that can be protected by ifdef
[xonotic/darkplaces.git] / glquake.h
index 40b440635e576e5ec99d4770c43d72d615ca77fd..3a0dfff2e726bd9ac13051c54f6f46a1fa9a9576 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -17,12 +17,13 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
+
+#ifndef GLQUAKE_H
+#define GLQUAKE_H
+
 // disable data conversion warnings
 
 #ifdef _MSC_VER
-//#pragma warning(disable : 4244)     // MIPS
-//#pragma warning(disable : 4136)     // X86
-//#pragma warning(disable : 4051)     // ALPHA
 #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
@@ -35,25 +36,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #endif
 
 #include <GL/gl.h>
-//#include <GL/glu.h>
 
 extern qboolean isG200;
 extern qboolean isRagePro;
 
-extern void GL_BeginRendering (int *x, int *y, int *width, int *height);
-extern void GL_EndRendering (void);
-
-extern float   gldepthmin, gldepthmax;
+extern float gldepthmin, gldepthmax;
 
 //====================================================
 
-extern const char *gl_vendor;
-extern const char *gl_renderer;
-extern const char *gl_version;
-extern const char *gl_extensions;
+extern const char *gl_vendor;
+extern const char *gl_renderer;
+extern const char *gl_version;
+extern const char *gl_extensions;
 
-#ifndef _WIN32
-#define APIENTRY /* */
+// wgl uses APIENTRY
+#ifndef APIENTRY
+#define APIENTRY
 #endif
 
 // for platforms (wgl) that do not use GLAPIENTRY
@@ -136,17 +134,115 @@ extern int gl_combine_extension;
 #define GL_PREVIOUS_ARB                                        0x8578
 #endif
 
+#ifndef GL_MAX_ELEMENTS_VERTICES
+#define GL_MAX_ELEMENTS_VERTICES               0x80E8
+#endif
+#ifndef GL_MAX_ELEMENTS_INDICES
+#define GL_MAX_ELEMENTS_INDICES                        0x80E9
+#endif
+
 extern cvar_t gl_combine;
 
-#ifdef WIN32
-#else
-//#ifndef MESA
-//extern void (GLAPIENTRY *glColorTableEXT)(int, int, int, int, int, const void*);
-//#endif
+extern int gl_maxdrawrangeelementsvertices;
+extern int gl_maxdrawrangeelementsindices;
+
+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 *qglBlendFunc)(GLenum sfactor, GLenum dfactor);
+extern void (GLAPIENTRY *qglCullFace)(GLenum mode);
+
+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 void (GLAPIENTRY *qglEnableClientState)(GLenum cap);
+extern void (GLAPIENTRY *qglDisableClientState)(GLenum cap);
+
+//extern void (GLAPIENTRY *qglGetBooleanv)(GLenum pname, GLboolean *params);
+//extern void (GLAPIENTRY *qglGetDoublev)(GLenum pname, GLdouble *params);
+//extern void (GLAPIENTRY *qglGetFloatv)(GLenum pname, GLfloat *params);
+extern void (GLAPIENTRY *qglGetIntegerv)(GLenum pname, GLint *params);
 
+extern GLenum (GLAPIENTRY *qglGetError)(void);
+extern const GLubyte* (GLAPIENTRY *qglGetString)(GLenum name);
+extern void (GLAPIENTRY *qglFinish)(void);
+extern void (GLAPIENTRY *qglFlush)(void);
+
+extern void (GLAPIENTRY *qglClearDepth)(GLclampd depth);
+extern void (GLAPIENTRY *qglDepthFunc)(GLenum func);
+extern void (GLAPIENTRY *qglDepthMask)(GLboolean flag);
+extern void (GLAPIENTRY *qglDepthRange)(GLclampd near_val, GLclampd far_val);
+
+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 *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 *qglTexCoord2f)(GLfloat s, GLfloat t);
+extern void (GLAPIENTRY *qglVertex2f)(GLfloat x, GLfloat y);
+extern void (GLAPIENTRY *qglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
+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 *qglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
+//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 *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 *qglStencilFunc)(GLenum func, GLint ref, GLuint mask);
+//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 *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
+
+//extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+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 *qglDeleteTextures)(GLsizei n, const GLuint *textures);
+
+#if WIN32
+extern int (WINAPI *qwglChoosePixelFormat)(HDC, CONST PIXELFORMATDESCRIPTOR *);
+extern int (WINAPI *qwglDescribePixelFormat)(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
+//extern int (WINAPI *qwglGetPixelFormat)(HDC);
+extern BOOL (WINAPI *qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
+extern BOOL (WINAPI *qwglSwapBuffers)(HDC);
+extern HGLRC (WINAPI *qwglCreateContext)(HDC);
+extern BOOL (WINAPI *qwglDeleteContext)(HGLRC);
+extern PROC (WINAPI *qwglGetProcAddress)(LPCSTR);
+extern BOOL (WINAPI *qwglMakeCurrent)(HDC, HGLRC);
+extern BOOL (WINAPI *qwglSwapIntervalEXT)(int interval);
 #endif
 
-//#define DEBUGGL
+#define DEBUGGL
 
 #ifdef DEBUGGL
 #define CHECKGLERROR if ((errornumber = glGetError())) GL_PrintError(errornumber, __FILE__, __LINE__);
@@ -155,3 +251,6 @@ void GL_PrintError(int errornumber, char *filename, int linenumber);
 #else
 #define CHECKGLERROR
 #endif
+
+#endif
+