Rename gl_libgl to gl_driver, nuke the last of the HAVE_GLX references,

and default gl_driver to OPENGL32.DLL on Win32.
This commit is contained in:
Jeff Teunissen 2001-09-28 07:41:38 +00:00
parent 1a3a599ab3
commit e892131af5
7 changed files with 27 additions and 28 deletions

View file

@ -20,7 +20,7 @@ extern struct cvar_s *gl_fb_models;
extern struct cvar_s *gl_fires; extern struct cvar_s *gl_fires;
extern struct cvar_s *gl_keeptjunctions; extern struct cvar_s *gl_keeptjunctions;
extern struct cvar_s *gl_lerp_anim; extern struct cvar_s *gl_lerp_anim;
extern struct cvar_s *gl_libgl; extern struct cvar_s *gl_driver;
extern struct cvar_s *gl_lightmap_align; extern struct cvar_s *gl_lightmap_align;
extern struct cvar_s *gl_lightmap_subimage; extern struct cvar_s *gl_lightmap_subimage;
extern struct cvar_s *gl_max_size; extern struct cvar_s *gl_max_size;

View file

@ -65,14 +65,14 @@ GLF_Init (void)
void *handle; void *handle;
#if defined(HAVE_DLOPEN) #if defined(HAVE_DLOPEN)
if (!(handle = dlopen (gl_libgl->string, RTLD_NOW))) { if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_libgl->string, Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_driver->string,
dlerror ()); dlerror ());
return false; return false;
} }
#elif defined(_WIN32) #elif defined(_WIN32)
if (!(handle = LoadLibrary (gl_libgl->string))) { if (!(handle = LoadLibrary (gl_driver->string))) {
Sys_Error ("Couldn't load OpenGL library %s!\n", gl_libgl->string); Sys_Error ("Couldn't load OpenGL library %s!\n", gl_driver->string);
return false; return false;
} }
#else #else

View file

@ -64,7 +64,7 @@ cvar_t *gl_fb_models;
cvar_t *gl_fires; cvar_t *gl_fires;
cvar_t *gl_keeptjunctions; cvar_t *gl_keeptjunctions;
cvar_t *gl_lerp_anim; cvar_t *gl_lerp_anim;
cvar_t *gl_libgl; cvar_t *gl_driver;
cvar_t *gl_lightmap_align; cvar_t *gl_lightmap_align;
cvar_t *gl_lightmap_subimage; cvar_t *gl_lightmap_subimage;
cvar_t *gl_max_size; cvar_t *gl_max_size;
@ -193,8 +193,13 @@ R_Init_Cvars (void)
"upon level load"); "upon level load");
gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL, gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL,
"Toggles model animation interpolation"); "Toggles model animation interpolation");
gl_libgl = Cvar_Get ("gl_libgl", "libGL.so.1", CVAR_ROM, NULL,
"The GL library to use. (path optional)"); #ifdef _WIN32
gl_driver = Cvar_Get ("gl_driver", "OPENGL32.DLL", CVAR_ROM, NULL,
#else
gl_driver = Cvar_Get ("gl_driver", "libGL.so.1", CVAR_ROM, NULL,
#endif
"The OpenGL library to use. (path optional)");
gl_lightmap_align = Cvar_Get ("gl_lightmap_align", "1", CVAR_NONE, NULL, gl_lightmap_align = Cvar_Get ("gl_lightmap_align", "1", CVAR_NONE, NULL,
"Workaround for nvidia slow path. Set to 4 " "Workaround for nvidia slow path. Set to 4 "
"or 16 if you have an nvidia 3d " "or 16 if you have an nvidia 3d "

View file

@ -113,21 +113,17 @@ QFGL_ExtensionAddress (const char *name)
{ {
void *handle; void *handle;
static qboolean glProcAddress_present = true; static qboolean glProcAddress_present = true;
#if defined(HAVE_GLX)
static QF_glXGetProcAddressARB glGetProcAddress = NULL; static QF_glXGetProcAddressARB glGetProcAddress = NULL;
#else
static void * (* glGetProcAddress) (const char *) = NULL;
#endif
#if defined(HAVE_DLOPEN) #if defined(HAVE_DLOPEN)
if (!(handle = dlopen (gl_libgl->string, RTLD_NOW))) { if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_libgl->string, Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_driver->string,
dlerror ()); dlerror ());
return 0; return 0;
} }
#elif defined(_WIN32) #elif defined(_WIN32)
if (!(handle = LoadLibrary (gl_libgl->string))) { if (!(handle = LoadLibrary (gl_driver->string))) {
Sys_Error ("Couldn't load OpenGL library %s!\n", gl_libgl->string); Sys_Error ("Couldn't load OpenGL library %s!\n", gl_driver->string);
return 0; return 0;
} }
#else #else
@ -135,12 +131,10 @@ QFGL_ExtensionAddress (const char *name)
#endif #endif
if (glProcAddress_present && !glGetProcAddress) { if (glProcAddress_present && !glGetProcAddress) {
#if defined(HAVE_GLX) #if defined (_WIN32)
glGetProcAddress = glGetProcAddress = QFGL_ProcAddress (handle, "wglGetProcAddress", false);
QFGL_ProcAddress (handle, "glXGetProcAddressARB", false); #else
#elif defined (_WIN32) glGetProcAddress = QFGL_ProcAddress (handle, "glXGetProcAddressARB", false);
glGetProcAddress =
QFGL_ProcAddress (handle, "wglGetProcAddress", false);
#endif #endif
if (!glGetProcAddress) if (!glGetProcAddress)
glProcAddress_present = false; glProcAddress_present = false;

View file

@ -265,8 +265,8 @@ VID_Init (unsigned char *palette)
GLint attribs[32]; GLint attribs[32];
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
if (!(libgl_handle = dlopen (gl_libgl->string, RTLD_NOW))) { if (!(libgl_handle = dlopen (gl_driver->string, RTLD_NOW))) {
Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_libgl->string, Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_driver->string,
dlerror()); dlerror());
return; return;
} }

View file

@ -144,8 +144,8 @@ VID_Init (unsigned char *palette)
}; };
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
if (!(libgl_handle = dlopen (gl_libgl->string, RTLD_NOW))) { if (!(libgl_handle = dlopen (gl_driver->string, RTLD_NOW))) {
Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_libgl->string, Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_driver->string,
dlerror()); dlerror());
return; return;
} }

View file

@ -1138,8 +1138,8 @@ VID_Init (unsigned char *palette)
HGLRC baseRC; HGLRC baseRC;
DWORD lasterror; DWORD lasterror;
if (!(libgl_handle = LoadLibrary (gl_libgl->string))) { if (!(libgl_handle = LoadLibrary (gl_driver->string))) {
Sys_Error ("Can't open OpenGL library \"%s\"\n", gl_libgl->string); Sys_Error ("Can't open OpenGL library \"%s\"\n", gl_driver->string);
return; return;
} }