mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
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:
parent
1a3a599ab3
commit
e892131af5
7 changed files with 27 additions and 28 deletions
|
@ -20,7 +20,7 @@ extern struct cvar_s *gl_fb_models;
|
|||
extern struct cvar_s *gl_fires;
|
||||
extern struct cvar_s *gl_keeptjunctions;
|
||||
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_subimage;
|
||||
extern struct cvar_s *gl_max_size;
|
||||
|
|
|
@ -65,14 +65,14 @@ GLF_Init (void)
|
|||
void *handle;
|
||||
|
||||
#if defined(HAVE_DLOPEN)
|
||||
if (!(handle = dlopen (gl_libgl->string, RTLD_NOW))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_libgl->string,
|
||||
if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_driver->string,
|
||||
dlerror ());
|
||||
return false;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
if (!(handle = LoadLibrary (gl_libgl->string))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s!\n", gl_libgl->string);
|
||||
if (!(handle = LoadLibrary (gl_driver->string))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s!\n", gl_driver->string);
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -64,7 +64,7 @@ cvar_t *gl_fb_models;
|
|||
cvar_t *gl_fires;
|
||||
cvar_t *gl_keeptjunctions;
|
||||
cvar_t *gl_lerp_anim;
|
||||
cvar_t *gl_libgl;
|
||||
cvar_t *gl_driver;
|
||||
cvar_t *gl_lightmap_align;
|
||||
cvar_t *gl_lightmap_subimage;
|
||||
cvar_t *gl_max_size;
|
||||
|
@ -193,8 +193,13 @@ R_Init_Cvars (void)
|
|||
"upon level load");
|
||||
gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL,
|
||||
"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,
|
||||
"Workaround for nvidia slow path. Set to 4 "
|
||||
"or 16 if you have an nvidia 3d "
|
||||
|
|
|
@ -113,21 +113,17 @@ QFGL_ExtensionAddress (const char *name)
|
|||
{
|
||||
void *handle;
|
||||
static qboolean glProcAddress_present = true;
|
||||
#if defined(HAVE_GLX)
|
||||
static QF_glXGetProcAddressARB glGetProcAddress = NULL;
|
||||
#else
|
||||
static void * (* glGetProcAddress) (const char *) = NULL;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DLOPEN)
|
||||
if (!(handle = dlopen (gl_libgl->string, RTLD_NOW))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_libgl->string,
|
||||
if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_driver->string,
|
||||
dlerror ());
|
||||
return 0;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
if (!(handle = LoadLibrary (gl_libgl->string))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s!\n", gl_libgl->string);
|
||||
if (!(handle = LoadLibrary (gl_driver->string))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s!\n", gl_driver->string);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
@ -135,12 +131,10 @@ QFGL_ExtensionAddress (const char *name)
|
|||
#endif
|
||||
|
||||
if (glProcAddress_present && !glGetProcAddress) {
|
||||
#if defined(HAVE_GLX)
|
||||
glGetProcAddress =
|
||||
QFGL_ProcAddress (handle, "glXGetProcAddressARB", false);
|
||||
#elif defined (_WIN32)
|
||||
glGetProcAddress =
|
||||
QFGL_ProcAddress (handle, "wglGetProcAddress", false);
|
||||
#if defined (_WIN32)
|
||||
glGetProcAddress = QFGL_ProcAddress (handle, "wglGetProcAddress", false);
|
||||
#else
|
||||
glGetProcAddress = QFGL_ProcAddress (handle, "glXGetProcAddressARB", false);
|
||||
#endif
|
||||
if (!glGetProcAddress)
|
||||
glProcAddress_present = false;
|
||||
|
|
|
@ -265,8 +265,8 @@ VID_Init (unsigned char *palette)
|
|||
GLint attribs[32];
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
if (!(libgl_handle = dlopen (gl_libgl->string, RTLD_NOW))) {
|
||||
Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_libgl->string,
|
||||
if (!(libgl_handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
||||
Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_driver->string,
|
||||
dlerror());
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -144,8 +144,8 @@ VID_Init (unsigned char *palette)
|
|||
};
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
if (!(libgl_handle = dlopen (gl_libgl->string, RTLD_NOW))) {
|
||||
Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_libgl->string,
|
||||
if (!(libgl_handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
||||
Sys_Error ("Can't open OpenGL library \"%s\": %s\n", gl_driver->string,
|
||||
dlerror());
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1138,8 +1138,8 @@ VID_Init (unsigned char *palette)
|
|||
HGLRC baseRC;
|
||||
DWORD lasterror;
|
||||
|
||||
if (!(libgl_handle = LoadLibrary (gl_libgl->string))) {
|
||||
Sys_Error ("Can't open OpenGL library \"%s\"\n", gl_libgl->string);
|
||||
if (!(libgl_handle = LoadLibrary (gl_driver->string))) {
|
||||
Sys_Error ("Can't open OpenGL library \"%s\"\n", gl_driver->string);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue