Always link the Windows binaries against OpenGL

Just as with every other platform.
This commit is contained in:
dhewg 2011-12-29 17:13:29 +01:00
parent 21f6eeaaeb
commit 3be7fae15c
9 changed files with 21 additions and 2849 deletions

View file

@ -663,7 +663,6 @@ elseif (WIN32)
sys/win32/win_input.cpp
sys/win32/win_main.cpp
sys/win32/win_net.cpp
sys/win32/win_qgl.cpp
sys/win32/win_shared.cpp
sys/win32/win_syscon.cpp
sys/win32/win_taskkeyhook.cpp

View file

@ -1673,11 +1673,7 @@ PurgeImage
*/
void idImage::PurgeImage() {
if ( texnum != TEXTURE_NOT_LOADED ) {
#ifdef _WIN32
// sometimes is NULL when exiting with an error
if ( qglDeleteTextures )
#endif
qglDeleteTextures( 1, &texnum ); // this should be the ONLY place it is ever called!
qglDeleteTextures( 1, &texnum ); // this should be the ONLY place it is ever called!
texnum = TEXTURE_NOT_LOADED;
}

View file

@ -52,7 +52,6 @@ glconfig_t glConfig;
const char *r_rendererArgs[] = { "best", "arb", "arb2", "Cg", "exp", "nv10", "nv20", "r200", NULL };
idCVar r_inhibitFragmentProgram( "r_inhibitFragmentProgram", "0", CVAR_RENDERER | CVAR_BOOL, "ignore the fragment program extension" );
idCVar r_glDriver( "r_glDriver", "", CVAR_RENDERER, "\"opengl32\", etc." );
idCVar r_useLightPortalFlow( "r_useLightPortalFlow", "1", CVAR_RENDERER | CVAR_BOOL, "use a more precise area reference determination" );
idCVar r_multiSamples( "r_multiSamples", "0", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_INTEGER, "number of antialiasing samples" );
idCVar r_mode( "r_mode", "3", CVAR_ARCHIVE | CVAR_RENDERER | CVAR_INTEGER, "video mode number" );

View file

@ -166,7 +166,7 @@ extern PFNGLDEPTHBOUNDSEXTPROC qglDepthBoundsEXT;
//===========================================================================
// non-windows systems will just redefine qgl* to gl*
#ifndef _WIN32
#if 1
#include "qgl_linked.h"
@ -540,6 +540,6 @@ extern int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int,
extern BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL);
extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
#endif // _WIN32
#endif
#endif

View file

@ -363,6 +363,13 @@ If you have questions concerning this license or the applicable additional terms
#define qglVertexPointer glVertexPointer
#define qglViewport glViewport
#ifdef _WIN32
#define qwglCreateContext wglCreateContext
#define qwglDeleteContext wglDeleteContext
#define qwglMakeCurrent wglMakeCurrent
#define qwglSwapBuffers SwapBuffers
#define qwglGetProcAddress wglGetProcAddress
#else
#ifdef GLX_VERSION_1_1 // catch all for any GLX-aware situation
#define qglXChooseVisual glXChooseVisual
#define qglXCreateContext glXCreateContext
@ -371,3 +378,4 @@ If you have questions concerning this license or the applicable additional terms
#define qglXSwapBuffers glXSwapBuffers
#define qglXGetProcAddressARB glXGetProcAddressARB
#endif
#endif

View file

@ -817,7 +817,6 @@ extern glconfig_t glConfig; // outside of TR since it shouldn't be cleared du
//
extern idCVar r_ext_vertex_array_range;
extern idCVar r_glDriver; // "opengl32", etc
extern idCVar r_mode; // video mode number
extern idCVar r_displayRefresh; // optional display refresh rate option for vid mode
extern idCVar r_fullscreen; // 0 = windowed, 1 = full screen

View file

@ -115,16 +115,6 @@ PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB;
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
//
// function declaration
//
bool QGL_Init( const char *dllname );
void QGL_Shutdown( void );
/*
========================
GLimp_GetOldGammaRamp
@ -743,7 +733,15 @@ static bool GLW_SetFullScreen( glimpParms_t parms ) {
return false;
}
/*
==================
GLimp_EnableLogging
==================
*/
void GLimp_EnableLogging( bool enable ) {
common->DPrintf("GLimp_EnableLogging - not available\n");
}
/*
===================
@ -761,7 +759,6 @@ parameters and try again.
===================
*/
bool GLimp_Init( glimpParms_t parms ) {
const char *driverName;
HDC hDC;
common->Printf( "Initializing OpenGL subsystem\n" );
@ -789,15 +786,6 @@ bool GLimp_Init( glimpParms_t parms ) {
// this will load the dll and set all our qgl* function pointers,
// but doesn't create a window
// r_glDriver is only intended for using instrumented OpenGL
// dlls. Normal users should never have to use it, and it is
// not archived.
driverName = r_glDriver.GetString()[0] ? r_glDriver.GetString() : "opengl32";
if ( !QGL_Init( driverName ) ) {
common->Printf( "^3GLimp_Init() could not load r_glDriver \"%s\"^0\n", driverName );
return false;
}
// getting the wgl extensions involves creating a fake window to get a context,
// which is pretty disgusting, and seems to mess with the AGP VAR allocation
GLW_GetWGLExtensionsWithFakeWindow();
@ -919,10 +907,8 @@ void GLimp_Shutdown( void ) {
common->Printf( "Shutting down OpenGL subsystem\n" );
// set current context to NULL
if ( qwglMakeCurrent ) {
retVal = qwglMakeCurrent( NULL, NULL ) != 0;
common->Printf( "...wglMakeCurrent( NULL, NULL ): %s\n", success[retVal] );
}
retVal = qwglMakeCurrent( NULL, NULL ) != 0;
common->Printf( "...wglMakeCurrent( NULL, NULL ): %s\n", success[retVal] );
// delete HGLRC
if ( win32.hGLRC ) {
@ -955,9 +941,6 @@ void GLimp_Shutdown( void ) {
// restore gamma
GLimp_RestoreGamma();
// shutdown QGL subsystem
QGL_Shutdown();
}

View file

@ -117,8 +117,6 @@ struct Win32Vars_t {
PIXELFORMATDESCRIPTOR pfd;
int pixelformat;
HINSTANCE hinstOpenGL; // HINSTANCE for the OpenGL library
int desktopBitsPixel;
int desktopWidth, desktopHeight;

File diff suppressed because it is too large Load diff