src/video/x11/SDL_x11dyn.c
changeset 1589 34cca785be57
parent 1587 7fd9fc1f2be5
child 1593 5115439d67b1
     1.1 --- a/src/video/x11/SDL_x11dyn.c	Wed Mar 22 09:18:10 2006 +0000
     1.2 +++ b/src/video/x11/SDL_x11dyn.c	Wed Mar 22 11:13:58 2006 +0000
     1.3 @@ -21,13 +21,11 @@
     1.4  */
     1.5  #include "SDL_config.h"
     1.6  
     1.7 -#if 0
     1.8 -#define DEBUG_DYNAMIC_X11 1
     1.9 -#endif
    1.10 +#define DEBUG_DYNAMIC_X11 0
    1.11  
    1.12  #include "SDL_x11dyn.h"
    1.13  
    1.14 -#ifdef DEBUG_DYNAMIC_X11
    1.15 +#if DEBUG_DYNAMIC_X11
    1.16  #include <stdio.h>
    1.17  #endif
    1.18  
    1.19 @@ -39,6 +37,10 @@
    1.20  static void *x11_handle = NULL;
    1.21  static const char *x11ext_library = SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT;
    1.22  static void *x11ext_handle = NULL;
    1.23 +static const char *xrender_library = SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER;
    1.24 +static void *xrender_handle = NULL;
    1.25 +static const char *xrandr_library = SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR;
    1.26 +static void *xrandr_handle = NULL;
    1.27  
    1.28  typedef struct
    1.29  {
    1.30 @@ -54,6 +56,8 @@
    1.31  	{
    1.32  		{ x11_handle, "libX11" },
    1.33  		{ x11ext_handle, "libX11ext" },
    1.34 +		{ xrender_handle, "libXrender" },
    1.35 +		{ xrandr_handle, "libXrandr" },
    1.36  	};
    1.37  
    1.38  	for (i = 0; i < (sizeof (libs) / sizeof (libs[0])); i++)
    1.39 @@ -130,6 +134,14 @@
    1.40  				SDL_UnloadObject(x11ext_handle);
    1.41  				x11ext_handle = NULL;
    1.42  			}
    1.43 +			if (xrender_handle != NULL) {
    1.44 +				SDL_UnloadObject(xrender_handle);
    1.45 +				xrender_handle = NULL;
    1.46 +			}
    1.47 +			if (xrandr_handle != NULL) {
    1.48 +				SDL_UnloadObject(xrandr_handle);
    1.49 +				xrandr_handle = NULL;
    1.50 +			}
    1.51  		}
    1.52  	}
    1.53  	#endif
    1.54 @@ -146,6 +158,8 @@
    1.55  		int *thismod = NULL;
    1.56  		x11_handle = SDL_LoadObject(x11_library);
    1.57  		x11ext_handle = SDL_LoadObject(x11ext_library);
    1.58 +		xrender_handle = SDL_LoadObject(xrender_library);
    1.59 +		xrandr_handle = SDL_LoadObject(xrandr_library);
    1.60  		#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
    1.61  		#define SDL_X11_SYM(a,fn,x,y,z) p##fn = X11_GetSym(#fn,thismod);
    1.62  		#include "SDL_x11sym.h"