/*=============================================================================
    Name    : gldll.h
    Purpose : alternative to linking against OpenGL32.dll

    Created 12/14/1998 by khent
    Copyright Relic Entertainment, Inc.  All rights reserved.
=============================================================================*/

#ifndef _GLDLL_H
#define _GLDLL_H

typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef signed char GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef float GLfloat;
typedef float GLclampf;
typedef double GLdouble;
typedef double GLclampd;
typedef void GLvoid;

typedef void (*WGLPROC)();

#include "gldefines.h"

typedef void (__stdcall * LOCKARRAYSEXTproc)(GLint, GLint);
typedef void (__stdcall * UNLOCKARRAYSEXTproc)(void);

typedef void (__stdcall * ALPHAFUNCproc)(GLenum, GLclampf);
typedef void (__stdcall * BEGINproc)(GLenum);
typedef void (__stdcall * BINDTEXTUREproc)(GLenum, GLuint);
typedef void (__stdcall * BITMAPproc)(GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat, GLubyte const*);
typedef void (__stdcall * BLENDFUNCproc)(GLenum, GLenum);
typedef void (__stdcall * CLEARproc)(GLbitfield);
typedef void (__stdcall * CLEARCOLORproc)(GLclampf, GLclampf, GLclampf, GLclampf);
typedef void (__stdcall * CLEARDEPTHproc)(GLclampd);
typedef void (__stdcall * CLEARINDEXproc)(GLfloat);
typedef void (__stdcall * COLOR3Fproc)(GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * COLOR3UBproc)(GLubyte, GLubyte, GLubyte);
typedef void (__stdcall * COLOR4Fproc)(GLfloat, GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * COLOR4UBproc)(GLubyte, GLubyte, GLubyte, GLubyte);
typedef void (__stdcall * COLORMASKproc)(GLboolean, GLboolean, GLboolean, GLboolean);
typedef void (__stdcall * COLORTABLEproc)(GLenum, GLenum, GLsizei, GLenum, GLenum, GLvoid const*);
typedef void (__stdcall * CULLFACEproc)(GLenum);
typedef void (__stdcall * DELETETEXTURESproc)(GLsizei, GLuint const*);
typedef void (__stdcall * DEPTHFUNCproc)(GLenum);
typedef void (__stdcall * DEPTHMASKproc)(GLboolean);
typedef void (__stdcall * DEPTHRANGEproc)(GLclampd, GLclampd);
typedef void (__stdcall * DISABLEproc)(GLenum);
typedef void (__stdcall * DRAWARRAYSproc)(GLenum, GLint, GLsizei);
typedef void (__stdcall * DRAWELEMENTSproc)(GLenum, GLsizei, GLenum, GLvoid const*);
typedef void (__stdcall * DRAWBUFFERproc)(GLenum);
typedef void (__stdcall * DRAWPIXELSproc)(GLsizei, GLsizei, GLenum, GLenum, GLvoid const*);
typedef void (__stdcall * ENABLEproc)(GLenum);
typedef void (__stdcall * ENDproc)(void);
typedef void (__stdcall * EVALCOORD1Fproc)(GLfloat);
typedef void (__stdcall * EVALCOORD2Fproc)(GLfloat, GLfloat);
typedef void (__stdcall * EVALMESH1proc)(GLenum, GLint, GLint);
typedef void (__stdcall * EVALMESH2proc)(GLenum, GLint, GLint, GLint, GLint);
typedef void (__stdcall * EVALPOINT1proc)(GLint);
typedef void (__stdcall * EVALPOINT2proc)(GLint, GLint);
typedef void (__stdcall * FLUSHproc)(void);
typedef void (__stdcall * FOGFproc)(GLenum, GLfloat);
typedef void (__stdcall * FOGFVproc)(GLenum, GLfloat const*);
typedef void (__stdcall * FOGIproc)(GLenum, GLint);
typedef void (__stdcall * FRUSTUMproc)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
typedef void (__stdcall * GENTEXTURESproc)(GLsizei, GLuint*);
typedef void (__stdcall * GETDOUBLEVproc)(GLenum, GLdouble*);
typedef GLenum (__stdcall * GETERRORproc)(void);
typedef void (__stdcall * GETFLOATVproc)(GLenum, GLfloat*);
typedef void (__stdcall * GETINTEGERVproc)(GLenum, GLint*);
typedef void (__stdcall * GETBOOLEANVproc)(GLenum, GLboolean*);
typedef GLubyte const* (__stdcall * GETSTRINGproc)(GLenum);
typedef void (__stdcall * GETTEXLEVELPARAMETERIVproc)(GLenum, GLint, GLenum, GLint*);
typedef void (__stdcall * HINTproc)(GLenum, GLenum);
typedef void (__stdcall * INTERLEAVEDARRAYSproc)(GLenum, GLsizei, GLvoid const*);
typedef GLboolean (__stdcall * ISENABLEDproc)(GLenum);
typedef void (__stdcall * LIGHTMODELFproc)(GLenum, GLfloat);
typedef void (__stdcall * LIGHTMODELFVproc)(GLenum, GLfloat const*);
typedef void (__stdcall * LIGHTMODELIproc)(GLenum, GLint);
typedef void (__stdcall * LIGHTFVproc)(GLenum, GLenum, GLfloat const*);
typedef void (__stdcall * LINESTIPPLEproc)(GLint, GLushort);
typedef void (__stdcall * LINEWIDTHproc)(GLfloat);
typedef void (__stdcall * LOADIDENTITYproc)(void);
typedef void (__stdcall * LOADMATRIXFproc)(GLfloat const*);
typedef void (__stdcall * MAP1Fproc)(GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat const*);
typedef void (__stdcall * MAP2Fproc)(GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat const*);
typedef void (__stdcall * MAPGRID1Fproc)(GLint, GLfloat, GLfloat);
typedef void (__stdcall * MAPGRID2Dproc)(GLint, GLdouble, GLdouble, GLint, GLdouble, GLdouble);
typedef void (__stdcall * MATERIALFVproc)(GLenum, GLenum, GLfloat const*);
typedef void (__stdcall * MATRIXMODEproc)(GLenum);
typedef void (__stdcall * MULTMATRIXDproc)(GLdouble const*);
typedef void (__stdcall * MULTMATRIXFproc)(GLfloat const*);
typedef void (__stdcall * NORMAL3Fproc)(GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * NORMAL3FVproc)(GLfloat*);
typedef void (__stdcall * ORTHOproc)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
typedef void (__stdcall * PIXELSTOREIproc)(GLenum, GLint);
typedef void (__stdcall * PIXELTRANSFERFproc)(GLenum, GLfloat);
typedef void (__stdcall * POINTSIZEproc)(GLfloat);
typedef void (__stdcall * POLYGONMODEproc)(GLenum, GLenum);
typedef void (__stdcall * POPATTRIBproc)(void);
typedef void (__stdcall * POPMATRIXproc)(void);
typedef void (__stdcall * PUSHATTRIBproc)(GLbitfield);
typedef void (__stdcall * PUSHMATRIXproc)(void);
typedef void (__stdcall * RASTERPOS2Fproc)(GLfloat, GLfloat);
typedef void (__stdcall * RASTERPOS2Iproc)(GLint, GLint);
typedef void (__stdcall * RASTERPOS4Fproc)(GLfloat, GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * READBUFFERproc)(GLenum);
typedef void (__stdcall * READPIXELSproc)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
typedef void (__stdcall * ROTATEFproc)(GLfloat, GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * SCALEFproc)(GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * SCISSORproc)(GLint, GLint, GLsizei, GLsizei);
typedef void (__stdcall * SHADEMODELproc)(GLenum);
typedef void (__stdcall * TEXCOORD2Fproc)(GLfloat, GLfloat);
typedef void (__stdcall * TEXENVIproc)(GLenum, GLenum, GLint);
typedef void (__stdcall * TEXIMAGE1Dproc)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, GLvoid const*);
typedef void (__stdcall * TEXIMAGE2Dproc)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, GLvoid const*);
typedef void (__stdcall * TEXPARAMETERIproc)(GLenum, GLenum, GLint);
typedef void (__stdcall * TRANSLATEDproc)(GLdouble, GLdouble, GLdouble);
typedef void (__stdcall * TRANSLATEFproc)(GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * VERTEX2Fproc)(GLfloat, GLfloat);
typedef void (__stdcall * VERTEX2Iproc)(GLint, GLint);
typedef void (__stdcall * VERTEX3Fproc)(GLfloat, GLfloat, GLfloat);
typedef void (__stdcall * VERTEX3FVproc)(GLfloat const*);
typedef void (__stdcall * VERTEX4FVproc)(GLfloat const*);
typedef void (__stdcall * VIEWPORTproc)(GLint, GLint, GLsizei, GLsizei);
typedef void (__stdcall * CLIPPLANEproc)(GLenum, GLdouble const*);
typedef void (__stdcall * GETTEXIMAGEproc)(GLenum, GLint, GLenum, GLenum, GLvoid*);
typedef void (__stdcall * VERTEXPOINTERproc)(GLint, GLenum, GLsizei, GLvoid const*);
typedef void (__stdcall * ENABLECLIENTSTATEproc)(GLenum);
typedef void (__stdcall * DISABLECLIENTSTATEproc)(GLenum);
typedef void (__stdcall * ARRAYELEMENTproc)(GLint);
typedef unsigned int (__stdcall * WCREATECONTEXTproc)(int);
typedef unsigned int (__stdcall * WDELETECONTEXTproc)(int);
typedef WGLPROC (__stdcall * WGETPROCADDRESSproc)(char*);
typedef unsigned int (__stdcall * WMAKECURRENTproc)(int, int);
typedef int (__stdcall * WCHOOSEPIXELFORMATproc)(HDC, PIXELFORMATDESCRIPTOR const*);
typedef BOOL (__stdcall * WSETPIXELFORMATproc)(HDC, int, PIXELFORMATDESCRIPTOR const*);
typedef int (__stdcall * WGETPIXELFORMATproc)(HDC);
typedef int (__stdcall * WDESCRIBEPIXELFORMATproc)(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
typedef BOOL (__stdcall * WSWAPBUFFERSproc)(HDC);

extern LOCKARRAYSEXTproc glLockArraysEXT;
extern UNLOCKARRAYSEXTproc glUnlockArraysEXT;

extern ALPHAFUNCproc glAlphaFunc;
extern BEGINproc glBegin;
extern BINDTEXTUREproc glBindTexture;
extern BITMAPproc glBitmap;
extern BLENDFUNCproc glBlendFunc;
extern CLEARproc glClear;
extern CLEARCOLORproc glClearColor;
extern CLEARDEPTHproc glClearDepth;
extern CLEARINDEXproc glClearIndex;
extern COLOR3Fproc glColor3f;
extern COLOR3UBproc glColor3ub;
extern COLOR4Fproc glColor4f;
extern COLOR4UBproc glColor4ub;
extern COLORMASKproc glColorMask;
extern COLORTABLEproc glColorTable;
extern CULLFACEproc glCullFace;
extern DELETETEXTURESproc glDeleteTextures;
extern DEPTHFUNCproc glDepthFunc;
extern DEPTHMASKproc glDepthMask;
extern DEPTHRANGEproc glDepthRange;
extern DISABLEproc glDisable;
extern DRAWARRAYSproc glDrawArrays;
extern DRAWELEMENTSproc glDrawElements;
extern DRAWBUFFERproc glDrawBuffer;
extern DRAWPIXELSproc glDrawPixels;
extern ENABLEproc glEnable;
extern ENDproc glEnd;
extern EVALCOORD1Fproc glEvalCoord1f;
extern EVALCOORD2Fproc glEvalCoord2f;
extern EVALMESH1proc glEvalMesh1;
extern EVALMESH2proc glEvalMesh2;
extern EVALPOINT1proc glEvalPoint1;
extern EVALPOINT2proc glEvalPoint2;
extern FLUSHproc glFlush;
extern FOGFproc glFogf;
extern FOGFVproc glFogfv;
extern FOGIproc glFogi;
extern FRUSTUMproc glFrustum;
extern GENTEXTURESproc glGenTextures;
extern GETDOUBLEVproc glGetDoublev;
extern GETERRORproc glGetError;
extern GETFLOATVproc glGetFloatv;
extern GETINTEGERVproc glGetIntegerv;
extern GETBOOLEANVproc glGetBooleanv;
extern GETSTRINGproc glGetString;
extern GETTEXLEVELPARAMETERIVproc glGetTexLevelParameteriv;
extern HINTproc glHint;
extern INTERLEAVEDARRAYSproc glInterleavedArrays;
extern ISENABLEDproc glIsEnabled;
extern LIGHTMODELFproc glLightModelf;
extern LIGHTMODELFVproc glLightModelfv;
extern LIGHTMODELIproc glLightModeli;
extern LIGHTFVproc glLightfv;
extern LINESTIPPLEproc glLineStipple;
extern LINEWIDTHproc glLineWidth;
extern LOADIDENTITYproc glLoadIdentity;
extern LOADMATRIXFproc glLoadMatrixf;
extern MAP1Fproc glMap1f;
extern MAP2Fproc glMap2f;
extern MAPGRID1Fproc glMapGrid1f;
extern MAPGRID2Dproc glMapGrid2d;
extern MATERIALFVproc glMaterialfv;
extern MATRIXMODEproc glMatrixMode;
extern MULTMATRIXDproc glMultMatrixd;
extern MULTMATRIXFproc glMultMatrixf;
extern NORMAL3Fproc glNormal3f;
extern NORMAL3FVproc glNormal3fv;
extern ORTHOproc glOrtho;
extern PIXELSTOREIproc glPixelStorei;
extern PIXELTRANSFERFproc glPixelTransferf;
extern POINTSIZEproc glPointSize;
extern POLYGONMODEproc glPolygonMode;
extern POPATTRIBproc glPopAttrib;
extern POPMATRIXproc glPopMatrix;
extern PUSHATTRIBproc glPushAttrib;
extern PUSHMATRIXproc glPushMatrix;
extern RASTERPOS2Fproc glRasterPos2f;
extern RASTERPOS2Iproc glRasterPos2i;
extern RASTERPOS4Fproc glRasterPos4f;
extern READBUFFERproc glReadBuffer;
extern READPIXELSproc glReadPixels;
extern ROTATEFproc glRotatef;
extern SCALEFproc glScalef;
extern SCISSORproc glScissor;
extern SHADEMODELproc glShadeModel;
extern TEXCOORD2Fproc glTexCoord2f;
extern TEXENVIproc glTexEnvi;
extern TEXIMAGE1Dproc glTexImage1D;
extern TEXIMAGE2Dproc glTexImage2D;
extern TEXPARAMETERIproc glTexParameteri;
extern TRANSLATEDproc glTranslated;
extern TRANSLATEFproc glTranslatef;
extern VERTEX2Fproc glVertex2f;
extern VERTEX2Iproc glVertex2i;
extern VERTEX3Fproc glVertex3f;
extern VERTEX3FVproc glVertex3fv;
extern VERTEX4FVproc glVertex4fv;
extern VIEWPORTproc glViewport;
extern CLIPPLANEproc glClipPlane;
extern GETTEXIMAGEproc glGetTexImage;
extern VERTEXPOINTERproc glVertexPointer;
extern ENABLECLIENTSTATEproc glEnableClientState;
extern DISABLECLIENTSTATEproc glDisableClientState;
extern ARRAYELEMENTproc glArrayElement;

extern WCREATECONTEXTproc rwglCreateContext;
extern WDELETECONTEXTproc rwglDeleteContext;
extern WGETPROCADDRESSproc rwglGetProcAddress;
extern WMAKECURRENTproc rwglMakeCurrent;
extern WCHOOSEPIXELFORMATproc rwglChoosePixelFormat;
extern WSETPIXELFORMATproc rwglSetPixelFormat;
extern WGETPIXELFORMATproc rwglGetPixelFormat;
extern WDESCRIBEPIXELFORMATproc rwglDescribePixelFormat;
extern WSWAPBUFFERSproc rwglSwapBuffers;

extern GLboolean glDLL3Dfx;

GLboolean glDLLGetProcs(char* dllName);
void glDLLReset(void);
void glDLLGetGLCompat(void);

#endif
