Removed GL_OpenLibrary and GL_CloseLibrary from "vid.h" and "vid_null.c"
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 31 Mar 2005 05:41:44 +0000 (05:41 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 31 Mar 2005 05:41:44 +0000 (05:41 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5134 d7cf8633-e32d-0410-b094-e92efae38249

vid.h
vid_glx.c
vid_null.c
vid_wgl.c

diff --git a/vid.h b/vid.h
index dbaa81a..e845edd 100644 (file)
--- a/vid.h
+++ b/vid.h
@@ -96,8 +96,6 @@ extern qboolean isRagePro;
 // LordHavoc: GLX_SGI_swap_control and WGL_EXT_swap_control
 extern int gl_videosyncavailable;
 
-int GL_OpenLibrary(const char *name);
-void GL_CloseLibrary(void);
 void *GL_GetProcAddress(const char *name);
 int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char *disableparm, int silent);
 
index 70336a9..aa86a16 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -551,6 +551,43 @@ static void IN_ActivateMouse( void )
        }
 }
 
+static void *prjobj = NULL;
+
+static void GL_CloseLibrary(void)
+{
+       if (prjobj)
+               dlclose(prjobj);
+       prjobj = NULL;
+       gl_driver[0] = 0;
+       qglXGetProcAddressARB = NULL;
+       gl_extensions = "";
+       gl_platform = "";
+       gl_platformextensions = "";
+}
+
+static int GL_OpenLibrary(const char *name)
+{
+       Con_Printf("Loading OpenGL driver %s\n", name);
+       GL_CloseLibrary();
+       if (!(prjobj = dlopen(name, RTLD_LAZY)))
+       {
+               Con_Printf("Unable to open symbol list for %s\n", name);
+               return false;
+       }
+       strcpy(gl_driver, name);
+       return true;
+}
+
+void *GL_GetProcAddress(const char *name)
+{
+       void *p = NULL;
+       if (qglXGetProcAddressARB != NULL)
+               p = (void *) qglXGetProcAddressARB(name);
+       if (p == NULL)
+               p = (void *) dlsym(prjobj, name);
+       return p;
+}
+
 void VID_Shutdown(void)
 {
        if (!ctx || !vidx11_display)
@@ -907,41 +944,3 @@ void IN_Move (void)
        mouse_x = 0;
        mouse_y = 0;
 }
-
-static void *prjobj = NULL;
-
-int GL_OpenLibrary(const char *name)
-{
-       Con_Printf("Loading OpenGL driver %s\n", name);
-       GL_CloseLibrary();
-       if (!(prjobj = dlopen(name, RTLD_LAZY)))
-       {
-               Con_Printf("Unable to open symbol list for %s\n", name);
-               return false;
-       }
-       strcpy(gl_driver, name);
-       return true;
-}
-
-void GL_CloseLibrary(void)
-{
-       if (prjobj)
-               dlclose(prjobj);
-       prjobj = NULL;
-       gl_driver[0] = 0;
-       qglXGetProcAddressARB = NULL;
-       gl_extensions = "";
-       gl_platform = "";
-       gl_platformextensions = "";
-}
-
-void *GL_GetProcAddress(const char *name)
-{
-       void *p = NULL;
-       if (qglXGetProcAddressARB != NULL)
-               p = (void *) qglXGetProcAddressARB(name);
-       if (p == NULL)
-               p = (void *) dlsym(prjobj, name);
-       return p;
-}
-
index 7daea1e..19af599 100644 (file)
@@ -80,15 +80,6 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
        return false;
 }
 
-int GL_OpenLibrary(const char *name)
-{
-       return false;
-}
-
-void GL_CloseLibrary(void)
-{
-}
-
 void *GL_GetProcAddress(const char *name)
 {
        return NULL;
index 1595e79..b76da3d 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -693,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();
@@ -706,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;