adapt the q3a unix backend to c++ and JA

This commit is contained in:
Jonathan Gray 2013-04-24 00:00:38 +10:00
parent 0e3191e122
commit 4e402640e7
7 changed files with 604 additions and 747 deletions

View file

@ -24,15 +24,10 @@
#include <MesaGL/gl.h>
#elif defined( __linux__ )
#else
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/fxmesa.h>
#else
#include <gl.h>
#endif
@ -335,13 +330,6 @@ extern void ( APIENTRY * qglPointParameterivNV)( GLenum, const GLint *);
//===========================================================================
// non-windows systems will just redefine qgl* to gl*
#if !defined( _WIN32 ) && !defined( __linux__ )
#include "qgl_linked.h"
#else
// windows systems use a function pointer for each call so we can load minidrivers
extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
@ -708,17 +696,7 @@ extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval );
#endif // _WIN32
#if defined( __linux__ )
//FX Mesa Functions
extern fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]);
extern fxMesaContext (*qfxMesaCreateBestContext)(GLuint win, GLint width, GLint height, const GLint attribList[]);
extern void (*qfxMesaDestroyContext)(fxMesaContext ctx);
extern void (*qfxMesaMakeCurrent)(fxMesaContext ctx);
extern fxMesaContext (*qfxMesaGetCurrentContext)(void);
extern void (*qfxMesaSwapBuffers)(void);
#else
//GLX Functions
extern XVisualInfo * (*qglXChooseVisual)( Display *dpy, int screen, int *attribList );
@ -728,8 +706,6 @@ extern Bool (*qglXMakeCurrent)( Display *dpy, GLXDrawable drawable, GLXContext c
extern void (*qglXCopyContext)( Display *dpy, GLXContext src, GLXContext dst, GLuint mask );
extern void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable );
#endif // __linux__
#endif // _WIN32 && __linux__
#endif // _WIN32
#endif

View file

