@@ -701,7+693,18 @@ int VID_GetGamma(unsigned short *ramps)
static HINSTANCE gldll;
-int GL_OpenLibrary(const char *name)
+static void GL_CloseLibrary(void)
+{
+ FreeLibrary(gldll);
+ gldll = 0;
+ gl_driver[0] = 0;
+ qwglGetProcAddress = NULL;
+ gl_extensions = "";
+ gl_platform = "";
+ gl_platformextensions = "";
+}
+
+static int GL_OpenLibrary(const char *name)
{
Con_Printf("Loading OpenGL driver %s\n", name);
GL_CloseLibrary();
@@ -714,17+717,6 @@ int GL_OpenLibrary(const char *name)
return true;
}
-void GL_CloseLibrary(void)
-{
- FreeLibrary(gldll);
- gldll = 0;
- gl_driver[0] = 0;
- qwglGetProcAddress = NULL;
- gl_extensions = "";
- gl_platform = "";
- gl_platformextensions = "";
-}
-
void *GL_GetProcAddress(const char *name)
{
void *p = NULL;
@@ -790,7+782,6 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
};
int pixelformat;
DWORD WindowStyle, ExWindowStyle;
- HGLRC baseRC;
int CenterX, CenterY;
const char *gldrivername;
int depth;
@@ -811,6+802,7 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
}
gldrivername = "opengl32.dll";
+// COMMANDLINEOPTION: Windows WGL: -gl_driver <drivername> selects a GL driver library, default is opengl32.dll, useful only for 3dfxogl.dll or 3dfxvgl.dll, if you don't know what this is for, you don't need it
i = COM_CheckParm("-gl_driver");
if (i && i < com_argc - 1)
gldrivername = com_argv[i + 1];
@@ -934,19+926,19 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
// fix the leftover Alt from any Alt-Tab or the like that switched us away
ClearAllStates ();
- hdc = GetDC(mainwindow);
+ baseDC = GetDC(mainwindow);
- if ((pixelformat = ChoosePixelFormat(hdc, &pfd)) == 0)
+ if ((pixelformat = ChoosePixelFormat(baseDC, &pfd)) == 0)