@ -32,15 +32,21 @@
#include "../client/client.h"
#include "unix_glw.h"
#include "unix_local.h"
#include <GL/glx.h>
#include <X11/keysym.h>
#include <X11/cursorfont.h>
#include <X11/extensions/xf86dga.h>
#include <X11/extensions/Xxf86dga.h>
#include <X11/extensions/xf86vmode.h>
void QGL_Shutdown( void );
int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen );
qboolean QGL_Init( const char *dllname );
void QGL_EnableLogging( qboolean enable );
typedef enum {
RSERR_OK,
@ -87,6 +93,8 @@ static int mouse_accel_numerator;
static int mouse_accel_denominator;
static int mouse_threshold;
bool g_bTextureRectangleHack = false;
/*****************************************************************************/
/* KEYBOARD */
/*****************************************************************************/
@ -105,103 +113,105 @@ static char *XLateKey(XKeyEvent *ev, int *key)
XLookupString(ev, buf, sizeof buf, &keysym, 0);
// ri.Printf( PRINT_ALL, "keysym=%04X\n", (int)keysym);
// VID_Printf( PRINT_ALL, "keysym=%04X\n", (int)keysym);
switch(keysym)
{
case XK_KP_Page_Up:
case XK_KP_9: *key = K_KP_PGUP; break;
case XK_Page_Up: *key = K_PGUP; break;
case XK_KP_9: *key = A_KP_9; break;
case XK_Page_Up: *key = A_PAGE_UP; break;
case XK_KP_Page_Down:
case XK_KP_3: *key = K_KP_PGDN; break;
case XK_Page_Down: *key = K_PGDN; break;
case XK_KP_3: *key = A_KP_3; break;
case XK_Page_Down: *key = A_PAGE_DOWN; break;
case XK_KP_Home: *key = K_KP_HOME; break;
case XK_KP_7: *key = K_KP_HOME; break;
case XK_Home: *key = K_HOME; break;
case XK_KP_Home:
case XK_KP_7: *key = A_KP_7; break;
case XK_Home: *key = A_HOME; break;
case XK_KP_End:
case XK_KP_1: *key = K_KP_END; break;
case XK_End: *key = K_END; break;
case XK_KP_1: *key = A_KP_1; break;
case XK_End: *key = A_END; break;
case XK_KP_Left: *key = K_KP_LEFTARROW; break;
case XK_KP_4: *key = K_KP_LEFTARROW; break;
case XK_Left: *key = K_LEFTARROW; break;
case XK_KP_Left:
case XK_KP_4: *key = A_KP_4; break;
case XK_Left: *key = A_CURSOR_LEFT; break;
case XK_KP_Right: *key = K_KP_RIGHTARROW; break;
case XK_KP_6: *key = K_KP_RIGHTARROW; break;
case XK_Right: *key = K_RIGHTARROW; break;
case XK_KP_Right:
case XK_KP_6: *key = A_KP_6; break;
case XK_Right: *key = A_CURSOR_RIGHT; break;
case XK_KP_Down:
case XK_KP_2: *key = K_KP_DOWNARROW; break;
case XK_Down: *key = K_DOWNARROW; break;
case XK_KP_2: *key = A_KP_2; break;
case XK_Down: *key = A_CURSOR_DOWN; break;
case XK_KP_Up:
case XK_KP_8: *key = K_KP_UPARROW; break;
case XK_Up: *key = K_UPARROW; break;
case XK_KP_8: *key = A_KP_8; break;
case XK_Up: *key = A_CURSOR_UP; break;
case XK_Escape: *key = K_ESCAPE; break;
case XK_Escape: *key = A_ESCAPE; break;
case XK_KP_Enter: *key = K_KP_ENTER; break;
case XK_Return: *key = K_ENTER; break;
case XK_KP_Enter: *key = A_KP_ENTER; break;
case XK_Return: *key = A_ENTER; break;
case XK_Tab: *key = K_TAB; break;
case XK_Tab: *key = A_TAB; break;
case XK_F1: *key = K_F1; break;
case XK_F1: *key = A_F1; break;
case XK_F2: *key = K_F2; break;
case XK_F2: *key = A_F2; break;
case XK_F3: *key = K_F3; break;
case XK_F3: *key = A_F3; break;
case XK_F4: *key = K_F4; break;
case XK_F4: *key = A_F4; break;
case XK_F5: *key = K_F5; break;
case XK_F5: *key = A_F5; break;
case XK_F6: *key = K_F6; break;
case XK_F6: *key = A_F6; break;
case XK_F7: *key = K_F7; break;
case XK_F7: *key = A_F7; break;
case XK_F8: *key = K_F8; break;
case XK_F8: *key = A_F8; break;
case XK_F9: *key = K_F9; break;
case XK_F9: *key = A_F9; break;
case XK_F10: *key = K_F10; break;
case XK_F10: *key = A_F10; break;
case XK_F11: *key = K_F11; break;
case XK_F11: *key = A_F11; break;
case XK_F12: *key = K_F12; break;
case XK_F12: *key = A_F12; break;
// case XK_BackSpace: *key = K_BACKSPACE; break;
// case XK_BackSpace: *key = A_BACKSPACE; break;
case XK_BackSpace: *key = 8; break; // ctrl-h
case XK_KP_Delete:
case XK_KP_Decimal: *key = K_KP_DEL; break;
case XK_Delete: *key = K_DEL; break;
case XK_KP_Decimal: *key = A_KP_PERIOD; break;
case XK_Delete: *key = A_DELETE; break;
case XK_Pause: *key = K_PAUSE; break;
case XK_Pause: *key = A_PAUSE; break;
case XK_Shift_L:
case XK_Shift_R: *key = K_SHIFT; break;
case XK_Shift_R: *key = A_SHIFT; break;
case XK_Execute:
case XK_Control_L:
case XK_Control_R: *key = K_CTRL; break;
case XK_Control_R: *key = A_CTRL; break;
case XK_Alt_L:
case XK_Meta_L:
case XK_Alt_R:
case XK_Meta_R: *key = K_ALT; break;
case XK_Meta_R: *key = A_ALT; break;
case XK_KP_Begin: *key = K_KP_5; break;
case XK_KP_Begin: *key = A_KP_5; break;
case XK_Insert: *key = K_INS; break;
case XK_Insert: *key = A_INSERT; break;
case XK_KP_Insert:
case XK_KP_0: *key = K_KP_INS; break;
case XK_KP_0: *key = A_KP_0; break;
case XK_KP_Multiply: *key = '*'; break;
case XK_KP_Add: *key = K_KP_PLUS; break;
case XK_KP_Subtract: *key = K_KP_MINUS; break;
case XK_KP_Divide: *key = K_KP_SLASH; break;
case XK_KP_Add: *key = A_KP_PLUS; break;
case XK_KP_Subtract: *key = A_KP_MINUS; break;
#if 0
case XK_KP_Divide: *key = A_KP_SLASH; break;
#endif
default:
*key = *(unsigned char *)buf;
@ -262,8 +272,8 @@ static void install_grabs(void)
if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) {
// unable to query, probalby not supported
ri.Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" );
ri.Cvar_Set( "in_dgamouse", "0" );
VID_Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" );
Cvar_Set( "in_dgamouse", "0" );
} else {
dgamouse = qtrue;
XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectMouse);
@ -339,7 +349,7 @@ static void HandleEvents(void)
key = XLateKey(&event.xkey);
Sys_QueEvent( 0, SE_KEY, key, event.type == KeyPress, 0, NULL );
if (key == K_SHIFT)
if (key == A_SHIFT)
shift_down = (event.type == KeyPress);
if (key < 128 && (event.type == KeyPress)) {
if (shift_down)
@ -360,11 +370,11 @@ static void HandleEvents(void)
my += event.xmotion.y_root * 2;
else
my += event.xmotion.y_root;
// ri.Printf(PRINT_ALL, "mouse (%d,%d) (root=%d,%d)\n", event.xmotion.x + win_x, event.xmotion.y + win_y, event.xmotion.x_root, event.xmotion.y_root);
// VID_Printf(PRINT_ALL, "mouse (%d,%d) (root=%d,%d)\n", event.xmotion.x + win_x, event.xmotion.y + win_y, event.xmotion.x_root, event.xmotion.y_root);
}
else
{
// ri.Printf(PRINT_ALL, "mouse x=%d,y=%d\n", (int)event.xmotion.x - mwx, (int)event.xmotion.y - mwy);
// VID_Printf(PRINT_ALL, "mouse x=%d,y=%d\n", (int)event.xmotion.x - mwx, (int)event.xmotion.y - mwy);
mx += ((int)event.xmotion.x - mwx);
my += ((int)event.xmotion.y - mwy);
mwx = event.xmotion.x;
@ -384,7 +394,7 @@ static void HandleEvents(void)
b = 2;
else if (event.xbutton.button == 3)
b = 1;
Sys_QueEvent( 0, SE_KEY, K_MOUSE1 + b, qtrue, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MOUSE1 + b, qtrue, 0, NULL );
break;
case ButtonRelease:
@ -395,7 +405,7 @@ static void HandleEvents(void)
b = 2;
else if (event.xbutton.button == 3)
b = 1;
Sys_QueEvent( 0, SE_KEY, K_MOUSE1 + b, qfalse, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MOUSE1 + b, qfalse, 0, NULL );
break;
case CreateNotify :
@ -544,21 +554,21 @@ static qboolean GLW_StartDriverAndSetMode( const char *drivername,
// don't ever bother going into fullscreen with a voodoo card
#if 1 // JDC: I reenabled this
if ( strstr( drivername, "Voodoo" ) ) {
ri.Cvar_Set( "r_fullscreen", "0" );
Cvar_Set( "r_fullscreen", "0" );
r_fullscreen->modified = qfalse;
fullscreen = qfalse;
}
#endif
err = GLW_SetMode( drivername, mode, fullscreen );
err = (rserr_t) GLW_SetMode( drivername, mode, fullscreen );
switch ( err )
{
case RSERR_INVALID_FULLSCREEN:
ri.Printf( PRINT_ALL, "...WARNING: fullscreen unavailable in this mode\n" );
VID_Printf( PRINT_ALL, "...WARNING: fullscreen unavailable in this mode\n" );
return qfalse;
case RSERR_INVALID_MODE:
ri.Printf( PRINT_ALL, "...WARNING: could not set the given mode (%d)\n", mode );
VID_Printf( PRINT_ALL, "...WARNING: could not set the given mode (%d)\n", mode );
return qfalse;
default:
break;
@ -597,18 +607,18 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
int actualWidth, actualHeight;
int i;
r_fakeFullscreen = ri.Cvar_Get( "r_fakeFullscreen", "0", CVAR_ARCHIVE);
r_fakeFullscreen = Cvar_Get( "r_fakeFullscreen", "0", CVAR_ARCHIVE);
ri.Printf( PRINT_ALL, "Initializing OpenGL display\n");
VID_Printf( PRINT_ALL, "Initializing OpenGL display\n");
ri.Printf (PRINT_ALL, "...setting mode %d:", mode );
VID_Printf (PRINT_ALL, "...setting mode %d:", mode );
if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, &glConfig.windowAspect, mode ) )
if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, mode ) )
{
ri.Printf( PRINT_ALL, " invalid mode\n" );
VID_Printf( PRINT_ALL, " invalid mode\n" );
return RSERR_INVALID_MODE;
}
ri.Printf( PRINT_ALL, " %d %d\n", glConfig.vidWidth, glConfig.vidHeight);
VID_Printf( PRINT_ALL, " %d %d\n", glConfig.vidWidth, glConfig.vidHeight);
if (!(dpy = XOpenDisplay(NULL))) {
fprintf(stderr, "Error couldn't open the X display\n");
@ -626,7 +636,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
if (!XF86VidModeQueryVersion(dpy, &MajorVersion, &MinorVersion)) {
vidmode_ext = qfalse;
} else {
ri.Printf(PRINT_ALL, "Using XFree86-VidModeExtension Version %d.%d\n",
VID_Printf(PRINT_ALL, "Using XFree86-VidModeExtension Version %d.%d\n",
MajorVersion, MinorVersion);
vidmode_ext = qtrue;
}
@ -676,9 +686,6 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
else
colorbits = r_colorbits->value;
if ( !Q_stricmp( r_glDriver->string, _3DFX_DRIVER_NAME ) )
colorbits = 16;
if (!r_depthbits->value)
depthbits = 24;
else
@ -750,7 +757,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
attrib[ATTR_STENCIL_IDX] = tstencilbits;
#if 0
ri.Printf( PRINT_DEVELOPER, "Attempting %d/%d/%d Color bits, %d depth, %d stencil display...",
VID_Printf( PRINT_DEVELOPER, "Attempting %d/%d/%d Color bits, %d depth, %d stencil display...",
attrib[ATTR_RED_IDX], attrib[ATTR_GREEN_IDX], attrib[ATTR_BLUE_IDX],
attrib[ATTR_DEPTH_IDX], attrib[ATTR_STENCIL_IDX]);
#endif
@ -758,16 +765,16 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
visinfo = qglXChooseVisual(dpy, scrnum, attrib);
if (!visinfo) {
#if 0
ri.Printf( PRINT_DEVELOPER, "failed\n");
VID_Printf( PRINT_DEVELOPER, "failed\n");
#endif
continue;
}
#if 0
ri.Printf( PRINT_DEVELOPER, "Successful\n");
VID_Printf( PRINT_DEVELOPER, "Successful\n");
#endif
ri.Printf( PRINT_ALL, "Using %d/%d/%d Color bits, %d depth, %d stencil display.\n",
VID_Printf( PRINT_ALL, "Using %d/%d/%d Color bits, %d depth, %d stencil display.\n",
attrib[ATTR_RED_IDX], attrib[ATTR_GREEN_IDX], attrib[ATTR_BLUE_IDX],
attrib[ATTR_DEPTH_IDX], attrib[ATTR_STENCIL_IDX]);
@ -778,7 +785,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
}
if (!visinfo) {
ri.Printf( PRINT_ALL, "Couldn't get a visual\n" );
VID_Printf( PRINT_ALL, "Couldn't get a visual\n" );
return RSERR_INVALID_MODE;
}
@ -809,10 +816,10 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
if (in_dgamouse->value) {
if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) {
// unable to query, probalby not supported
ri.Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" );
ri.Cvar_Set( "in_dgamouse", "0" );
VID_Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" );
Cvar_Set( "in_dgamouse", "0" );
} else
ri.Printf( PRINT_ALL, "XF86DGA Mouse (Version %d.%d) initialized\n",
VID_Printf( PRINT_ALL, "XF86DGA Mouse (Version %d.%d) initialized\n",
MajorVersion, MinorVersion);
}
@ -836,12 +843,12 @@ static void GLW_InitExtensions( void )
if ( r_ext_compressed_textures->value )
{
glConfig.textureCompression = TC_S3TC_DXT;
ri.Printf( PRINT_ALL, "...using GL_EXT_texture_compression_s3tc\n" );
VID_Printf( PRINT_ALL, "...using GL_EXT_texture_compression_s3tc\n" );
}
else
{
glConfig.textureCompression = TC_NONE;
ri.Printf( PRINT_ALL, "...ignoring GL_EXT_texture_compression_s3tc\n" );
VID_Printf( PRINT_ALL, "...ignoring GL_EXT_texture_compression_s3tc\n" );
}
}
// Or check for old ones
@ -850,18 +857,18 @@ static void GLW_InitExtensions( void )
if ( r_ext_compressed_textures->value )
{
glConfig.textureCompression = TC_S3TC;
ri.Printf( PRINT_ALL, "...using GL_S3_s3tc\n" );
VID_Printf( PRINT_ALL, "...using GL_S3_s3tc\n" );
}
else
{
glConfig.textureCompression = TC_NONE;
ri.Printf( PRINT_ALL, "...ignoring GL_S3_s3tc\n" );
VID_Printf( PRINT_ALL, "...ignoring GL_S3_s3tc\n" );
}
}
else
{
glConfig.textureCompression = TC_NONE;
ri.Printf( PRINT_ALL, "...no texture compression found\n" );
VID_Printf( PRINT_ALL, "...no texture compression found\n" );
}
#if 0
@ -869,11 +876,11 @@ static void GLW_InitExtensions( void )
if ( strstr( glConfig.extensions_string, "WGL_EXT_swap_control" ) )
{
qwglSwapIntervalEXT = ( BOOL (WINAPI *)(int)) qwglGetProcAddress( "wglSwapIntervalEXT" );
ri.Printf( PRINT_ALL, "...using WGL_EXT_swap_control\n" );
VID_Printf( PRINT_ALL, "...using WGL_EXT_swap_control\n" );
}
else
{
ri.Printf( PRINT_ALL, "...WGL_EXT_swap_control not found\n" );
VID_Printf( PRINT_ALL, "...WGL_EXT_swap_control not found\n" );
}
#endif
@ -891,21 +898,21 @@ static void GLW_InitExtensions( void )
if ( qglActiveTextureARB )
{
ri.Printf( PRINT_ALL, "...using GL_ARB_multitexture\n" );
VID_Printf( PRINT_ALL, "...using GL_ARB_multitexture\n" );
}
else
{
ri.Printf( PRINT_ALL, "...blind search for ARB_multitexture failed\n" );
VID_Printf( PRINT_ALL, "...blind search for ARB_multitexture failed\n" );
}
}
else
{
ri.Printf( PRINT_ALL, "...ignoring GL_ARB_multitexture\n" );
VID_Printf( PRINT_ALL, "...ignoring GL_ARB_multitexture\n" );
}
}
else
{
ri.Printf( PRINT_ALL, "...GL_ARB_multitexture not found\n" );
VID_Printf( PRINT_ALL, "...GL_ARB_multitexture not found\n" );
}
// GL_EXT_texture_filter_anisotropic
@ -913,22 +920,22 @@ static void GLW_InitExtensions( void )
if ( strstr( glConfig.extensions_string, "EXT_texture_filter_anisotropic" ) )
{
glConfig.textureFilterAnisotropicAvailable = qtrue;
ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic available\n" );
VID_Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic available\n" );
if ( r_ext_texture_filter_anisotropic->integer )
{
ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic\n" );
VID_Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic\n" );
}
else
{
ri.Printf( PRINT_ALL, "...ignoring GL_EXT_texture_filter_anisotropic\n" );
VID_Printf( PRINT_ALL, "...ignoring GL_EXT_texture_filter_anisotropic\n" );
}
ri.Cvar_Set( "r_ext_texture_filter_anisotropic_avail", "1" );
Cvar_Set( "r_ext_texture_filter_anisotropic_avail", "1" );
}
else
{
ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not found\n" );
ri.Cvar_Set( "r_ext_texture_filter_anisotropic_avail", "0" );
VID_Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not found\n" );
Cvar_Set( "r_ext_texture_filter_anisotropic_avail", "0" );
}
// GL_EXT_compiled_vertex_array
@ -936,21 +943,21 @@ static void GLW_InitExtensions( void )
{
if ( r_ext_compiled_vertex_array->value )
{
ri.Printf( PRINT_ALL, "...using GL_EXT_compiled_vertex_array\n" );
VID_Printf( PRINT_ALL, "...using GL_EXT_compiled_vertex_array\n" );
qglLockArraysEXT = ( void ( APIENTRY * )( int, int ) ) dlsym( glw_state.OpenGLLib, "glLockArraysEXT" );
qglUnlockArraysEXT = ( void ( APIENTRY * )( void ) ) dlsym( glw_state.OpenGLLib, "glUnlockArraysEXT" );
if (!qglLockArraysEXT || !qglUnlockArraysEXT) {
ri.Error (ERR_FATAL, "bad getprocaddress");
Com_Error (ERR_FATAL, "bad getprocaddress");
}
}
else
{
ri.Printf( PRINT_ALL, "...ignoring GL_EXT_compiled_vertex_array\n" );
VID_Printf( PRINT_ALL, "...ignoring GL_EXT_compiled_vertex_array\n" );
}
}
else
{
ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
VID_Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
}
}
@ -961,11 +968,14 @@ static void GLW_InitExtensions( void )
** GLimp_win.c internal function that that attempts to load and use
** a specific OpenGL DLL.
*/
static qboolean GLW_LoadOpenGL( const char *name )
static qboolean GLW_LoadOpenGL()
{
char name[1024];
qboolean fullscreen;
ri.Printf( PRINT_ALL, "...loading %s: ", name );
strcpy( name, OPENGL_DRIVER_NAME );
VID_Printf( PRINT_ALL, "...loading %s: ", name );
// disable the 3Dfx splash screen and set gamma
// we do this all the time, but it shouldn't hurt anything
@ -995,7 +1005,7 @@ static qboolean GLW_LoadOpenGL( const char *name )
}
else
{
ri.Printf( PRINT_ALL, "failed\n" );
VID_Printf( PRINT_ALL, "failed\n" );
}
fail:
@ -1004,6 +1014,17 @@ fail:
return qfalse;
}
static void GLW_StartOpenGL( void )
{
//
// load and initialize the specific OpenGL driver
//
if ( !GLW_LoadOpenGL() )
{
Com_Error( ERR_FATAL, "GLW_StartOpenGL() - could not load OpenGL subsystem\n" );
}
}
/*
** GLimp_Init
**
@ -1012,11 +1033,9 @@ fail:
*/
void GLimp_Init( void )
{
qboolean attemptedlibGL = qfalse;
qboolean attempted3Dfx = qfalse;
qboolean success = qfalse;
char buf[1024];
cvar_t *lastValidRenderer = ri.Cvar_Get( "r_lastValidRenderer", "(uninitialized)", CVAR_ARCHIVE );
cvar_t *lastValidRenderer = Cvar_Get( "r_lastValidRenderer", "(uninitialized)", CVAR_ARCHIVE );
cvar_t *cv;
glConfig.deviceSupportsGamma = qfalse;
@ -1026,52 +1045,15 @@ void GLimp_Init( void )
//
// load and initialize the specific OpenGL driver
//
if ( !GLW_LoadOpenGL( r_glDriver->string ) )
{
if ( !Q_stricmp( r_glDriver->string, OPENGL_DRIVER_NAME ) )
{
attemptedlibGL = qtrue;
}
else if ( !Q_stricmp( r_glDriver->string, _3DFX_DRIVER_NAME ) )
{
attempted3Dfx = qtrue;
}
if ( !attempted3Dfx && !success )
{
attempted3Dfx = qtrue;
if ( GLW_LoadOpenGL( _3DFX_DRIVER_NAME ) )
{
ri.Cvar_Set( "r_glDriver", _3DFX_DRIVER_NAME );
r_glDriver->modified = qfalse;
success = qtrue;
}
}
// try ICD before trying 3Dfx standalone driver
if ( !attemptedlibGL && !success )
{
attemptedlibGL = qtrue;
if ( GLW_LoadOpenGL( OPENGL_DRIVER_NAME ) )
{
ri.Cvar_Set( "r_glDriver", OPENGL_DRIVER_NAME );
r_glDriver->modified = qfalse;
success = qtrue;
}
}
if (!success)
ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" );
}
GLW_StartOpenGL();
// get our config strings
Q_strncpyz( glConfig.vendor_string, qglGetString (GL_VENDOR), sizeof( glConfig.vendor_string ) );
Q_strncpyz( glConfig.renderer_string, qglGetString (GL_RENDERER), sizeof( glConfig.renderer_string ) );
if (*glConfig.renderer_string && glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] == '\n')
glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] = 0;
Q_strncpyz( glConfig.version_string, qglGetString (GL_VERSION), sizeof( glConfig.version_string ) );
Q_strncpyz( glConfig.extensions_string, qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) );
glConfig.vendor_string = (const char *) qglGetString (GL_VENDOR);
glConfig.renderer_string = (const char *) qglGetString (GL_RENDERER);
glConfig.version_string = (const char *) qglGetString (GL_VERSION);
glConfig.extensions_string = (const char *) qglGetString (GL_EXTENSIONS);
qglGetIntegerv( GL_MAX_TEXTURE_SIZE, &glConfig.maxTextureSize );
//
// chipset specific configuration
@ -1081,16 +1063,16 @@ void GLimp_Init( void )
if ( Q_stricmp( lastValidRenderer->string, glConfig.renderer_string ) )
{
ri.Cvar_Set( "r_picmip", "1" );
ri.Cvar_Set( "r_twopartfog", "0" );
ri.Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" );
Cvar_Set( "r_picmip", "1" );
Cvar_Set( "r_twopartfog", "0" );
Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" );
//
// voodoo issues
//
if ( strstr( buf, "voodoo" ) && !strstr( buf, "banshee" ) )
{
ri.Cvar_Set( "r_fakeFullscreen", "1");
Cvar_Set( "r_fakeFullscreen", "1");
}
//
@ -1098,7 +1080,7 @@ void GLimp_Init( void )
//
if ( strstr( buf, "riva 128" ) )
{
ri.Cvar_Set( "r_twopartfog", "1" );
Cvar_Set( "r_twopartfog", "1" );
}
//
@ -1106,8 +1088,8 @@ void GLimp_Init( void )
//
if ( strstr( buf, "rage pro" ) )
{
ri.Cvar_Set( "r_mode", "2" );
ri.Cvar_Set( "r_twopartfog", "1" );
Cvar_Set( "r_mode", "2" );
Cvar_Set( "r_twopartfog", "1" );
}
//
@ -1115,7 +1097,7 @@ void GLimp_Init( void )
//
if ( strstr( buf, "permedia2" ) )
{
ri.Cvar_Set( "r_vertexLight", "1" );
Cvar_Set( "r_vertexLight", "1" );
}
//
@ -1126,11 +1108,11 @@ void GLimp_Init( void )
if ( r_texturebits->integer == 32 ||
( ( r_texturebits->integer == 0 ) && glConfig.colorBits > 16 ) )
{
ri.Cvar_Set( "r_picmip", "1" );
Cvar_Set( "r_picmip", "1" );
}
}
ri.Cvar_Set( "r_lastValidRenderer", glConfig.renderer_string );
Cvar_Set( "r_lastValidRenderer", glConfig.renderer_string );
}
// initialize extensions
@ -1161,13 +1143,13 @@ void GLimp_EndFrame (void)
if ( !gl_ignore_errors->value ) {
if ( ( err = qglGetError() ) != GL_NO_ERROR )
{
ri.Error( ERR_FATAL, "GLimp_EndFrame() - glGetError() failed (0x%x)!\n", err );
Com_Error( ERR_FATAL, "GLimp_EndFrame() - glGetError() failed (0x%x)!\n", err );
}
}
#endif
// don't flip if drawing to front buffer
if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
//if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
{
qglXSwapBuffers(dpy, win);
}
@ -1181,7 +1163,7 @@ void GLimp_EndFrame (void)
// decrement log
if ( gl_log->value )
{
ri.Cvar_Set( "gl_log", va("%i",gl_log->value - 1 ) );
Cvar_Set( "gl_log", va("%i",gl_log->value - 1 ) );
}
#endif
}
@ -1200,7 +1182,7 @@ sem_t renderActiveEvent;
void (*glimpRenderThread)( void );
void GLimp_RenderThreadWrapper( void *stub ) {
void *GLimp_RenderThreadWrapper( void *stub ) {
glimpRenderThread();
#if 0
@ -1353,8 +1335,7 @@ void IN_Frame (void)
// temporarily deactivate if not in the game and
// running on the desktop
// voodoo always counts as full screen
if (Cvar_VariableValue ("r_fullscreen") == 0
&& strcmp( Cvar_VariableString("r_glDriver"), _3DFX_DRIVER_NAME ) ) {
if (Cvar_VariableValue ("r_fullscreen") == 0) {
IN_DeactivateMouse ();
return;
}

View file

@ -11,19 +11,18 @@
#include <float.h>
#include "../renderer/tr_local.h"
#include "unix_glw.h"
#include "../client/client.h"
#include <GL/fxmesa.h>
#include <GL/glx.h>
#include <dlfcn.h>
//FX Mesa Functions
fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]);
fxMesaContext (*qfxMesaCreateBestContext)(GLuint win, GLint width, GLint height, const GLint attribList[]);
void (*qfxMesaDestroyContext)(fxMesaContext ctx);
void (*qfxMesaMakeCurrent)(fxMesaContext ctx);
fxMesaContext (*qfxMesaGetCurrentContext)(void);
void (*qfxMesaSwapBuffers)(void);
#include <sys/types.h>
#include <unistd.h>
#ifndef __stdcall
#define __stdcall
#endif
//GLX Functions
XVisualInfo * (*qglXChooseVisual)( Display *dpy, int screen, int *attribList );
@ -370,15 +369,6 @@ void ( APIENTRY * qglVertex4sv )(const GLshort *v);
void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture );
void ( APIENTRY * qglLockArraysEXT)( int, int);
void ( APIENTRY * qglUnlockArraysEXT) ( void );
void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value );
void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value );
void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * );
void ( APIENTRY * qgl3DfxSetPaletteEXT)( GLuint * );
void ( APIENTRY * qglSelectTextureSGIS)( GLenum );
@ -2960,13 +2950,6 @@ void QGL_Shutdown( void )
qglVertexPointer = NULL;
qglViewport = NULL;
qfxMesaCreateContext = NULL;
qfxMesaCreateBestContext = NULL;
qfxMesaDestroyContext = NULL;
qfxMesaMakeCurrent = NULL;
qfxMesaGetCurrentContext = NULL;
qfxMesaSwapBuffers = NULL;
qglXChooseVisual = NULL;
qglXCreateContext = NULL;
qglXDestroyContext = NULL;
@ -3026,365 +3009,359 @@ qboolean QGL_Init( const char *dllname )
Q_strcat(fn, sizeof(fn), dllname);
if ( ( glw_state.OpenGLLib = dlopen( fn, RTLD_LAZY ) ) == 0 ) {
ri.Printf(PRINT_ALL, "QGL_Init: Can't load %s from /etc/ld.so.conf or current dir: %s\n", dllname, dlerror());
VID_Printf(PRINT_ALL, "QGL_Init: Can't load %s from /etc/ld.so.conf or current dir: %s\n", dllname, dlerror());
return qfalse;
}
} else {
ri.Printf(PRINT_ALL, "QGL_Init: Can't load %s from /etc/ld.so.conf: %s\n", dllname, dlerror());
VID_Printf(PRINT_ALL, "QGL_Init: Can't load %s from /etc/ld.so.conf: %s\n", dllname, dlerror());
return qfalse;
}
}
qglAccum = dllAccum = GPA( "glAccum" );
qglAlphaFunc = dllAlphaFunc = GPA( "glAlphaFunc" );
qglAreTexturesResident = dllAreTexturesResident = GPA( "glAreTexturesResident" );
qglArrayElement = dllArrayElement = GPA( "glArrayElement" );
qglBegin = dllBegin = GPA( "glBegin" );
qglBindTexture = dllBindTexture = GPA( "glBindTexture" );
qglBitmap = dllBitmap = GPA( "glBitmap" );
qglBlendFunc = dllBlendFunc = GPA( "glBlendFunc" );
qglCallList = dllCallList = GPA( "glCallList" );
qglCallLists = dllCallLists = GPA( "glCallLists" );
qglClear = dllClear = GPA( "glClear" );
qglClearAccum = dllClearAccum = GPA( "glClearAccum" );
qglClearColor = dllClearColor = GPA( "glClearColor" );
qglClearDepth = dllClearDepth = GPA( "glClearDepth" );
qglClearIndex = dllClearIndex = GPA( "glClearIndex" );
qglClearStencil = dllClearStencil = GPA( "glClearStencil" );
qglClipPlane = dllClipPlane = GPA( "glClipPlane" );
qglColor3b = dllColor3b = GPA( "glColor3b" );
qglColor3bv = dllColor3bv = GPA( "glColor3bv" );
qglColor3d = dllColor3d = GPA( "glColor3d" );
qglColor3dv = dllColor3dv = GPA( "glColor3dv" );
qglColor3f = dllColor3f = GPA( "glColor3f" );
qglColor3fv = dllColor3fv = GPA( "glColor3fv" );
qglColor3i = dllColor3i = GPA( "glColor3i" );
qglColor3iv = dllColor3iv = GPA( "glColor3iv" );
qglColor3s = dllColor3s = GPA( "glColor3s" );
qglColor3sv = dllColor3sv = GPA( "glColor3sv" );
qglColor3ub = dllColor3ub = GPA( "glColor3ub" );
qglColor3ubv = dllColor3ubv = GPA( "glColor3ubv" );
qglColor3ui = dllColor3ui = GPA( "glColor3ui" );
qglColor3uiv = dllColor3uiv = GPA( "glColor3uiv" );
qglColor3us = dllColor3us = GPA( "glColor3us" );
qglColor3usv = dllColor3usv = GPA( "glColor3usv" );
qglColor4b = dllColor4b = GPA( "glColor4b" );
qglColor4bv = dllColor4bv = GPA( "glColor4bv" );
qglColor4d = dllColor4d = GPA( "glColor4d" );
qglColor4dv = dllColor4dv = GPA( "glColor4dv" );
qglColor4f = dllColor4f = GPA( "glColor4f" );
qglColor4fv = dllColor4fv = GPA( "glColor4fv" );
qglColor4i = dllColor4i = GPA( "glColor4i" );
qglColor4iv = dllColor4iv = GPA( "glColor4iv" );
qglColor4s = dllColor4s = GPA( "glColor4s" );
qglColor4sv = dllColor4sv = GPA( "glColor4sv" );
qglColor4ub = dllColor4ub = GPA( "glColor4ub" );
qglColor4ubv = dllColor4ubv = GPA( "glColor4ubv" );
qglColor4ui = dllColor4ui = GPA( "glColor4ui" );
qglColor4uiv = dllColor4uiv = GPA( "glColor4uiv" );
qglColor4us = dllColor4us = GPA( "glColor4us" );
qglColor4usv = dllColor4usv = GPA( "glColor4usv" );
qglColorMask = dllColorMask = GPA( "glColorMask" );
qglColorMaterial = dllColorMaterial = GPA( "glColorMaterial" );
qglColorPointer = dllColorPointer = GPA( "glColorPointer" );
qglCopyPixels = dllCopyPixels = GPA( "glCopyPixels" );
qglCopyTexImage1D = dllCopyTexImage1D = GPA( "glCopyTexImage1D" );
qglCopyTexImage2D = dllCopyTexImage2D = GPA( "glCopyTexImage2D" );
qglCopyTexSubImage1D = dllCopyTexSubImage1D = GPA( "glCopyTexSubImage1D" );
qglCopyTexSubImage2D = dllCopyTexSubImage2D = GPA( "glCopyTexSubImage2D" );
qglCullFace = dllCullFace = GPA( "glCullFace" );
qglDeleteLists = dllDeleteLists = GPA( "glDeleteLists" );
qglDeleteTextures = dllDeleteTextures = GPA( "glDeleteTextures" );
qglDepthFunc = dllDepthFunc = GPA( "glDepthFunc" );
qglDepthMask = dllDepthMask = GPA( "glDepthMask" );
qglDepthRange = dllDepthRange = GPA( "glDepthRange" );
qglDisable = dllDisable = GPA( "glDisable" );
qglDisableClientState = dllDisableClientState = GPA( "glDisableClientState" );
qglDrawArrays = dllDrawArrays = GPA( "glDrawArrays" );
qglDrawBuffer = dllDrawBuffer = GPA( "glDrawBuffer" );
qglDrawElements = dllDrawElements = GPA( "glDrawElements" );
qglDrawPixels = dllDrawPixels = GPA( "glDrawPixels" );
qglEdgeFlag = dllEdgeFlag = GPA( "glEdgeFlag" );
qglEdgeFlagPointer = dllEdgeFlagPointer = GPA( "glEdgeFlagPointer" );
qglEdgeFlagv = dllEdgeFlagv = GPA( "glEdgeFlagv" );
qglEnable = dllEnable = GPA( "glEnable" );
qglEnableClientState = dllEnableClientState = GPA( "glEnableClientState" );
qglEnd = dllEnd = GPA( "glEnd" );
qglEndList = dllEndList = GPA( "glEndList" );
qglEvalCoord1d = dllEvalCoord1d = GPA( "glEvalCoord1d" );
qglEvalCoord1dv = dllEvalCoord1dv = GPA( "glEvalCoord1dv" );
qglEvalCoord1f = dllEvalCoord1f = GPA( "glEvalCoord1f" );
qglEvalCoord1fv = dllEvalCoord1fv = GPA( "glEvalCoord1fv" );
qglEvalCoord2d = dllEvalCoord2d = GPA( "glEvalCoord2d" );
qglEvalCoord2dv = dllEvalCoord2dv = GPA( "glEvalCoord2dv" );
qglEvalCoord2f = dllEvalCoord2f = GPA( "glEvalCoord2f" );
qglEvalCoord2fv = dllEvalCoord2fv = GPA( "glEvalCoord2fv" );
qglEvalMesh1 = dllEvalMesh1 = GPA( "glEvalMesh1" );
qglEvalMesh2 = dllEvalMesh2 = GPA( "glEvalMesh2" );
qglEvalPoint1 = dllEvalPoint1 = GPA( "glEvalPoint1" );
qglEvalPoint2 = dllEvalPoint2 = GPA( "glEvalPoint2" );
qglFeedbackBuffer = dllFeedbackBuffer = GPA( "glFeedbackBuffer" );
qglFinish = dllFinish = GPA( "glFinish" );
qglFlush = dllFlush = GPA( "glFlush" );
qglFogf = dllFogf = GPA( "glFogf" );
qglFogfv = dllFogfv = GPA( "glFogfv" );
qglFogi = dllFogi = GPA( "glFogi" );
qglFogiv = dllFogiv = GPA( "glFogiv" );
qglFrontFace = dllFrontFace = GPA( "glFrontFace" );
qglFrustum = dllFrustum = GPA( "glFrustum" );
qglGenLists = dllGenLists = GPA( "glGenLists" );
qglGenTextures = dllGenTextures = GPA( "glGenTextures" );
qglGetBooleanv = dllGetBooleanv = GPA( "glGetBooleanv" );
qglGetClipPlane = dllGetClipPlane = GPA( "glGetClipPlane" );
qglGetDoublev = dllGetDoublev = GPA( "glGetDoublev" );
qglGetError = dllGetError = GPA( "glGetError" );
qglGetFloatv = dllGetFloatv = GPA( "glGetFloatv" );
qglGetIntegerv = dllGetIntegerv = GPA( "glGetIntegerv" );
qglGetLightfv = dllGetLightfv = GPA( "glGetLightfv" );
qglGetLightiv = dllGetLightiv = GPA( "glGetLightiv" );
qglGetMapdv = dllGetMapdv = GPA( "glGetMapdv" );
qglGetMapfv = dllGetMapfv = GPA( "glGetMapfv" );
qglGetMapiv = dllGetMapiv = GPA( "glGetMapiv" );
qglGetMaterialfv = dllGetMaterialfv = GPA( "glGetMaterialfv" );
qglGetMaterialiv = dllGetMaterialiv = GPA( "glGetMaterialiv" );
qglGetPixelMapfv = dllGetPixelMapfv = GPA( "glGetPixelMapfv" );
qglGetPixelMapuiv = dllGetPixelMapuiv = GPA( "glGetPixelMapuiv" );
qglGetPixelMapusv = dllGetPixelMapusv = GPA( "glGetPixelMapusv" );
qglGetPointerv = dllGetPointerv = GPA( "glGetPointerv" );
qglGetPolygonStipple = dllGetPolygonStipple = GPA( "glGetPolygonStipple" );
qglGetString = dllGetString = GPA( "glGetString" );
qglGetTexEnvfv = dllGetTexEnvfv = GPA( "glGetTexEnvfv" );
qglGetTexEnviv = dllGetTexEnviv = GPA( "glGetTexEnviv" );
qglGetTexGendv = dllGetTexGendv = GPA( "glGetTexGendv" );
qglGetTexGenfv = dllGetTexGenfv = GPA( "glGetTexGenfv" );
qglGetTexGeniv = dllGetTexGeniv = GPA( "glGetTexGeniv" );
qglGetTexImage = dllGetTexImage = GPA( "glGetTexImage" );
qglGetTexLevelParameterfv = dllGetTexLevelParameterfv = GPA( "glGetLevelParameterfv" );
qglGetTexLevelParameteriv = dllGetTexLevelParameteriv = GPA( "glGetLevelParameteriv" );
qglGetTexParameterfv = dllGetTexParameterfv = GPA( "glGetTexParameterfv" );
qglGetTexParameteriv = dllGetTexParameteriv = GPA( "glGetTexParameteriv" );
qglHint = dllHint = GPA( "glHint" );
qglIndexMask = dllIndexMask = GPA( "glIndexMask" );
qglIndexPointer = dllIndexPointer = GPA( "glIndexPointer" );
qglIndexd = dllIndexd = GPA( "glIndexd" );
qglIndexdv = dllIndexdv = GPA( "glIndexdv" );
qglIndexf = dllIndexf = GPA( "glIndexf" );
qglIndexfv = dllIndexfv = GPA( "glIndexfv" );
qglIndexi = dllIndexi = GPA( "glIndexi" );
qglIndexiv = dllIndexiv = GPA( "glIndexiv" );
qglIndexs = dllIndexs = GPA( "glIndexs" );
qglIndexsv = dllIndexsv = GPA( "glIndexsv" );
qglIndexub = dllIndexub = GPA( "glIndexub" );
qglIndexubv = dllIndexubv = GPA( "glIndexubv" );
qglInitNames = dllInitNames = GPA( "glInitNames" );
qglInterleavedArrays = dllInterleavedArrays = GPA( "glInterleavedArrays" );
qglIsEnabled = dllIsEnabled = GPA( "glIsEnabled" );
qglIsList = dllIsList = GPA( "glIsList" );
qglIsTexture = dllIsTexture = GPA( "glIsTexture" );
qglLightModelf = dllLightModelf = GPA( "glLightModelf" );
qglLightModelfv = dllLightModelfv = GPA( "glLightModelfv" );
qglLightModeli = dllLightModeli = GPA( "glLightModeli" );
qglLightModeliv = dllLightModeliv = GPA( "glLightModeliv" );
qglLightf = dllLightf = GPA( "glLightf" );
qglLightfv = dllLightfv = GPA( "glLightfv" );
qglLighti = dllLighti = GPA( "glLighti" );
qglLightiv = dllLightiv = GPA( "glLightiv" );
qglLineStipple = dllLineStipple = GPA( "glLineStipple" );
qglLineWidth = dllLineWidth = GPA( "glLineWidth" );
qglListBase = dllListBase = GPA( "glListBase" );
qglLoadIdentity = dllLoadIdentity = GPA( "glLoadIdentity" );
qglLoadMatrixd = dllLoadMatrixd = GPA( "glLoadMatrixd" );
qglLoadMatrixf = dllLoadMatrixf = GPA( "glLoadMatrixf" );
qglLoadName = dllLoadName = GPA( "glLoadName" );
qglLogicOp = dllLogicOp = GPA( "glLogicOp" );
qglMap1d = dllMap1d = GPA( "glMap1d" );
qglMap1f = dllMap1f = GPA( "glMap1f" );
qglMap2d = dllMap2d = GPA( "glMap2d" );
qglMap2f = dllMap2f = GPA( "glMap2f" );
qglMapGrid1d = dllMapGrid1d = GPA( "glMapGrid1d" );
qglMapGrid1f = dllMapGrid1f = GPA( "glMapGrid1f" );
qglMapGrid2d = dllMapGrid2d = GPA( "glMapGrid2d" );
qglMapGrid2f = dllMapGrid2f = GPA( "glMapGrid2f" );
qglMaterialf = dllMaterialf = GPA( "glMaterialf" );
qglMaterialfv = dllMaterialfv = GPA( "glMaterialfv" );
qglMateriali = dllMateriali = GPA( "glMateriali" );
qglMaterialiv = dllMaterialiv = GPA( "glMaterialiv" );
qglMatrixMode = dllMatrixMode = GPA( "glMatrixMode" );
qglMultMatrixd = dllMultMatrixd = GPA( "glMultMatrixd" );
qglMultMatrixf = dllMultMatrixf = GPA( "glMultMatrixf" );
qglNewList = dllNewList = GPA( "glNewList" );
qglNormal3b = dllNormal3b = GPA( "glNormal3b" );
qglNormal3bv = dllNormal3bv = GPA( "glNormal3bv" );
qglNormal3d = dllNormal3d = GPA( "glNormal3d" );
qglNormal3dv = dllNormal3dv = GPA( "glNormal3dv" );
qglNormal3f = dllNormal3f = GPA( "glNormal3f" );
qglNormal3fv = dllNormal3fv = GPA( "glNormal3fv" );
qglNormal3i = dllNormal3i = GPA( "glNormal3i" );
qglNormal3iv = dllNormal3iv = GPA( "glNormal3iv" );
qglNormal3s = dllNormal3s = GPA( "glNormal3s" );
qglNormal3sv = dllNormal3sv = GPA( "glNormal3sv" );
qglNormalPointer = dllNormalPointer = GPA( "glNormalPointer" );
qglOrtho = dllOrtho = GPA( "glOrtho" );
qglPassThrough = dllPassThrough = GPA( "glPassThrough" );
qglPixelMapfv = dllPixelMapfv = GPA( "glPixelMapfv" );
qglPixelMapuiv = dllPixelMapuiv = GPA( "glPixelMapuiv" );
qglPixelMapusv = dllPixelMapusv = GPA( "glPixelMapusv" );
qglPixelStoref = dllPixelStoref = GPA( "glPixelStoref" );
qglPixelStorei = dllPixelStorei = GPA( "glPixelStorei" );
qglPixelTransferf = dllPixelTransferf = GPA( "glPixelTransferf" );
qglPixelTransferi = dllPixelTransferi = GPA( "glPixelTransferi" );
qglPixelZoom = dllPixelZoom = GPA( "glPixelZoom" );
qglPointSize = dllPointSize = GPA( "glPointSize" );
qglPolygonMode = dllPolygonMode = GPA( "glPolygonMode" );
qglPolygonOffset = dllPolygonOffset = GPA( "glPolygonOffset" );
qglPolygonStipple = dllPolygonStipple = GPA( "glPolygonStipple" );
qglPopAttrib = dllPopAttrib = GPA( "glPopAttrib" );
qglPopClientAttrib = dllPopClientAttrib = GPA( "glPopClientAttrib" );
qglPopMatrix = dllPopMatrix = GPA( "glPopMatrix" );
qglPopName = dllPopName = GPA( "glPopName" );
qglPrioritizeTextures = dllPrioritizeTextures = GPA( "glPrioritizeTextures" );
qglPushAttrib = dllPushAttrib = GPA( "glPushAttrib" );
qglPushClientAttrib = dllPushClientAttrib = GPA( "glPushClientAttrib" );
qglPushMatrix = dllPushMatrix = GPA( "glPushMatrix" );
qglPushName = dllPushName = GPA( "glPushName" );
qglRasterPos2d = dllRasterPos2d = GPA( "glRasterPos2d" );
qglRasterPos2dv = dllRasterPos2dv = GPA( "glRasterPos2dv" );
qglRasterPos2f = dllRasterPos2f = GPA( "glRasterPos2f" );
qglRasterPos2fv = dllRasterPos2fv = GPA( "glRasterPos2fv" );
qglRasterPos2i = dllRasterPos2i = GPA( "glRasterPos2i" );
qglRasterPos2iv = dllRasterPos2iv = GPA( "glRasterPos2iv" );
qglRasterPos2s = dllRasterPos2s = GPA( "glRasterPos2s" );
qglRasterPos2sv = dllRasterPos2sv = GPA( "glRasterPos2sv" );
qglRasterPos3d = dllRasterPos3d = GPA( "glRasterPos3d" );
qglRasterPos3dv = dllRasterPos3dv = GPA( "glRasterPos3dv" );
qglRasterPos3f = dllRasterPos3f = GPA( "glRasterPos3f" );
qglRasterPos3fv = dllRasterPos3fv = GPA( "glRasterPos3fv" );
qglRasterPos3i = dllRasterPos3i = GPA( "glRasterPos3i" );
qglRasterPos3iv = dllRasterPos3iv = GPA( "glRasterPos3iv" );
qglRasterPos3s = dllRasterPos3s = GPA( "glRasterPos3s" );
qglRasterPos3sv = dllRasterPos3sv = GPA( "glRasterPos3sv" );
qglRasterPos4d = dllRasterPos4d = GPA( "glRasterPos4d" );
qglRasterPos4dv = dllRasterPos4dv = GPA( "glRasterPos4dv" );
qglRasterPos4f = dllRasterPos4f = GPA( "glRasterPos4f" );
qglRasterPos4fv = dllRasterPos4fv = GPA( "glRasterPos4fv" );
qglRasterPos4i = dllRasterPos4i = GPA( "glRasterPos4i" );
qglRasterPos4iv = dllRasterPos4iv = GPA( "glRasterPos4iv" );
qglRasterPos4s = dllRasterPos4s = GPA( "glRasterPos4s" );
qglRasterPos4sv = dllRasterPos4sv = GPA( "glRasterPos4sv" );
qglReadBuffer = dllReadBuffer = GPA( "glReadBuffer" );
qglReadPixels = dllReadPixels = GPA( "glReadPixels" );
qglRectd = dllRectd = GPA( "glRectd" );
qglRectdv = dllRectdv = GPA( "glRectdv" );
qglRectf = dllRectf = GPA( "glRectf" );
qglRectfv = dllRectfv = GPA( "glRectfv" );
qglRecti = dllRecti = GPA( "glRecti" );
qglRectiv = dllRectiv = GPA( "glRectiv" );
qglRects = dllRects = GPA( "glRects" );
qglRectsv = dllRectsv = GPA( "glRectsv" );
qglRenderMode = dllRenderMode = GPA( "glRenderMode" );
qglRotated = dllRotated = GPA( "glRotated" );
qglRotatef = dllRotatef = GPA( "glRotatef" );
qglScaled = dllScaled = GPA( "glScaled" );
qglScalef = dllScalef = GPA( "glScalef" );
qglScissor = dllScissor = GPA( "glScissor" );
qglSelectBuffer = dllSelectBuffer = GPA( "glSelectBuffer" );
qglShadeModel = dllShadeModel = GPA( "glShadeModel" );
qglStencilFunc = dllStencilFunc = GPA( "glStencilFunc" );
qglStencilMask = dllStencilMask = GPA( "glStencilMask" );
qglStencilOp = dllStencilOp = GPA( "glStencilOp" );
qglTexCoord1d = dllTexCoord1d = GPA( "glTexCoord1d" );
qglTexCoord1dv = dllTexCoord1dv = GPA( "glTexCoord1dv" );
qglTexCoord1f = dllTexCoord1f = GPA( "glTexCoord1f" );
qglTexCoord1fv = dllTexCoord1fv = GPA( "glTexCoord1fv" );
qglTexCoord1i = dllTexCoord1i = GPA( "glTexCoord1i" );
qglTexCoord1iv = dllTexCoord1iv = GPA( "glTexCoord1iv" );
qglTexCoord1s = dllTexCoord1s = GPA( "glTexCoord1s" );
qglTexCoord1sv = dllTexCoord1sv = GPA( "glTexCoord1sv" );
qglTexCoord2d = dllTexCoord2d = GPA( "glTexCoord2d" );
qglTexCoord2dv = dllTexCoord2dv = GPA( "glTexCoord2dv" );
qglTexCoord2f = dllTexCoord2f = GPA( "glTexCoord2f" );
qglTexCoord2fv = dllTexCoord2fv = GPA( "glTexCoord2fv" );
qglTexCoord2i = dllTexCoord2i = GPA( "glTexCoord2i" );
qglTexCoord2iv = dllTexCoord2iv = GPA( "glTexCoord2iv" );
qglTexCoord2s = dllTexCoord2s = GPA( "glTexCoord2s" );
qglTexCoord2sv = dllTexCoord2sv = GPA( "glTexCoord2sv" );
qglTexCoord3d = dllTexCoord3d = GPA( "glTexCoord3d" );
qglTexCoord3dv = dllTexCoord3dv = GPA( "glTexCoord3dv" );
qglTexCoord3f = dllTexCoord3f = GPA( "glTexCoord3f" );
qglTexCoord3fv = dllTexCoord3fv = GPA( "glTexCoord3fv" );
qglTexCoord3i = dllTexCoord3i = GPA( "glTexCoord3i" );
qglTexCoord3iv = dllTexCoord3iv = GPA( "glTexCoord3iv" );
qglTexCoord3s = dllTexCoord3s = GPA( "glTexCoord3s" );
qglTexCoord3sv = dllTexCoord3sv = GPA( "glTexCoord3sv" );
qglTexCoord4d = dllTexCoord4d = GPA( "glTexCoord4d" );
qglTexCoord4dv = dllTexCoord4dv = GPA( "glTexCoord4dv" );
qglTexCoord4f = dllTexCoord4f = GPA( "glTexCoord4f" );
qglTexCoord4fv = dllTexCoord4fv = GPA( "glTexCoord4fv" );
qglTexCoord4i = dllTexCoord4i = GPA( "glTexCoord4i" );
qglTexCoord4iv = dllTexCoord4iv = GPA( "glTexCoord4iv" );
qglTexCoord4s = dllTexCoord4s = GPA( "glTexCoord4s" );
qglTexCoord4sv = dllTexCoord4sv = GPA( "glTexCoord4sv" );
qglTexCoordPointer = dllTexCoordPointer = GPA( "glTexCoordPointer" );
qglTexEnvf = dllTexEnvf = GPA( "glTexEnvf" );
qglTexEnvfv = dllTexEnvfv = GPA( "glTexEnvfv" );
qglTexEnvi = dllTexEnvi = GPA( "glTexEnvi" );
qglTexEnviv = dllTexEnviv = GPA( "glTexEnviv" );
qglTexGend = dllTexGend = GPA( "glTexGend" );
qglTexGendv = dllTexGendv = GPA( "glTexGendv" );
qglTexGenf = dllTexGenf = GPA( "glTexGenf" );
qglTexGenfv = dllTexGenfv = GPA( "glTexGenfv" );
qglTexGeni = dllTexGeni = GPA( "glTexGeni" );
qglTexGeniv = dllTexGeniv = GPA( "glTexGeniv" );
qglTexImage1D = dllTexImage1D = GPA( "glTexImage1D" );
qglTexImage2D = dllTexImage2D = GPA( "glTexImage2D" );
qglTexParameterf = dllTexParameterf = GPA( "glTexParameterf" );
qglTexParameterfv = dllTexParameterfv = GPA( "glTexParameterfv" );
qglTexParameteri = dllTexParameteri = GPA( "glTexParameteri" );
qglTexParameteriv = dllTexParameteriv = GPA( "glTexParameteriv" );
qglTexSubImage1D = dllTexSubImage1D = GPA( "glTexSubImage1D" );
qglTexSubImage2D = dllTexSubImage2D = GPA( "glTexSubImage2D" );
qglTranslated = dllTranslated = GPA( "glTranslated" );
qglTranslatef = dllTranslatef = GPA( "glTranslatef" );
qglVertex2d = dllVertex2d = GPA( "glVertex2d" );
qglVertex2dv = dllVertex2dv = GPA( "glVertex2dv" );
qglVertex2f = dllVertex2f = GPA( "glVertex2f" );
qglVertex2fv = dllVertex2fv = GPA( "glVertex2fv" );
qglVertex2i = dllVertex2i = GPA( "glVertex2i" );
qglVertex2iv = dllVertex2iv = GPA( "glVertex2iv" );
qglVertex2s = dllVertex2s = GPA( "glVertex2s" );
qglVertex2sv = dllVertex2sv = GPA( "glVertex2sv" );
qglVertex3d = dllVertex3d = GPA( "glVertex3d" );
qglVertex3dv = dllVertex3dv = GPA( "glVertex3dv" );
qglVertex3f = dllVertex3f = GPA( "glVertex3f" );
qglVertex3fv = dllVertex3fv = GPA( "glVertex3fv" );
qglVertex3i = dllVertex3i = GPA( "glVertex3i" );
qglVertex3iv = dllVertex3iv = GPA( "glVertex3iv" );
qglVertex3s = dllVertex3s = GPA( "glVertex3s" );
qglVertex3sv = dllVertex3sv = GPA( "glVertex3sv" );
qglVertex4d = dllVertex4d = GPA( "glVertex4d" );
qglVertex4dv = dllVertex4dv = GPA( "glVertex4dv" );
qglVertex4f = dllVertex4f = GPA( "glVertex4f" );
qglVertex4fv = dllVertex4fv = GPA( "glVertex4fv" );
qglVertex4i = dllVertex4i = GPA( "glVertex4i" );
qglVertex4iv = dllVertex4iv = GPA( "glVertex4iv" );
qglVertex4s = dllVertex4s = GPA( "glVertex4s" );
qglVertex4sv = dllVertex4sv = GPA( "glVertex4sv" );
qglVertexPointer = dllVertexPointer = GPA( "glVertexPointer" );
qglViewport = dllViewport = GPA( "glViewport" );
qglAccum = dllAccum = (void (__stdcall *)(unsigned int,float))GPA( "glAccum" );
qglAlphaFunc = dllAlphaFunc = (void (__stdcall *)(unsigned int,float))GPA( "glAlphaFunc" );
qglAreTexturesResident = dllAreTexturesResident = (unsigned char (__stdcall *)(int,const unsigned int *,unsigned char *))GPA( "glAreTexturesResident" );
qglArrayElement = dllArrayElement = (void (__stdcall *)(int))GPA( "glArrayElement" );
qglBegin = dllBegin = (void (__stdcall *)(unsigned int))GPA( "glBegin" );
qglBindTexture = dllBindTexture = (void (__stdcall *)(unsigned int,unsigned int))GPA( "glBindTexture" );
qglBitmap = dllBitmap = (void (__stdcall *)(int,int,float,float,float,float,const unsigned char *))GPA( "glBitmap" );
qglBlendFunc = dllBlendFunc = (void (__stdcall *)(unsigned int,unsigned int))GPA( "glBlendFunc" );
qglCallList = dllCallList = (void (__stdcall *)(unsigned int))GPA( "glCallList" );
qglCallLists = dllCallLists = (void (__stdcall *)(int,unsigned int,const void *))GPA( "glCallLists" );
qglClear = dllClear = (void (__stdcall *)(unsigned int))GPA( "glClear" );
qglClearAccum = dllClearAccum = (void (__stdcall *)(float,float,float,float))GPA( "glClearAccum" );
qglClearColor = dllClearColor = (void (__stdcall *)(float,float,float,float))GPA( "glClearColor" );
qglClearDepth = dllClearDepth = (void (__stdcall *)(double))GPA( "glClearDepth" );
qglClearIndex = dllClearIndex = (void (__stdcall *)(float))GPA( "glClearIndex" );
qglClearStencil = dllClearStencil = (void (__stdcall *)(int))GPA( "glClearStencil" );
qglClipPlane = dllClipPlane = (void (__stdcall *)(unsigned int,const double *))GPA( "glClipPlane" );
qglColor3b = dllColor3b = (void (__stdcall *)(signed char,signed char,signed char))GPA( "glColor3b" );
qglColor3bv = dllColor3bv = (void (__stdcall *)(const signed char *))GPA( "glColor3bv" );
qglColor3d = dllColor3d = (void (__stdcall *)(double,double,double))GPA( "glColor3d" );
qglColor3dv = dllColor3dv = (void (__stdcall *)(const double *))GPA( "glColor3dv" );
qglColor3f = dllColor3f = (void (__stdcall *)(float,float,float))GPA( "glColor3f" );
qglColor3fv = dllColor3fv = (void (__stdcall *)(const float *))GPA( "glColor3fv" );
qglColor3i = dllColor3i = (void (__stdcall *)(int,int,int))GPA( "glColor3i" );
qglColor3iv = dllColor3iv = (void (__stdcall *)(const int *))GPA( "glColor3iv" );
qglColor3s = dllColor3s =(void (__stdcall *)(short,short,short))GPA( "glColor3s" );
qglColor3sv = dllColor3sv =(void (__stdcall *)(const short *))GPA( "glColor3sv" );
qglColor3ub = dllColor3ub =(void (__stdcall *)(unsigned char,unsigned char,unsigned char))GPA( "glColor3ub" );
qglColor3ubv = dllColor3ubv =(void (__stdcall *)(const unsigned char *))GPA( "glColor3ubv" );
qglColor3ui = dllColor3ui =(void (__stdcall *)(unsigned int,unsigned int,unsigned int))GPA( "glColor3ui" );
qglColor3uiv = dllColor3uiv =(void (__stdcall *)(const unsigned int *))GPA( "glColor3uiv" );
qglColor3us = dllColor3us =(void (__stdcall *)(unsigned short,unsigned short,unsigned short))GPA( "glColor3us" );
qglColor3usv = dllColor3usv =(void (__stdcall *)(const unsigned short *))GPA( "glColor3usv" );
qglColor4b = dllColor4b =(void (__stdcall *)(signed char,signed char,signed char,signed char))GPA( "glColor4b" );
qglColor4bv = dllColor4bv =(void (__stdcall *)(const signed char *))GPA( "glColor4bv" );
qglColor4d = dllColor4d =(void (__stdcall *)(double,double,double,double))GPA( "glColor4d" );
qglColor4dv = dllColor4dv =(void (__stdcall *)(const double *))GPA( "glColor4dv" );
qglColor4f = dllColor4f =(void (__stdcall *)(float,float,float,float))GPA( "glColor4f" );
qglColor4fv = dllColor4fv =(void (__stdcall *)(const float *))GPA( "glColor4fv" );
qglColor4i = dllColor4i =(void (__stdcall *)(int,int,int,int))GPA( "glColor4i" );
qglColor4iv = dllColor4iv =(void (__stdcall *)(const int *))GPA( "glColor4iv" );
qglColor4s = dllColor4s =(void (__stdcall *)(short,short,short,short))GPA( "glColor4s" );
qglColor4sv = dllColor4sv =(void (__stdcall *)(const short *))GPA( "glColor4sv" );
qglColor4ub = dllColor4ub =(void (__stdcall *)(unsigned char,unsigned char,unsigned char,unsigned char))GPA( "glColor4ub" );
qglColor4ubv = dllColor4ubv =(void (__stdcall *)(const unsigned char *))GPA( "glColor4ubv" );
qglColor4ui = dllColor4ui =(void (__stdcall *)(unsigned int,unsigned int,unsigned int,unsigned int))GPA( "glColor4ui" );
qglColor4uiv = dllColor4uiv =(void (__stdcall *)(const unsigned int *))GPA( "glColor4uiv" );
qglColor4us = dllColor4us =(void (__stdcall *)(unsigned short,unsigned short,unsigned short,unsigned short))GPA( "glColor4us" );
qglColor4usv = dllColor4usv =(void (__stdcall *)(const unsigned short *))GPA( "glColor4usv" );
qglColorMask = dllColorMask =(void (__stdcall *)(unsigned char,unsigned char,unsigned char,unsigned char))GPA( "glColorMask" );
qglColorMaterial = dllColorMaterial =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glColorMaterial" );
qglColorPointer = dllColorPointer =(void (__stdcall *)(int,unsigned int,int,const void *))GPA( "glColorPointer" );
qglCopyPixels = dllCopyPixels =(void (__stdcall *)(int,int,int,int,unsigned int))GPA( "glCopyPixels" );
qglCopyTexImage1D = dllCopyTexImage1D =(void (__stdcall *)(unsigned int,int,unsigned int,int,int,int,int))GPA( "glCopyTexImage1D" );
qglCopyTexImage2D = dllCopyTexImage2D =(void (__stdcall *)(unsigned int,int,unsigned int,int,int,int,int,int))GPA( "glCopyTexImage2D" );
qglCopyTexSubImage1D = dllCopyTexSubImage1D =(void (__stdcall *)(unsigned int,int,int,int,int,int))GPA( "glCopyTexSubImage1D" );
qglCopyTexSubImage2D = dllCopyTexSubImage2D =(void (__stdcall *)(unsigned int,int,int,int,int,int,int,int))GPA( "glCopyTexSubImage2D" );
qglCullFace = dllCullFace =(void (__stdcall *)(unsigned int))GPA( "glCullFace" );
qglDeleteLists = dllDeleteLists =(void (__stdcall *)(unsigned int,int))GPA( "glDeleteLists" );
qglDeleteTextures = dllDeleteTextures =(void (__stdcall *)(int,const unsigned int *))GPA( "glDeleteTextures" );
qglDepthFunc = dllDepthFunc =(void (__stdcall *)(unsigned int))GPA( "glDepthFunc" );
qglDepthMask = dllDepthMask =(void (__stdcall *)(unsigned char))GPA( "glDepthMask" );
qglDepthRange = dllDepthRange =(void (__stdcall *)(double,double))GPA( "glDepthRange" );
qglDisable = dllDisable =(void (__stdcall *)(unsigned int))GPA( "glDisable" );
qglDisableClientState = dllDisableClientState =(void (__stdcall *)(unsigned int))GPA( "glDisableClientState" );
qglDrawArrays = dllDrawArrays =(void (__stdcall *)(unsigned int,int,int))GPA( "glDrawArrays" );
qglDrawBuffer = dllDrawBuffer =(void (__stdcall *)(unsigned int))GPA( "glDrawBuffer" );
qglDrawElements = dllDrawElements =(void (__stdcall *)(unsigned int,int,unsigned int,const void *))GPA( "glDrawElements" );
qglDrawPixels = dllDrawPixels =(void (__stdcall *)(int,int,unsigned int,unsigned int,const void *))GPA( "glDrawPixels" );
qglEdgeFlag = dllEdgeFlag =(void (__stdcall *)(unsigned char))GPA( "glEdgeFlag" );
qglEdgeFlagPointer = dllEdgeFlagPointer =(void (__stdcall *)(int,const void *))GPA( "glEdgeFlagPointer" );
qglEdgeFlagv = dllEdgeFlagv =(void (__stdcall *)(const unsigned char *))GPA( "glEdgeFlagv" );
qglEnable = dllEnable =(void (__stdcall *)(unsigned int))GPA( "glEnable" );
qglEnableClientState = dllEnableClientState =(void (__stdcall *)(unsigned int))GPA( "glEnableClientState" );
qglEnd = dllEnd =(void (__stdcall *)(void))GPA( "glEnd" );
qglEndList = dllEndList =(void (__stdcall *)(void))GPA( "glEndList" );
qglEvalCoord1d = dllEvalCoord1d =(void (__stdcall *)(double))GPA( "glEvalCoord1d" );
qglEvalCoord1dv = dllEvalCoord1dv =(void (__stdcall *)(const double *))GPA( "glEvalCoord1dv" );
qglEvalCoord1f = dllEvalCoord1f =(void (__stdcall *)(float))GPA( "glEvalCoord1f" );
qglEvalCoord1fv = dllEvalCoord1fv =(void (__stdcall *)(const float *))GPA( "glEvalCoord1fv" );
qglEvalCoord2d = dllEvalCoord2d =(void (__stdcall *)(double,double))GPA( "glEvalCoord2d" );
qglEvalCoord2dv = dllEvalCoord2dv =(void (__stdcall *)(const double *))GPA( "glEvalCoord2dv" );
qglEvalCoord2f = dllEvalCoord2f =(void (__stdcall *)(float,float))GPA( "glEvalCoord2f" );
qglEvalCoord2fv = dllEvalCoord2fv =(void (__stdcall *)(const float *))GPA( "glEvalCoord2fv" );
qglEvalMesh1 = dllEvalMesh1 =(void (__stdcall *)(unsigned int,int,int))GPA( "glEvalMesh1" );
qglEvalMesh2 = dllEvalMesh2 =(void (__stdcall *)(unsigned int,int,int,int,int))GPA( "glEvalMesh2" );
qglEvalPoint1 = dllEvalPoint1 =(void (__stdcall *)(int))GPA( "glEvalPoint1" );
qglEvalPoint2 = dllEvalPoint2 =(void (__stdcall *)(int,int))GPA( "glEvalPoint2" );
qglFeedbackBuffer = dllFeedbackBuffer =(void (__stdcall *)(int,unsigned int,float *))GPA( "glFeedbackBuffer" );
qglFinish = dllFinish =(void (__stdcall *)(void))GPA( "glFinish" );
qglFlush = dllFlush =(void (__stdcall *)(void))GPA( "glFlush" );
qglFogf = dllFogf =(void (__stdcall *)(unsigned int,float))GPA( "glFogf" );
qglFogfv = dllFogfv =(void (__stdcall *)(unsigned int,const float *))GPA( "glFogfv" );
qglFogi = dllFogi =(void (__stdcall *)(unsigned int,int))GPA( "glFogi" );
qglFogiv = dllFogiv =(void (__stdcall *)(unsigned int,const int *))GPA( "glFogiv" );
qglFrontFace = dllFrontFace =(void (__stdcall *)(unsigned int))GPA( "glFrontFace" );
qglFrustum = dllFrustum =(void (__stdcall *)(double,double,double,double,double,double))GPA( "glFrustum" );
qglGenLists = dllGenLists =(unsigned int (__stdcall *)(int))GPA( "glGenLists" );
qglGenTextures = dllGenTextures =(void (__stdcall *)(int,unsigned int *))GPA( "glGenTextures" );
qglGetBooleanv = dllGetBooleanv =(void (__stdcall *)(unsigned int,unsigned char *))GPA( "glGetBooleanv" );
qglGetClipPlane = dllGetClipPlane =(void (__stdcall *)(unsigned int,double *))GPA( "glGetClipPlane" );
qglGetDoublev = dllGetDoublev =(void (__stdcall *)(unsigned int,double *))GPA( "glGetDoublev" );
qglGetError = dllGetError =(unsigned int (__stdcall *)(void))GPA( "glGetError" );
qglGetFloatv = dllGetFloatv =(void (__stdcall *)(unsigned int,float *))GPA( "glGetFloatv" );
qglGetIntegerv = dllGetIntegerv =(void (__stdcall *)(unsigned int,int *))GPA( "glGetIntegerv" );
qglGetLightfv = dllGetLightfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetLightfv" );
qglGetLightiv = dllGetLightiv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetLightiv" );
qglGetMapdv = dllGetMapdv =(void (__stdcall *)(unsigned int,unsigned int,double *))GPA( "glGetMapdv" );
qglGetMapfv = dllGetMapfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetMapfv" );
qglGetMapiv = dllGetMapiv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetMapiv" );
qglGetMaterialfv = dllGetMaterialfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetMaterialfv" );
qglGetMaterialiv = dllGetMaterialiv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetMaterialiv" );
qglGetPixelMapfv = dllGetPixelMapfv =(void (__stdcall *)(unsigned int,float *))GPA( "glGetPixelMapfv" );
qglGetPixelMapuiv = dllGetPixelMapuiv =(void (__stdcall *)(unsigned int,unsigned int *))GPA( "glGetPixelMapuiv" );
qglGetPixelMapusv = dllGetPixelMapusv =(void (__stdcall *)(unsigned int,unsigned short *))GPA( "glGetPixelMapusv" );
qglGetPointerv = dllGetPointerv =(void (__stdcall *)(unsigned int,void ** ))GPA( "glGetPointerv" );
qglGetPolygonStipple = dllGetPolygonStipple =(void (__stdcall *)(unsigned char *))GPA( "glGetPolygonStipple" );
qglGetString = dllGetString =(const unsigned char *(__stdcall *)(unsigned int))GPA( "glGetString" );
qglGetTexEnvfv = dllGetTexEnvfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetTexEnvfv" );
qglGetTexEnviv = dllGetTexEnviv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetTexEnviv" );
qglGetTexGendv = dllGetTexGendv =(void (__stdcall *)(unsigned int,unsigned int,double *))GPA( "glGetTexGendv" );
qglGetTexGenfv = dllGetTexGenfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetTexGenfv" );
qglGetTexGeniv = dllGetTexGeniv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetTexGeniv" );
qglGetTexImage = dllGetTexImage =(void (__stdcall *)(unsigned int,int,unsigned int,unsigned int,void *))GPA( "glGetTexImage" );
// qglGetTexLevelParameterfv = dllGetTexLevelParameterfv =(void (__stdcall *)(unsigned int,int,unsigned int,float *))GPA( "glGetTexLevelParameterfv" );
// qglGetTexLevelParameteriv = dllGetTexLevelParameteriv =(void (__stdcall *)(unsigned int,int,unsigned int,int *))GPA( "glGetTexLevelParameteriv" );
qglGetTexParameterfv = dllGetTexParameterfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetTexParameterfv" );
qglGetTexParameteriv = dllGetTexParameteriv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetTexParameteriv" );
qglHint = dllHint =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glHint" );
qglIndexMask = dllIndexMask =(void (__stdcall *)(unsigned int))GPA( "glIndexMask" );
qglIndexPointer = dllIndexPointer =(void (__stdcall *)(unsigned int,int,const void *))GPA( "glIndexPointer" );
qglIndexd = dllIndexd =(void (__stdcall *)(double))GPA( "glIndexd" );
qglIndexdv = dllIndexdv =(void (__stdcall *)(const double *))GPA( "glIndexdv" );
qglIndexf = dllIndexf =(void (__stdcall *)(float))GPA( "glIndexf" );
qglIndexfv = dllIndexfv =(void (__stdcall *)(const float *))GPA( "glIndexfv" );
qglIndexi = dllIndexi =(void (__stdcall *)(int))GPA( "glIndexi" );
qglIndexiv = dllIndexiv =(void (__stdcall *)(const int *))GPA( "glIndexiv" );
qglIndexs = dllIndexs =(void (__stdcall *)(short))GPA( "glIndexs" );
qglIndexsv = dllIndexsv =(void (__stdcall *)(const short *))GPA( "glIndexsv" );
qglIndexub = dllIndexub =(void (__stdcall *)(unsigned char))GPA( "glIndexub" );
qglIndexubv = dllIndexubv =(void (__stdcall *)(const unsigned char *))GPA( "glIndexubv" );
qglInitNames = dllInitNames =(void (__stdcall *)(void))GPA( "glInitNames" );
qglInterleavedArrays = dllInterleavedArrays =(void (__stdcall *)(unsigned int,int,const void *))GPA( "glInterleavedArrays" );
qglIsEnabled = dllIsEnabled =(unsigned char (__stdcall *)(unsigned int))GPA( "glIsEnabled" );
qglIsList = dllIsList =(unsigned char (__stdcall *)(unsigned int))GPA( "glIsList" );
qglIsTexture = dllIsTexture =(unsigned char (__stdcall *)(unsigned int))GPA( "glIsTexture" );
qglLightModelf = dllLightModelf =(void (__stdcall *)(unsigned int,float))GPA( "glLightModelf" );
qglLightModelfv = dllLightModelfv =(void (__stdcall *)(unsigned int,const float *))GPA( "glLightModelfv" );
qglLightModeli = dllLightModeli =(void (__stdcall *)(unsigned int,int))GPA( "glLightModeli" );
qglLightModeliv = dllLightModeliv =(void (__stdcall *)(unsigned int,const int *))GPA( "glLightModeliv" );
qglLightf = dllLightf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glLightf" );
qglLightfv = dllLightfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glLightfv" );
qglLighti = dllLighti =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glLighti" );
qglLightiv = dllLightiv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glLightiv" );
qglLineStipple = dllLineStipple =(void (__stdcall *)(int,unsigned short))GPA( "glLineStipple" );
qglLineWidth = dllLineWidth =(void (__stdcall *)(float))GPA( "glLineWidth" );
qglListBase = dllListBase =(void (__stdcall *)(unsigned int))GPA( "glListBase" );
qglLoadIdentity = dllLoadIdentity =(void (__stdcall *)(void))GPA( "glLoadIdentity" );
qglLoadMatrixd = dllLoadMatrixd =(void (__stdcall *)(const double *))GPA( "glLoadMatrixd" );
qglLoadMatrixf = dllLoadMatrixf =(void (__stdcall *)(const float *))GPA( "glLoadMatrixf" );
qglLoadName = dllLoadName =(void (__stdcall *)(unsigned int))GPA( "glLoadName" );
qglLogicOp = dllLogicOp =(void (__stdcall *)(unsigned int))GPA( "glLogicOp" );
qglMap1d = dllMap1d =(void (__stdcall *)(unsigned int,double,double,int,int,const double *))GPA( "glMap1d" );
qglMap1f = dllMap1f =(void (__stdcall *)(unsigned int,float,float,int,int,const float *))GPA( "glMap1f" );
qglMap2d = dllMap2d =(void (__stdcall *)(unsigned int,double,double,int,int,double,double,int,int,const double *))GPA( "glMap2d" );
qglMap2f = dllMap2f =(void (__stdcall *)(unsigned int,float,float,int,int,float,float,int,int,const float *))GPA( "glMap2f" );
qglMapGrid1d = dllMapGrid1d =(void (__stdcall *)(int,double,double))GPA( "glMapGrid1d" );
qglMapGrid1f = dllMapGrid1f =(void (__stdcall *)(int,float,float))GPA( "glMapGrid1f" );
qglMapGrid2d = dllMapGrid2d =(void (__stdcall *)(int,double,double,int,double,double))GPA( "glMapGrid2d" );
qglMapGrid2f = dllMapGrid2f =(void (__stdcall *)(int,float,float,int,float,float))GPA( "glMapGrid2f" );
qglMaterialf = dllMaterialf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glMaterialf" );
qglMaterialfv = dllMaterialfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glMaterialfv" );
qglMateriali = dllMateriali =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glMateriali" );
qglMaterialiv = dllMaterialiv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glMaterialiv" );
qglMatrixMode = dllMatrixMode =(void (__stdcall *)(unsigned int))GPA( "glMatrixMode" );
qglMultMatrixd = dllMultMatrixd =(void (__stdcall *)(const double *))GPA( "glMultMatrixd" );
qglMultMatrixf = dllMultMatrixf =(void (__stdcall *)(const float *))GPA( "glMultMatrixf" );
qglNewList = dllNewList =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glNewList" );
qglNormal3b = dllNormal3b =(void (__stdcall *)(signed char,signed char,signed char))GPA( "glNormal3b" );
qglNormal3bv = dllNormal3bv =(void (__stdcall *)(const signed char *))GPA( "glNormal3bv" );
qglNormal3d = dllNormal3d =(void (__stdcall *)(double,double,double))GPA( "glNormal3d" );
qglNormal3dv = dllNormal3dv =(void (__stdcall *)(const double *))GPA( "glNormal3dv" );
qglNormal3f = dllNormal3f =(void (__stdcall *)(float,float,float))GPA( "glNormal3f" );
qglNormal3fv = dllNormal3fv =(void (__stdcall *)(const float *))GPA( "glNormal3fv" );
qglNormal3i = dllNormal3i =(void (__stdcall *)(int,int,int))GPA( "glNormal3i" );
qglNormal3iv = dllNormal3iv =(void (__stdcall *)(const int *))GPA( "glNormal3iv" );
qglNormal3s = dllNormal3s =(void (__stdcall *)(short,short,short))GPA( "glNormal3s" );
qglNormal3sv = dllNormal3sv =(void (__stdcall *)(const short *))GPA( "glNormal3sv" );
qglNormalPointer = dllNormalPointer =(void (__stdcall *)(unsigned int,int,const void *))GPA( "glNormalPointer" );
qglOrtho = dllOrtho =(void (__stdcall *)(double,double,double,double,double,double))GPA( "glOrtho" );
qglPassThrough = dllPassThrough =(void (__stdcall *)(float))GPA( "glPassThrough" );
qglPixelMapfv = dllPixelMapfv =(void (__stdcall *)(unsigned int,int,const float *))GPA( "glPixelMapfv" );
qglPixelMapuiv = dllPixelMapuiv =(void (__stdcall *)(unsigned int,int,const unsigned int *))GPA( "glPixelMapuiv" );
qglPixelMapusv = dllPixelMapusv =(void (__stdcall *)(unsigned int,int,const unsigned short *))GPA( "glPixelMapusv" );
qglPixelStoref = dllPixelStoref =(void (__stdcall *)(unsigned int,float))GPA( "glPixelStoref" );
qglPixelStorei = dllPixelStorei =(void (__stdcall *)(unsigned int,int))GPA( "glPixelStorei" );
qglPixelTransferf = dllPixelTransferf =(void (__stdcall *)(unsigned int,float))GPA( "glPixelTransferf" );
qglPixelTransferi = dllPixelTransferi =(void (__stdcall *)(unsigned int,int))GPA( "glPixelTransferi" );
qglPixelZoom = dllPixelZoom =(void (__stdcall *)(float,float))GPA( "glPixelZoom" );
qglPointSize = dllPointSize =(void (__stdcall *)(float))GPA( "glPointSize" );
qglPolygonMode = dllPolygonMode =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glPolygonMode" );
qglPolygonOffset = dllPolygonOffset =(void (__stdcall *)(float,float))GPA( "glPolygonOffset" );
qglPolygonStipple = dllPolygonStipple =(void (__stdcall *)(const unsigned char *))GPA( "glPolygonStipple" );
qglPopAttrib = dllPopAttrib =(void (__stdcall *)(void))GPA( "glPopAttrib" );
qglPopClientAttrib = dllPopClientAttrib =(void (__stdcall *)(void))GPA( "glPopClientAttrib" );
qglPopMatrix = dllPopMatrix =(void (__stdcall *)(void))GPA( "glPopMatrix" );
qglPopName = dllPopName =(void (__stdcall *)(void))GPA( "glPopName" );
qglPrioritizeTextures = dllPrioritizeTextures =(void (__stdcall *)(int,const unsigned int *,const float *))GPA( "glPrioritizeTextures" );
qglPushAttrib = dllPushAttrib =(void (__stdcall *)(unsigned int))GPA( "glPushAttrib" );
qglPushClientAttrib = dllPushClientAttrib =(void (__stdcall *)(unsigned int))GPA( "glPushClientAttrib" );
qglPushMatrix = dllPushMatrix =(void (__stdcall *)(void))GPA( "glPushMatrix" );
qglPushName = dllPushName =(void (__stdcall *)(unsigned int))GPA( "glPushName" );
qglRasterPos2d = dllRasterPos2d =(void (__stdcall *)(double,double))GPA( "glRasterPos2d" );
qglRasterPos2dv = dllRasterPos2dv =(void (__stdcall *)(const double *))GPA( "glRasterPos2dv" );
qglRasterPos2f = dllRasterPos2f =(void (__stdcall *)(float,float))GPA( "glRasterPos2f" );
qglRasterPos2fv = dllRasterPos2fv =(void (__stdcall *)(const float *))GPA( "glRasterPos2fv" );
qglRasterPos2i = dllRasterPos2i =(void (__stdcall *)(int,int))GPA( "glRasterPos2i" );
qglRasterPos2iv = dllRasterPos2iv =(void (__stdcall *)(const int *))GPA( "glRasterPos2iv" );
qglRasterPos2s = dllRasterPos2s =(void (__stdcall *)(short,short))GPA( "glRasterPos2s" );
qglRasterPos2sv = dllRasterPos2sv =(void (__stdcall *)(const short *))GPA( "glRasterPos2sv" );
qglRasterPos3d = dllRasterPos3d =(void (__stdcall *)(double,double,double))GPA( "glRasterPos3d" );
qglRasterPos3dv = dllRasterPos3dv =(void (__stdcall *)(const double *))GPA( "glRasterPos3dv" );
qglRasterPos3f = dllRasterPos3f =(void (__stdcall *)(float,float,float))GPA( "glRasterPos3f" );
qglRasterPos3fv = dllRasterPos3fv =(void (__stdcall *)(const float *))GPA( "glRasterPos3fv" );
qglRasterPos3i = dllRasterPos3i =(void (__stdcall *)(int,int,int))GPA( "glRasterPos3i" );
qglRasterPos3iv = dllRasterPos3iv =(void (__stdcall *)(const int *))GPA( "glRasterPos3iv" );
qglRasterPos3s = dllRasterPos3s =(void (__stdcall *)(short,short,short))GPA( "glRasterPos3s" );
qglRasterPos3sv = dllRasterPos3sv =(void (__stdcall *)(const short *))GPA( "glRasterPos3sv" );
qglRasterPos4d = dllRasterPos4d =(void (__stdcall *)(double,double,double,double))GPA( "glRasterPos4d" );
qglRasterPos4dv = dllRasterPos4dv =(void (__stdcall *)(const double *))GPA( "glRasterPos4dv" );
qglRasterPos4f = dllRasterPos4f =(void (__stdcall *)(float,float,float,float))GPA( "glRasterPos4f" );
qglRasterPos4fv = dllRasterPos4fv =(void (__stdcall *)(const float *))GPA( "glRasterPos4fv" );
qglRasterPos4i = dllRasterPos4i =(void (__stdcall *)(int,int,int,int))GPA( "glRasterPos4i" );
qglRasterPos4iv = dllRasterPos4iv =(void (__stdcall *)(const int *))GPA( "glRasterPos4iv" );
qglRasterPos4s = dllRasterPos4s =(void (__stdcall *)(short,short,short,short))GPA( "glRasterPos4s" );
qglRasterPos4sv = dllRasterPos4sv =(void (__stdcall *)(const short *))GPA( "glRasterPos4sv" );
qglReadBuffer = dllReadBuffer =(void (__stdcall *)(unsigned int))GPA( "glReadBuffer" );
qglReadPixels = dllReadPixels =(void (__stdcall *)(int,int,int,int,unsigned int,unsigned int,void *))GPA( "glReadPixels" );
qglRectd = dllRectd =(void (__stdcall *)(double,double,double,double))GPA( "glRectd" );
qglRectdv = dllRectdv =(void (__stdcall *)(const double *,const double *))GPA( "glRectdv" );
qglRectf = dllRectf =(void (__stdcall *)(float,float,float,float))GPA( "glRectf" );
qglRectfv = dllRectfv =(void (__stdcall *)(const float *,const float *))GPA( "glRectfv" );
qglRecti = dllRecti =(void (__stdcall *)(int,int,int,int))GPA( "glRecti" );
qglRectiv = dllRectiv =(void (__stdcall *)(const int *,const int *))GPA( "glRectiv" );
qglRects = dllRects =(void (__stdcall *)(short,short,short,short))GPA( "glRects" );
qglRectsv = dllRectsv =(void (__stdcall *)(const short *,const short *))GPA( "glRectsv" );
qglRenderMode = dllRenderMode =(int (__stdcall *)(unsigned int))GPA( "glRenderMode" );
qglRotated = dllRotated =(void (__stdcall *)(double,double,double,double))GPA( "glRotated" );
qglRotatef = dllRotatef =(void (__stdcall *)(float,float,float,float))GPA( "glRotatef" );
qglScaled = dllScaled =(void (__stdcall *)(double,double,double))GPA( "glScaled" );
qglScalef = dllScalef =(void (__stdcall *)(float,float,float))GPA( "glScalef" );
qglScissor = dllScissor =(void (__stdcall *)(int,int,int,int))GPA( "glScissor" );
qglSelectBuffer = dllSelectBuffer =(void (__stdcall *)(int,unsigned int *))GPA( "glSelectBuffer" );
qglShadeModel = dllShadeModel =(void (__stdcall *)(unsigned int))GPA( "glShadeModel" );
qglStencilFunc = dllStencilFunc =(void (__stdcall *)(unsigned int,int,unsigned int))GPA( "glStencilFunc" );
qglStencilMask = dllStencilMask =(void (__stdcall *)(unsigned int))GPA( "glStencilMask" );
qglStencilOp = dllStencilOp =(void (__stdcall *)(unsigned int,unsigned int,unsigned int))GPA( "glStencilOp" );
qglTexCoord1d = dllTexCoord1d =(void (__stdcall *)(double))GPA( "glTexCoord1d" );
qglTexCoord1dv = dllTexCoord1dv =(void (__stdcall *)(const double *))GPA( "glTexCoord1dv" );
qglTexCoord1f = dllTexCoord1f =(void (__stdcall *)(float))GPA( "glTexCoord1f" );
qglTexCoord1fv = dllTexCoord1fv =(void (__stdcall *)(const float *))GPA( "glTexCoord1fv" );
qglTexCoord1i = dllTexCoord1i =(void (__stdcall *)(int))GPA( "glTexCoord1i" );
qglTexCoord1iv = dllTexCoord1iv =(void (__stdcall *)(const int *))GPA( "glTexCoord1iv" );
qglTexCoord1s = dllTexCoord1s =(void (__stdcall *)(short))GPA( "glTexCoord1s" );
qglTexCoord1sv = dllTexCoord1sv =(void (__stdcall *)(const short *))GPA( "glTexCoord1sv" );
qglTexCoord2d = dllTexCoord2d =(void (__stdcall *)(double,double))GPA( "glTexCoord2d" );
qglTexCoord2dv = dllTexCoord2dv =(void (__stdcall *)(const double *))GPA( "glTexCoord2dv" );
qglTexCoord2f = dllTexCoord2f =(void (__stdcall *)(float,float))GPA( "glTexCoord2f" );
qglTexCoord2fv = dllTexCoord2fv =(void (__stdcall *)(const float *))GPA( "glTexCoord2fv" );
qglTexCoord2i = dllTexCoord2i =(void (__stdcall *)(int,int))GPA( "glTexCoord2i" );
qglTexCoord2iv = dllTexCoord2iv =(void (__stdcall *)(const int *))GPA( "glTexCoord2iv" );
qglTexCoord2s = dllTexCoord2s =(void (__stdcall *)(short,short))GPA( "glTexCoord2s" );
qglTexCoord2sv = dllTexCoord2sv =(void (__stdcall *)(const short *))GPA( "glTexCoord2sv" );
qglTexCoord3d = dllTexCoord3d =(void (__stdcall *)(double,double,double))GPA( "glTexCoord3d" );
qglTexCoord3dv = dllTexCoord3dv =(void (__stdcall *)(const double *))GPA( "glTexCoord3dv" );
qglTexCoord3f = dllTexCoord3f =(void (__stdcall *)(float,float,float))GPA( "glTexCoord3f" );
qglTexCoord3fv = dllTexCoord3fv =(void (__stdcall *)(const float *))GPA( "glTexCoord3fv" );
qglTexCoord3i = dllTexCoord3i =(void (__stdcall *)(int,int,int))GPA( "glTexCoord3i" );
qglTexCoord3iv = dllTexCoord3iv =(void (__stdcall *)(const int *))GPA( "glTexCoord3iv" );
qglTexCoord3s = dllTexCoord3s =(void (__stdcall *)(short,short,short))GPA( "glTexCoord3s" );
qglTexCoord3sv = dllTexCoord3sv =(void (__stdcall *)(const short *))GPA( "glTexCoord3sv" );
qglTexCoord4d = dllTexCoord4d =(void (__stdcall *)(double,double,double,double))GPA( "glTexCoord4d" );
qglTexCoord4dv = dllTexCoord4dv =(void (__stdcall *)(const double *))GPA( "glTexCoord4dv" );
qglTexCoord4f = dllTexCoord4f =(void (__stdcall *)(float,float,float,float))GPA( "glTexCoord4f" );
qglTexCoord4fv = dllTexCoord4fv =(void (__stdcall *)(const float *))GPA( "glTexCoord4fv" );
qglTexCoord4i = dllTexCoord4i =(void (__stdcall *)(int,int,int,int))GPA( "glTexCoord4i" );
qglTexCoord4iv = dllTexCoord4iv =(void (__stdcall *)(const int *))GPA( "glTexCoord4iv" );
qglTexCoord4s = dllTexCoord4s =(void (__stdcall *)(short,short,short,short))GPA( "glTexCoord4s" );
qglTexCoord4sv = dllTexCoord4sv =(void (__stdcall *)(const short *))GPA( "glTexCoord4sv" );
qglTexCoordPointer = dllTexCoordPointer =(void (__stdcall *)(int,unsigned int,int,const void *))GPA( "glTexCoordPointer" );
qglTexEnvf = dllTexEnvf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glTexEnvf" );
qglTexEnvfv = dllTexEnvfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glTexEnvfv" );
qglTexEnvi = dllTexEnvi =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glTexEnvi" );
qglTexEnviv = dllTexEnviv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glTexEnviv" );
qglTexGend = dllTexGend =(void (__stdcall *)(unsigned int,unsigned int,double))GPA( "glTexGend" );
qglTexGendv = dllTexGendv =(void (__stdcall *)(unsigned int,unsigned int,const double *))GPA( "glTexGendv" );
qglTexGenf = dllTexGenf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glTexGenf" );
qglTexGenfv = dllTexGenfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glTexGenfv" );
qglTexGeni = dllTexGeni =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glTexGeni" );
qglTexGeniv = dllTexGeniv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glTexGeniv" );
qglTexImage1D = dllTexImage1D =(void (__stdcall *)(unsigned int,int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexImage1D" );
qglTexImage2D = dllTexImage2D =(void (__stdcall *)(unsigned int,int,int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexImage2D" );
qglTexParameterf = dllTexParameterf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glTexParameterf" );
qglTexParameterfv = dllTexParameterfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glTexParameterfv" );
qglTexParameteri = dllTexParameteri =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glTexParameteri" );
qglTexParameteriv = dllTexParameteriv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glTexParameteriv" );
qglTexSubImage1D = dllTexSubImage1D =(void (__stdcall *)(unsigned int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexSubImage1D" );
qglTexSubImage2D = dllTexSubImage2D =(void (__stdcall *)(unsigned int,int,int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexSubImage2D" );
qglTranslated = dllTranslated =(void (__stdcall *)(double,double,double))GPA( "glTranslated" );
qglTranslatef = dllTranslatef =(void (__stdcall *)(float,float,float))GPA( "glTranslatef" );
qglVertex2d = dllVertex2d =(void (__stdcall *)(double,double))GPA( "glVertex2d" );
qglVertex2dv = dllVertex2dv =(void (__stdcall *)(const double *))GPA( "glVertex2dv" );
qglVertex2f = dllVertex2f =(void (__stdcall *)(float,float))GPA( "glVertex2f" );
qglVertex2fv = dllVertex2fv =(void (__stdcall *)(const float *))GPA( "glVertex2fv" );
qglVertex2i = dllVertex2i =(void (__stdcall *)(int,int))GPA( "glVertex2i" );
qglVertex2iv = dllVertex2iv =(void (__stdcall *)(const int *))GPA( "glVertex2iv" );
qglVertex2s = dllVertex2s =(void (__stdcall *)(short,short))GPA( "glVertex2s" );
qglVertex2sv = dllVertex2sv =(void (__stdcall *)(const short *))GPA( "glVertex2sv" );
qglVertex3d = dllVertex3d =(void (__stdcall *)(double,double,double))GPA( "glVertex3d" );
qglVertex3dv = dllVertex3dv =(void (__stdcall *)(const double *))GPA( "glVertex3dv" );
qglVertex3f = dllVertex3f =(void (__stdcall *)(float,float,float))GPA( "glVertex3f" );
qglVertex3fv = dllVertex3fv =(void (__stdcall *)(const float *))GPA( "glVertex3fv" );
qglVertex3i = dllVertex3i =(void (__stdcall *)(int,int,int))GPA( "glVertex3i" );
qglVertex3iv = dllVertex3iv =(void (__stdcall *)(const int *))GPA( "glVertex3iv" );
qglVertex3s = dllVertex3s =(void (__stdcall *)(short,short,short))GPA( "glVertex3s" );
qglVertex3sv = dllVertex3sv =(void (__stdcall *)(const short *))GPA( "glVertex3sv" );
qglVertex4d = dllVertex4d =(void (__stdcall *)(double,double,double,double))GPA( "glVertex4d" );
qglVertex4dv = dllVertex4dv =(void (__stdcall *)(const double *))GPA( "glVertex4dv" );
qglVertex4f = dllVertex4f =(void (__stdcall *)(float,float,float,float))GPA( "glVertex4f" );
qglVertex4fv = dllVertex4fv =(void (__stdcall *)(const float *))GPA( "glVertex4fv" );
qglVertex4i = dllVertex4i =(void (__stdcall *)(int,int,int,int))GPA( "glVertex4i" );
qglVertex4iv = dllVertex4iv =(void (__stdcall *)(const int *))GPA( "glVertex4iv" );
qglVertex4s = dllVertex4s =(void (__stdcall *)(short,short,short,short))GPA( "glVertex4s" );
qglVertex4sv = dllVertex4sv =(void (__stdcall *)(const short *))GPA( "glVertex4sv" );
qglVertexPointer = dllVertexPointer =(void (__stdcall *)(int,unsigned int,int,const void *))GPA( "glVertexPointer" );
qglViewport = dllViewport =(void (__stdcall *)(int,int,int,int))GPA( "glViewport" );
qfxMesaCreateContext = GPA("fxMesaCreateContext");
qfxMesaCreateBestContext = GPA("fxMesaCreateBestContext");
qfxMesaDestroyContext = GPA("fxMesaDestroyContext");
qfxMesaMakeCurrent = GPA("fxMesaMakeCurrent");
qfxMesaGetCurrentContext = GPA("fxMesaGetCurrentContext");
qfxMesaSwapBuffers = GPA("fxMesaSwapBuffers");
qglXChooseVisual = GPA("glXChooseVisual");
qglXCreateContext = GPA("glXCreateContext");
qglXDestroyContext = GPA("glXDestroyContext");
qglXMakeCurrent = GPA("glXMakeCurrent");
qglXCopyContext = GPA("glXCopyContext");
qglXSwapBuffers = GPA("glXSwapBuffers");
qglXChooseVisual = (XVisualInfo *(__stdcall *)(Display *,int, int *))GPA("glXChooseVisual");
qglXCreateContext = (__GLXcontextRec *(__stdcall *)(Display *, XVisualInfo *,GLXContext, Bool))GPA("glXCreateContext");
qglXDestroyContext = (void (__stdcall *)(Display *, GLXContext))GPA("glXDestroyContext");
qglXMakeCurrent = (int (__stdcall *)(Display *, GLXDrawable, GLXContext))GPA("glXMakeCurrent");
qglXCopyContext = (void (__stdcall *)(Display *, GLXContext, GLXContext,GLuint))GPA("glXCopyContext");
qglXSwapBuffers = (void (__stdcall *)(Display *, GLXDrawable))GPA("glXSwapBuffers");
qglLockArraysEXT = 0;
qglUnlockArraysEXT = 0;
@ -3417,7 +3394,7 @@ void QGL_EnableLogging( qboolean enable )
asctime( newtime );
basedir = ri.Cvar_Get( "basedir", "", 0 );
basedir = Cvar_Get( "basedir", "", 0 );
Com_sprintf( buffer, sizeof(buffer), "%s/gl.log", basedir->string );
glw_state.log_fp = fopen( buffer, "wt" );

View file

@ -1,7 +1,3 @@
#ifndef __linux__
#error You shouldnt be including this file on non-Linux platforms
#endif
#ifndef __GLW_LINUX_H__
#define __GLW_LINUX_H__

9
code/unix/unix_local.h Normal file
View file

@ -0,0 +1,9 @@
void IN_Init (void);
void IN_Shutdown (void);
void IN_JoystickCommands (void);
void IN_Move (usercmd_t *cmd);
void IN_Frame (void);
void Sys_SendKeyEvents (void);
void Sys_QueEvent( int time, sysEventType_t type, int value, int value2, int ptrLength, void *ptr );

View file

@ -23,10 +23,14 @@
#include "../qcommon/qcommon.h"
#include "../renderer/tr_public.h"
#include "unix_local.h"
cvar_t *nostdout;
// Structure containing functions exported from refresh DLL
#if 0
refexport_t re;
#endif
unsigned sys_frame_time;
@ -37,6 +41,11 @@ qboolean stdin_active = qtrue;
// General routines
// =======================================================================
qboolean Sys_LowPhysicalMemory()
{
return qfalse;
}
void Sys_BeginProfiling( void ) {
}
@ -64,11 +73,11 @@ void Sys_ConsoleOutput (char *string)
void Sys_Printf (char *fmt, ...)
{
va_list argptr;
char text[1024];
char text[4096];
unsigned char *p;
va_start (argptr,fmt);
vsprintf (text,fmt,argptr);
vsnprintf (text,sizeof(text),fmt,argptr);
va_end (argptr);
if (strlen(text) > sizeof(text))
@ -97,13 +106,11 @@ void Sys_Init(void)
{
Cmd_AddCommand ("in_restart", Sys_In_Restart_f);
#if id386
Sys_SetFPCW();
#endif
#if defined __linux__
#if defined __i386__
Cvar_Set( "arch", "linux i386" );
#elif defined(__amd64__) || defined(__x86_64__)
Cvar_Set( "arch", "linux amd64" );
#elif defined __alpha__
Cvar_Set( "arch", "linux alpha" );
#elif defined __sparc__
@ -125,6 +132,14 @@ void Sys_Init(void)
#else
Cvar_Set( "arch", "sgi unknown" );
#endif
#elif defined __OpenBSD__
#if defined __i386__
Cvar_Set( "arch", "openbsd i386" );
#elif defined(__amd64__) || defined(__x86_64__)
Cvar_Set( "arch", "openbsd amd64" );
#else
Cvar_Set( "arch", "openbsd unknown" );
#endif
#else
Cvar_Set( "arch", "unknown" );
#endif
@ -193,8 +208,10 @@ char *Sys_ConsoleInput(void)
fd_set fdset;
struct timeval timeout;
#if 0
if (!com_dedicated || !com_dedicated->value)
return NULL;
#endif
if (!stdin_active)
return NULL;
@ -223,8 +240,11 @@ char *Sys_ConsoleInput(void)
static void *game_library;
#ifdef QAGAME
#ifdef __i386__
const char *gamename = "qagamei386.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *gamename = "qagameamd64.so";
#elif defined __alpha__
const char *gamename = "qagameaxp.so";
#elif defined __mips__
@ -232,6 +252,15 @@ static void *game_library;
#else
#error Unknown arch
#endif
#endif // QAGAME
#ifdef __i386__
const char *gamename = "jagamex86.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *gamename = "jagameamd64.so";
#else
#error Unknown arch
#endif
/*
=================
@ -278,9 +307,10 @@ void *Sys_GetGameAPI (void *parms)
Com_Error( ERR_FATAL, "Couldn't load game" );
}
GetGameAPI = (void *)dlsym (game_library, "GetGameAPI");
GetGameAPI = (void *(*)(void *))dlsym (game_library, "GetGameAPI");
if (!GetGameAPI)
{
Com_Error( ERR_FATAL, "dlsym GetGameAPI failed %s\n", dlerror());
Sys_UnloadGame ();
return NULL;
}
@ -288,6 +318,20 @@ void *Sys_GetGameAPI (void *parms)
return GetGameAPI (parms);
}
void * Sys_LoadCgame( int (**entryPoint)(int, ...), int (*systemcalls)(int, ...) )
{
void (*dllEntry)( int (*syscallptr)(int, ...) );
dllEntry = ( void (*)( int (*)( int, ... ) ) )dlsym( game_library, "dllEntry" );
*entryPoint = (int (*)(int,...))dlsym( game_library, "vmMain" );
if ( !*entryPoint || !dllEntry ) {
return NULL;
}
dllEntry( systemcalls );
return game_library;
}
/*****************************************************************************/
static void *cgame_library;
@ -313,12 +357,16 @@ Loads the game dll
*/
void *Sys_GetCGameAPI (void)
{
return (NULL);
#if 0
void *(*api) (void);
char name[MAX_OSPATH];
char curpath[MAX_OSPATH];
#ifdef __i386__
const char *cgamename = "cgamei386.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *cgamename = "cgameamd64.so";
#elif defined __alpha__
const char *cgamename = "cgameaxp.so";
#elif defined __mips__
@ -348,6 +396,7 @@ void *Sys_GetCGameAPI (void)
}
return api();
#endif
}
/*****************************************************************************/
@ -381,6 +430,8 @@ void *Sys_GetUIAPI (void)
char curpath[MAX_OSPATH];
#ifdef __i386__
const char *uiname = "uii386.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *uiname = "uiamd64.so";
#elif defined __alpha__
const char *uiname = "uiaxp.so";
#elif defined __mips__
@ -416,7 +467,10 @@ void *Sys_GetUIAPI (void)
void *Sys_GetRefAPI (void *parms)
{
return (NULL);
#if 0
return (void *)GetRefAPI(REF_API_VERSION, parms);
#endif
}
/*
@ -427,191 +481,33 @@ BACKGROUND FILE STREAMING
========================================================================
*/
typedef struct {
#if 0
HANDLE threadHandle;
int threadId;
CRITICAL_SECTION crit;
#endif
FILE *file;
byte *buffer;
qboolean eof;
int bufferSize;
int streamPosition; // next byte to be returned by Sys_StreamRead
int threadPosition; // next byte to be read from file
} streamState_t;
streamState_t stream;
/*
===============
Sys_StreamThread
A thread will be sitting in this loop forever
================
*/
void Sys_StreamThread( void )
{
int buffer;
int count;
int readCount;
int bufferPoint;
int r;
//Loop here
// EnterCriticalSection (&stream.crit);
// if there is any space left in the buffer, fill it up
if ( !stream.eof ) {
count = stream.bufferSize - (stream.threadPosition - stream.streamPosition);
if ( count ) {
bufferPoint = stream.threadPosition % stream.bufferSize;
buffer = stream.bufferSize - bufferPoint;
readCount = buffer < count ? buffer : count;
r = fread( stream.buffer + bufferPoint, 1, readCount, stream.file );
stream.threadPosition += r;
if ( r != readCount )
stream.eof = qtrue;
}
}
// LeaveCriticalSection (&stream.crit);
}
/*
===============
Sys_InitStreamThread
================
*/
void Sys_InitStreamThread( void )
{
}
/*
===============
Sys_ShutdownStreamThread
================
*/
void Sys_ShutdownStreamThread( void )
{
}
/*
===============
Sys_BeginStreamedFile
================
*/
void Sys_BeginStreamedFile( fileHandle_t f, int readAhead )
{
if ( stream.file ) {
Com_Error( ERR_FATAL, "Sys_BeginStreamedFile: unclosed stream");
}
stream.file = f;
stream.buffer = Z_Malloc( readAhead );
stream.bufferSize = readAhead;
stream.streamPosition = 0;
stream.threadPosition = 0;
stream.eof = qfalse;
// let the thread start running
// LeaveCriticalSection( &stream.crit );
}
/*
===============
Sys_EndStreamedFile
================
*/
void Sys_EndStreamedFile( FILE *f )
{
if ( f != stream.file ) {
Com_Error( ERR_FATAL, "Sys_EndStreamedFile: wrong file");
}
// don't leave critical section until another stream is started
// EnterCriticalSection( &stream.crit );
stream.file = NULL;
Z_Free( stream.buffer );
}
/*
===============
Sys_StreamedRead
================
*/
int Sys_StreamedRead( void *buffer, int size, int count, FILE *f )
{
int available;
int remaining;
int sleepCount;
int copy;
int bufferCount;
int bufferPoint;
byte *dest;
dest = (byte *)buffer;
remaining = size * count;
if ( remaining <= 0 ) {
Com_Error( ERR_FATAL, "Streamed read with non-positive size" );
}
sleepCount = 0;
while ( remaining > 0 ) {
available = stream.threadPosition - stream.streamPosition;
if ( !available ) {
if (stream.eof)
break;
Sys_StreamThread();
continue;
}
bufferPoint = stream.streamPosition % stream.bufferSize;
bufferCount = stream.bufferSize - bufferPoint;
copy = available < bufferCount ? available : bufferCount;
if ( copy > remaining ) {
copy = remaining;
}
memcpy( dest, stream.buffer + bufferPoint, copy );
stream.streamPosition += copy;
dest += copy;
remaining -= copy;
}
return (count * size - remaining) / size;
void Sys_EndStreamedFile( fileHandle_t f ) {
}
/*
===============
Sys_StreamSeek
================
*/
void Sys_StreamSeek( FILE *f, int offset, int origin ) {
// halt the thread
// EnterCriticalSection( &stream.crit );
// clear to that point
fseek( f, offset, origin );
stream.streamPosition = 0;
stream.threadPosition = 0;
stream.eof = qfalse;
// let the thread start running at the new position
// LeaveCriticalSection( &stream.crit );
int Sys_StreamedRead( void *buffer, int size, int count, fileHandle_t f ) {
return FS_Read( buffer, size * count, f );
}
void Sys_StreamSeek( fileHandle_t f, int offset, int origin ) {
FS_Seek( f, offset, origin );
}
/*
========================================================================
@ -684,7 +580,7 @@ sysEvent_t Sys_GetEvent( void ) {
int len;
len = strlen( s ) + 1;
b = malloc( len );
b = (char *)malloc( len );
strcpy( b, s );
Sys_QueEvent( 0, SE_CONSOLE, 0, 0, len, b );
}
@ -694,6 +590,7 @@ sysEvent_t Sys_GetEvent( void ) {
// check for network packets
MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) );
#if 0
if ( Sys_GetPacket ( &adr, &netmsg ) ) {
netadr_t *buf;
int len;
@ -705,6 +602,7 @@ sysEvent_t Sys_GetEvent( void ) {
memcpy( buf+1, netmsg.data, netmsg.cursize );
Sys_QueEvent( 0, SE_PACKET, 0, 0, len, buf );
}
#endif
// return if we have data
if ( eventHead > eventTail ) {
@ -752,7 +650,7 @@ int main (int argc, char **argv)
// merge the command line, this is kinda silly
for (len = 1, i = 1; i < argc; i++)
len += strlen(argv[i]) + 1;
cmdline = malloc(len);
cmdline = (char *)malloc(len);
*cmdline = 0;
for (i = 1; i < argc; i++) {
if (i > 1)
@ -760,7 +658,9 @@ int main (int argc, char **argv)
strcat(cmdline, argv[i]);
}
Com_Init(cmdline);
#if 0
NET_Init();
#endif
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
@ -774,7 +674,9 @@ int main (int argc, char **argv)
{
// set low precision every frame, because some system calls
// reset it arbitrarily
#if 0
Sys_LowFPPrecision ();
#endif
Com_Frame ();
}

View file

@ -12,6 +12,8 @@
//===============================================================================
int glob_match(char *pattern, char *text);
// Used to determine CD Path
static char programpath[MAX_OSPATH];
@ -279,7 +281,7 @@ char **Sys_ListFiles( const char *directory, const char *extension, int *numfile
return NULL;
}
listCopy = Z_Malloc( ( nfiles + 1 ) * sizeof( *listCopy ) );
listCopy = (char **) Z_Malloc( ( nfiles + 1 ) * sizeof( *listCopy ), TAG_LISTFILES, qfalse );
for ( i = 0 ; i < nfiles ; i++ ) {
listCopy[i] = list[i];
}
@ -302,6 +304,11 @@ void Sys_FreeFileList( char **list ) {
Z_Free( list );
}
qboolean Sys_CheckCD( void )
{
return qtrue;
}
char *Sys_Cwd( void )
{
static char cwd[MAX_OSPATH];
@ -337,7 +344,7 @@ char *Sys_DefaultBasePath(void)
if ((p = getenv("HOME")) != NULL) {
Q_strncpyz(basepath, p, sizeof(basepath));
Q_strcat(basepath, sizeof(basepath), "/.q3a");
Q_strcat(basepath, sizeof(basepath), "/.jasp");
if (mkdir(basepath, 0777)) {
if (errno != EEXIST)
Sys_Error("Unable to create directory \"%s\", error is %s(%d)\n", basepath, strerror(errno), errno);
@ -358,4 +365,13 @@ void Sys_ShowConsole( int visLevel, qboolean quitOnClose )
{
}
qboolean Sys_FileOutOfDate( LPCSTR psFinalFileName /* dest */, LPCSTR psDataFileName /* src */ )
{
return false;
}
qboolean Sys_CopyFile(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, qboolean bOverWrite)
{
Com_Error( ERR_FATAL, "Sys_CopyFile not implemented" );
return qfalse;
}